示例#1
0
 public  void ReleaseCheckListOrder(CheckListOrderMaster checkListOrderMaster){
     checkListOrderMaster.Status = CodeMaster.CheckListOrderStatus.Submit;
     genericMgr.Update(checkListOrderMaster);
     foreach (CheckListOrderDetail d in checkListOrderMaster.CheckListOrderDetailList)
     {
         genericMgr.Update(d);
     }
    }
        public ActionResult Edit(CheckListOrderMaster checkListOrder)
        {
            if (ModelState.IsValid)
            {

                this.genericMgr.UpdateWithTrim(checkListOrder);
                SaveSuccessMessage("巡检单修改成功");
            }

            return View(checkListOrder);
        }
示例#3
0
        public void CreateCheckListOrder(CheckListOrderMaster checkListOrderMaster)
        {
            CheckListMaster checkListMaster = genericMgr.FindById<CheckListMaster>(checkListOrderMaster.CheckListCode);

            IList<CheckListDetail> checkListDetailList = genericMgr.FindAll<CheckListDetail>("from CheckListDetail c where c.CheckListCode = ?", new object[] { checkListOrderMaster.CheckListCode });

       
            checkListOrderMaster.Code = "CL" + DateTime.Now.ToString("yyyyMMddHHmmss");
            checkListOrderMaster.CheckListCode = checkListMaster.Code;
            checkListOrderMaster.CheckListName = checkListMaster.Name;
            checkListOrderMaster.Status = CodeMaster.CheckListOrderStatus.Create;

            genericMgr.Create(checkListOrderMaster);

            foreach (CheckListDetail checkListDetail in checkListDetailList)
            {
                CheckListOrderDetail checkListOrderDetail = new CheckListOrderDetail();
                checkListOrderDetail.CheckListCode = checkListDetail.CheckListCode;
                checkListOrderDetail.CheckListDetailCode = checkListDetail.Code;
                checkListOrderDetail.MaxValue = checkListDetail.MaxValue;
                checkListOrderDetail.MinValue = checkListDetail.MinValue;
                checkListOrderDetail.OrderNo = checkListOrderMaster.Code;
                checkListOrderDetail.Description = checkListDetail.Description;
                checkListOrderDetail.IsNormal = true;
                genericMgr.Create(checkListOrderDetail);


            }

        }
        public ActionResult New(CheckListOrderMaster checkListOrder)
        {
            if (ModelState.IsValid)
            {

                facilityMgr.CreateCheckListOrder(checkListOrder);
                SaveSuccessMessage("巡检单新增成功");
                return RedirectToAction("Edit/" + checkListOrder.Code);

            }

            return View(checkListOrder);
        }