예제 #1
0
 public ActionResult BackApply(ApplyBillEntity applyBillEntity, int?keyValue)
 {
     if (keyValue != null)
     {
         var apply = applyBillApp.GetForm(keyValue.Value);
         apply.backReason  = applyBillEntity.backReason;
         apply.appAuthDate = null;
         apply.appAuthIdea = null;
         apply.appAuthMan  = null;
         apply.appAuthTag  = "M";
         apply.appExaDate  = null;
         apply.appExaIdea  = null;
         apply.appExaMan   = null;
         apply.appExaTag   = "M";
         applyBillApp.SubmitForm(apply, keyValue);
         return(Success("操作成功。"));
     }
     return(Error("操作失败。"));
 }
예제 #2
0
        public ActionResult SubmitForm(ApplyBillEntity applyBillEntity, int?keyValue, string code)
        {
            ApplyBillEntity apply    = null;
            var             userName = OperatorProvider.Provider.GetCurrent().UserName;

            apply = applyBillApp.GetForm(keyValue.Value);
            var price = priceApp.GetFormJson(applyBillEntity.priNO);

            if (!string.IsNullOrEmpty(code))//转厂
            {
                ApplyBillEntity apply1    = new ApplyBillEntity();
                var             applyBill = applyBillApp.GetForm(keyValue.Value);
                apply1.purNo       = applyBillApp.ProducePurNO(applyBillEntity.purSup, price.currency.Value);
                apply1.appExaTag   = applyBill.appExaTag;
                apply1.appExaDate  = applyBill.appExaDate;
                apply1.appExaIdea  = applyBill.appExaIdea;
                apply1.appExaMan   = applyBill.appExaMan;
                apply1.appAuthTag  = applyBill.appAuthTag;
                apply1.appAuthDate = applyBill.appAuthDate;
                apply1.appAuthMan  = applyBill.appAuthMan;
                apply1.appAuthIdea = applyBill.appAuthIdea;
                apply1.prdName     = applyBill.prdName;
                apply1.spc         = applyBill.spc;
                apply1.rem         = applyBill.rem;
                apply1.prdNo       = applyBill.prdNo;
                apply1.useGroup    = applyBill.useGroup;
                apply1.viceNum     = applyBill.viceNum;
                apply1.viceUnit    = applyBill.viceUnit;
                apply1.appNum      = (applyBill.appNum ?? 0) - (applyBill.yiJiaoNum ?? 0);
                apply1.appUnit     = applyBill.appUnit;
                apply1.purIsTem    = applyBill.purIsTem;
                apply1.WAREWAY     = applyBill.WAREWAY;
                apply1.hopeDD      = applyBill.hopeDD;
                apply1.mat         = applyBill.mat;
                apply1.orderNo     = applyBill.orderNo;
                apply1.appMan      = applyBill.appMan;
                apply1.appDep      = applyBill.appDep;
                apply1.date        = applyBill.date;
                apply1.isPreMoney  = "N";
                apply1.prtTag      = "F";
                apply1.caseTag     = "F";
                apply1.purWay      = 0;
                apply1.purAuthTag  = "D";
                apply1.purExaTag   = "D";
                apply1.purDD       = DateTime.Now;
                apply1.purExaMan   = applyBillEntity.purExaMan;
                apply1.purAuthMan  = applyBillEntity.purAuthMan;
                apply1.purSup      = applyBillEntity.purSup;
                apply1.purPrice    = applyBillEntity.purPrice;
                apply1.priNO       = applyBillEntity.priNO;
                apply1.purMan      = userName;
                apply1.priNO       = applyBillEntity.priNO;
                apply1.purExaDate  = null;
                apply1.purAuthDate = null;
                apply1.purAuthIdea = null;
                apply1.purExaIdea  = null;
                applyBillApp.SubmitForm(apply1);
                applyBill.caseTag = "T";//当前项结案
                applyBill.rem     = "转厂:" + apply1.purNo;
                applyBillApp.SubmitForm(applyBill, applyBill.ID);
                if (!string.IsNullOrEmpty(apply1.purExaMan))
                {
                    var purExaMan = userApp.GetFormByName(apply1.purExaMan);
                    mHelper.MailServer = "10.110.120.2";
                    if (!string.IsNullOrEmpty(purExaMan.F_Email))
                    {
                        mHelper.Send(purExaMan.F_Email, "采购单审核", "你好," + apply1.purMan + "有采购单需要你登录OA去做审核,请点击链接<a>http://10.110.120.6:8090/</a>");
                    }
                }
            }
            else  //转单
            {
                apply.purNo       = applyBillApp.ProducePurNO(applyBillEntity.purSup, price.currency.Value);
                apply.purDD       = DateTime.Now;
                apply.purExaMan   = applyBillEntity.purExaMan;
                apply.purAuthMan  = applyBillEntity.purAuthMan;
                apply.purSup      = applyBillEntity.purSup;
                apply.purPrice    = applyBillEntity.purPrice;
                apply.priNO       = applyBillEntity.priNO;
                apply.purMan      = userName;
                apply.priNO       = applyBillEntity.priNO;
                apply.purExaDate  = null;
                apply.purAuthDate = null;
                apply.purAuthIdea = null;
                apply.purExaIdea  = null;
                if (apply.purExaTag != "D")
                {
                    apply.purExaTag = "M";
                }
                if (apply.purAuthTag == "F")
                {
                    apply.purAuthTag = "M";
                }
                applyBillApp.SubmitForm(apply, keyValue);//转单
                if (!string.IsNullOrEmpty(apply.purExaMan))
                {
                    var purExaMan = userApp.GetFormByName(apply.purExaMan);
                    mHelper.MailServer = "10.110.120.2";
                    if (!string.IsNullOrEmpty(purExaMan.F_Email))
                    {
                        mHelper.Send(purExaMan.F_Email, "采购单审核", "你好," + apply.purMan + "有采购单需要你登录OA去做审核,请点击链接<a>http://10.110.120.6:8090/</a>");
                    }
                }
            }


            return(Success("操作成功。"));
        }