当前位置: 首页>>代码示例>>C#>>正文


C# SidejobModel.SidejobEntities类代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:haithemaraissia,项目名称:Done,代码行数:34,代码来源:ProfessionLCIDTest.aspx.cs

示例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;
            }
        }
    }
开发者ID:haithemaraissia,项目名称:Advertise,代码行数:35,代码来源:SideJobResultQuery.aspx.cs

示例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);
                }
            }
        }
    }
开发者ID:haithemaraissia,项目名称:SJSchedule,代码行数:25,代码来源:AutomatedEmail.cs

示例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();
        }
    }
开发者ID:haithemaraissia,项目名称:Export,代码行数:31,代码来源:NewProjectBidProcess.cs

示例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;
     }
 }
开发者ID:haithemaraissia,项目名称:Export,代码行数:27,代码来源:CustomerRefund.aspx.cs

示例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);
             }
         }
     }
 }
开发者ID:haithemaraissia,项目名称:Advertise,代码行数:32,代码来源:RSSFeed.aspx.cs

示例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);

                }
            }
        }
    }
开发者ID:haithemaraissia,项目名称:Export,代码行数:33,代码来源:NewOpportunityTimeUp.aspx.cs

示例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();
                }
            }
        }
开发者ID:haithemaraissia,项目名称:Done,代码行数:32,代码来源:ProfessionLCIDTest.aspx.cs

示例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();
     }
 }
开发者ID:haithemaraissia,项目名称:Export,代码行数:31,代码来源:TimeUpProcess.aspx.cs

示例10: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     using (var context = new SidejobEntities())
               {
                   ProjectID = 20;
                   CleanUpProjectReferences(context);
               }
 }
开发者ID:haithemaraissia,项目名称:SJSchedule,代码行数:8,代码来源:GenericTest.aspx.cs

示例11: GetCustomer

 public CustomerGeneral GetCustomer()
 {
     using (var context = new SidejobEntities())
     {
         return (from c in context.CustomerGenerals
                 where c.CustomerID == CustomerID
                 select c).FirstOrDefault();
     }
 }
开发者ID:haithemaraissia,项目名称:SJSchedule,代码行数:9,代码来源:CustomerReject.aspx.cs

示例12: GetProfessional

 public Professional GetProfessional()
 {
     using (var context = new SidejobEntities())
     {
         return (Professional)(from c in context.ProfessionalGeneral2
                               where c.ProID == NewProID
                               select c);
     }
 }
开发者ID:haithemaraissia,项目名称:Export,代码行数:9,代码来源:NewOpportunityTimeUp.aspx.cs

示例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();
     }
 }
开发者ID:haithemaraissia,项目名称:SJSchedule,代码行数:23,代码来源:GenericTest.aspx.cs

示例14: GetProfessional

 public ProfessionalGeneral2 GetProfessional()
 {
     using (var context = new SidejobEntities())
     {
         return (from c in context.ProfessionalGeneral2
                 where c.ProID == ProfessionalID
                 select c).FirstOrDefault();
     }
 }
开发者ID:haithemaraissia,项目名称:Export,代码行数:9,代码来源:ProfessionalNewOpportunity.aspx.cs

示例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();
     }
 }
开发者ID:haithemaraissia,项目名称:Export,代码行数:9,代码来源:ProfessionalNewOpportunity.aspx.cs


注:本文中的SidejobModel.SidejobEntities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。