示例#1
0
        public PlanDetailHeadCount UpdatePlanDetailHeadCount(PlanDetailHeadCount PlanDetailHeadCount)
        {
            var c = ctx.PlanDetailHeadCount.Where(x => x.ID == PlanDetailHeadCount.ID).First();

            if (c != null)
            {
                c.PlanDetailID         = PlanDetailHeadCount.PlanDetailID;
                c.ProjectID            = PlanDetailHeadCount.ProjectID;
                c.EmployeeRoleByTypeID = PlanDetailHeadCount.EmployeeRoleByTypeID;
                c.Month1  = PlanDetailHeadCount.Month1;
                c.Month2  = PlanDetailHeadCount.Month2;
                c.Month3  = PlanDetailHeadCount.Month3;
                c.Month4  = PlanDetailHeadCount.Month4;
                c.Month5  = PlanDetailHeadCount.Month5;
                c.Month6  = PlanDetailHeadCount.Month6;
                c.Month7  = PlanDetailHeadCount.Month7;
                c.Month8  = PlanDetailHeadCount.Month8;
                c.Month9  = PlanDetailHeadCount.Month9;
                c.Month10 = PlanDetailHeadCount.Month10;
                c.Month11 = PlanDetailHeadCount.Month11;
                c.Month12 = PlanDetailHeadCount.Month12;
                ctx.SaveChanges();
            }
            return(c);
        }
示例#2
0
 /// <summary>
 /// Create PlanDetailHeadCount and at least one PlanDetailHeadCount sign in.
 /// </summary>
 /// <param name="PlanDetailHeadCount"></param>
 /// <returns></returns>
 public PlanDetailHeadCount CreatePlanDetailHeadCount(PlanDetailHeadCount PlanDetailHeadCount)
 {
     ctx.PlanDetailHeadCount.Add(PlanDetailHeadCount);
     ctx.SaveChanges();
     return(PlanDetailHeadCount);
 }