本文整理汇总了C#中SidejobModel.SidejobEntities类的典型用法代码示例。如果您正苦于以下问题:C# SidejobEntities类的具体用法?C# SidejobEntities怎么用?C# SidejobEntities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SidejobEntities类属于SidejobModel命名空间,在下文中一共展示了SidejobEntities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindSpecialityList
public IEnumerable BindSpecialityList(string lcid, string jobcategory)
{
try
{
using (var context = new SidejobEntities())
{
switch (Convert.ToInt32(lcid))
{
case 1:
return (from c in context.Jobs
where c.JobCategory == jobcategory && c.JobRank >= 1 && c.JobRank <= 13
select c).ToList();
case 2:
return (from c in context.JobsFrs
where c.JobCategory == jobcategory && c.JobRank >= 1 && c.JobRank <= 13
select c).ToList();
default:
return (from c in context.Jobs
where c.JobCategory == jobcategory && c.JobRank >= 1 && c.JobRank <= 13
select c).ToList();
}
}
}
catch (Exception)
{
using (var context = new SidejobEntities())
{
return (from c in context.Jobs
where c.JobCategory == jobcategory && c.JobRank >= 1 && c.JobRank <= 13
select c).ToList();
}
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
using (var context = new SidejobEntities())
{
try
{
var CustomerContractID = 1;
var customerID = 165;
var customerContract = (from c in context.CustomerContracts
where c.ContractID == CustomerContractID
select c).FirstOrDefault();
var projectrequirement = (from pr in context.ProjectRequirements
where pr.ProjectID == customerContract.ProjectID
select pr).FirstOrDefault();
//LCID
// Description have to be invoked by google translate
//Only 5 photos max might be
var s = from ph in context.ProjectPhotoes
where ph.ProjectID == customerContract.ProjectID
select ph;
//var projectphoto = ( from ph in context.projects)
}
catch (Exception)
{
throw;
}
}
}
示例3: AutomatedMessageProcessStart
public void AutomatedMessageProcessStart()
{
using (var context = new SidejobEntities())
{
var message = (from c in context.AutomatedMessages
select c).ToList();
if (message.Count == 0) return;
foreach (var m in message)
{
try
{
SendEmail(m.EmailAddress,
"http://www.my-side-job.com/Schedule/MySideJob/EmailTemplates/AutomatedMessage.aspx",
m.Title, m.MessageID.ToString(CultureInfo.InvariantCulture));
// context.DeleteObject(m);
context.SaveChanges();
}
catch (Exception)
{
CatchMessage(context, m);
}
}
}
}
示例4: DeletePreviousBidderWin
public void DeletePreviousBidderWin(SidejobEntities context, int projectId)
{
var previous = (from c in context.ClosedProjects
where c.ProjectID == projectId
select c.BidderID).FirstOrDefault();
if (previous != null)
{
var bids = (from c in context.Bids
where c.ProjectID == projectId && c.BidderID == previous
orderby c.AmountOffered descending
select c).FirstOrDefault();
if (bids != null)
{
int previousbidid = bids.BidID;
context.DeleteObject(bids);
var previouswinnerbid = (from c in context.ProfessionalWinBids
where c.ProID == previous
&& c.BidID == previousbidid
select c).FirstOrDefault();;
if (previouswinnerbid != null)
{
context.DeleteObject(previouswinnerbid);
}
}
context.SaveChanges();
}
}
示例5: MessageProperties
protected void MessageProperties()
{
//GET THE PDTID FORM ARCHIVE REFUND
const string singlespace = " ";
const string startofBoldRed = "<span class='DarkRed'><strong>";
const string lastofBoldRed = "</strong></span>";
PDTID = Convert.ToInt32(Request.QueryString["pdtid"]);
ProjectID = Convert.ToInt32(Request.QueryString["prid"]);
CustomerID = Convert.ToInt32(Request.QueryString["cid"]);
if (ProjectID == 0) return;
ProjectNotification.Text = Resources.Resource.Project + singlespace + ProjectID + singlespace +
Resources.Resource.Notification;
ConfirmationEmail.Text = Resources.Resource.RefundEmailMessage1 + singlespace
+ startofBoldRed + ProjectID + lastofBoldRed + singlespace +
Resources.Resource.RefundEmailMessage2;
using (var context = new SidejobEntities())
{
var archiveRefund = (from c in context.ArchivedRefundCustomerSuccessfulPDTs
where c.PDTID == PDTID
select c).FirstOrDefault();
if (archiveRefund == null) return;
Amount.Text = archiveRefund.GrossTotal.ToString(CultureInfo.InvariantCulture) +
singlespace + archiveRefund.CurrencyCode.ToString(CultureInfo.InvariantCulture) + singlespace;
Transaction.Text = archiveRefund.TransactionId;
NameLabel.Text = archiveRefund.FirstName + singlespace + archiveRefund.LastName;
}
}
示例6: ProjectPhoto
public void ProjectPhoto(TopProject[] results)
{
using (var context = new SidejobEntities())
{
for (var i = 0; i < 3; i++)
{
int projectID = results[i].ProjectID;
var minimunPhotoRank = from ph in context.ProjectPhotoes
where ph.PhotoRank != -1 && ph.ProjectID == projectID
orderby ph.PhotoRank descending
select ph;
var photopath = from ph in context.ProjectPhotoes
where ph.PhotoRank == -1 && ph.ProjectID == projectID
select ph;
if (minimunPhotoRank.Any())
{
int rank = int.Parse(minimunPhotoRank.First().PhotoRank.ToString(CultureInfo.InvariantCulture));
photopath = from ph in context.ProjectPhotoes
where ph.PhotoRank == rank && ph.ProjectID == projectID
select ph;
}
var firstOrDefault = photopath.FirstOrDefault();
if (firstOrDefault != null)
results[i].SetPath(firstOrDefault.PhotoPath.ToString(CultureInfo.InvariantCulture));
else
{
const string projectMissingPrimaryPicture = "http://www.haithem-araissia.com/WIP2/RightCleanSideJOB2008FromInetpub/CleanSIDEJOB2008/Images/NoWorkShopImage.jpg";
results[i].SetPath(projectMissingPrimaryPicture);
}
}
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
using (var context = new SidejobEntities())
{
var projects = (from pr in context.ClosedProjects
select pr).ToList();
foreach (var p in projects)
{
var p1 = p;
var newopportunity = (from cp in context.ProjectSecondChances
where p1 != null && cp.ProjectID == p1.ProjectID
select cp);
if (newopportunity.Count() == 2)
{
ProjectID = p.ProjectID;
//Save to ArchivedProjectSecondChance
SavedToArchivedProjectSecondChance(context, newopportunity);
//Delete Previous BidderWin and Bids
DeletePreviousBidderWin(context, ProjectID);
//Add Current BidderWin
AddNewBidderWin(context, ProjectID);
//update project
Updateproject(context);
}
}
}
}
示例8: BindIndusty
public IEnumerable BindIndusty(string lcid)
{
try
{
using (var context = new SidejobEntities())
{
switch (Convert.ToInt32(lcid))
{
case 1:
return (from c in context.Categories
select c).ToList();
case 2:
return (from c in context.CategoriesFrs
select c).ToList();
default:
return (from c in context.Categories
select c).ToList();
}
}
}
catch (Exception)
{
using (var context = new SidejobEntities())
{
return (from c in context.Categories
select c).ToList();
}
}
}
示例9: EmailAutomation
public void EmailAutomation()
{
using (var context = new SidejobEntities())
{
var message = (from c in context.AutomatedMessages
select c).ToList();
if (message.Count != 0)
{
foreach (var e in message)
{
try
{
SendEmail(e.EmailAddress, e.Title, e.MessageID.ToString(CultureInfo.InvariantCulture), Server.MapPath("~/EmailTemplates/AutomatedMessage.aspx"), Message.Automated);
}
catch (Exception emailexception)
{
var emailProblem = new AutomationEmailProblem
{
MessageID = e.MessageID,
EmailAddress = e.EmailAddress,
Title = e.Title,
Message = e.Message
};
context.AddToAutomationEmailProblems(emailProblem);
}
}
}
context.DeleteObject(message);
context.SaveChanges();
}
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
using (var context = new SidejobEntities())
{
ProjectID = 20;
CleanUpProjectReferences(context);
}
}
示例11: GetCustomer
public CustomerGeneral GetCustomer()
{
using (var context = new SidejobEntities())
{
return (from c in context.CustomerGenerals
where c.CustomerID == CustomerID
select c).FirstOrDefault();
}
}
示例12: GetProfessional
public Professional GetProfessional()
{
using (var context = new SidejobEntities())
{
return (Professional)(from c in context.ProfessionalGeneral2
where c.ProID == NewProID
select c);
}
}
示例13: GetValue
//private void GetValue(SidejobEntities context)
//{
// var projectsecondchance = (from c in context.ProjectSecondChances
// where c.ProjectID == ProjectID
// select c).ToList();
// if (projectsecondchance.Count != 0)
// {
// foreach (var psc in projectsecondchance)
// {
// context.DeleteObject(psc);
// context.SaveChanges();
// }
// }
//}
private void GetValue(SidejobEntities context, ICollection somelist)
{
if (somelist.Count <= 0) return;
foreach (var item in somelist)
{
context.DeleteObject(item);
context.SaveChanges();
}
}
示例14: GetProfessional
public ProfessionalGeneral2 GetProfessional()
{
using (var context = new SidejobEntities())
{
return (from c in context.ProfessionalGeneral2
where c.ProID == ProfessionalID
select c).FirstOrDefault();
}
}
示例15: GetCustomer
public CustomerGeneral2 GetCustomer(int customerid)
{
using (var context = new SidejobEntities())
{
return (from c in context.CustomerGeneral2
where c.CustomerID == customerid
select c).FirstOrDefault();
}
}