/// <summary>
 /// Create a new PendingProject object.
 /// </summary>
 /// <param name="projectID">Initial value of the ProjectID property.</param>
 /// <param name="lCID">Initial value of the LCID property.</param>
 /// <param name="jobTitle">Initial value of the JobTitle property.</param>
 /// <param name="startDate">Initial value of the StartDate property.</param>
 /// <param name="endDate">Initial value of the EndDate property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="datePosted">Initial value of the DatePosted property.</param>
 public static PendingProject CreatePendingProject(global::System.Int64 projectID, global::System.Int32 lCID, global::System.String jobTitle, global::System.DateTime startDate, global::System.DateTime endDate, global::System.String address, global::System.DateTime datePosted)
 {
     PendingProject pendingProject = new PendingProject();
     pendingProject.ProjectID = projectID;
     pendingProject.LCID = lCID;
     pendingProject.JobTitle = jobTitle;
     pendingProject.StartDate = startDate;
     pendingProject.EndDate = endDate;
     pendingProject.Address = address;
     pendingProject.DatePosted = datePosted;
     return pendingProject;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the PendingProjects EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPendingProjects(PendingProject pendingProject)
 {
     base.AddObject("PendingProjects", pendingProject);
 }
Ejemplo n.º 3
0
    public void UpdatePendingProject(SidejobEntities context)
    {
        var t = (from c in context.Projects
                 where c.StatusInt == 2
                 select c).ToList();
        foreach (var t1 in t)
        {
            var exist = (from c in context.PendingProjects
                         where c.ProjectID == t1.ProjectID
                         select c).ToList();
            if (exist.Count == 0)
            {
                var existprojectrequirement = (from c in context.ProjectRequirements
                                               where c.ProjectID == t1.ProjectID
                                               select c).FirstOrDefault();
                if (existprojectrequirement != null)
                {
                    var newpendingproject = new PendingProject
                                                {

                                                    ProjectID = existprojectrequirement.ProjectID,
                                                    LCID = existprojectrequirement.LCID,
                                                    JobTitle = existprojectrequirement.JobTitle,
                                                    StartDate = existprojectrequirement.StartDate,
                                                    EndDate = existprojectrequirement.EndDate,
                                                    Description = existprojectrequirement.Description,
                                                    SpecialNotes = existprojectrequirement.SpecialNotes,
                                                    Address = existprojectrequirement.Address,
                                                    DatePosted = existprojectrequirement.DatePosted
                                                };
                    context.AddToPendingProjects(newpendingproject);
                    context.SaveChanges();
                }
            }
        }
    }