Ejemplo n.º 1
0
        /// <summary>
        /// 创建工序计划的日生产计划(已经存在 则更新)
        /// </summary>
        /// <param name="itemList"></param>
        /// <param name="CEmployeeNum"></param>
        /// <param name="CEmployeeName"></param>
        /// <returns></returns>
        public static bool CreateDayWorkPlan(List <DayClassWorkPlan> itemList, string CEmployeeNum, string CEmployeeName)
        {
            bool result = false;

            List <ClassWorkPlan> cwpList = new List <ClassWorkPlan>();

            if (itemList != null && itemList.Count > 0)
            {
                foreach (var item in itemList)
                {
                    //第一天
                    if (item.FirstQty > 0)
                    {
                        ClassWorkPlan cwp = CopyDayWorkPlan(item, item.FirstDay, item.FirstQty, CEmployeeNum, CEmployeeName);

                        cwpList.Add(cwp);
                    }

                    //第二天
                    if (item.SecondQty > 0)
                    {
                        ClassWorkPlan cwp = CopyDayWorkPlan(item, item.SecondDay, item.SecondQty, CEmployeeNum, CEmployeeName);

                        cwpList.Add(cwp);
                    }

                    //第三天
                    if (item.ThirdQty > 0)
                    {
                        ClassWorkPlan cwp = CopyDayWorkPlan(item, item.ThirdDay, item.ThirdQty, CEmployeeNum, CEmployeeName);

                        cwpList.Add(cwp);
                    }
                }

                result = BaseEntityFac.SaveBaseData <ClassWorkPlan>(cwpList);
            }
            return(result);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 保存数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="itemList"></param>
 /// <param name="SaveCheckResult"></param>
 /// <returns></returns>
 public bool SaveBaseData <T>(List <T> itemList, bool SaveCheckResult) where T : class
 {
     return(BaseEntityFac.SaveBaseData(itemList, SaveCheckResult));
 }