Ejemplo n.º 1
0
        /// <summary>
        /// 保存采购计划单
        /// </summary>
        /// <typeparam name="THead">采购计划头模板</typeparam>
        /// <typeparam name="TDetail">采购计划明细模板</typeparam>
        /// <param name="billHead">采购计划表头</param>
        /// <param name="billDetails">采购计划明细</param>
        public void SaveBill <THead, TDetail>(THead billHead, List <TDetail> billDetails)
        {
            MW_PlanHead          head    = billHead as MW_PlanHead;
            List <MW_PlanDetail> details = billDetails as List <MW_PlanDetail>;

            if (head.PlanHeadID == 0)
            {
                head.RegTime    = System.DateTime.Now;
                head.UpdateTime = System.DateTime.Now;
            }
            else
            {
                head.UpdateTime = System.DateTime.Now;
            }

            BindDb(head);
            head.save();
            if (head.PlanHeadID > 0)
            {
                foreach (MW_PlanDetail detail in details)
                {
                    detail.PlanHeadID = head.PlanHeadID;
                    BindDb(detail);
                    detail.save();
                }
            }
        }
Ejemplo n.º 2
0
        public ServiceResponseData AuditBill()
        {
            try
            {
                MW_PlanHead head = requestData.GetData <MW_PlanHead>(0);
                head.AuditTime = System.DateTime.Now;
                this.BindDb(head);
                head.save();
                responseData.AddData(true);
            }
            catch (Exception error)
            {
                responseData.AddData(false);
                responseData.AddData(error.Message);
            }

            return(responseData);
        }