protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     //判定是否是认领收款,如果是认领收款则要做金额限制校验
     if (!String.IsNullOrEmpty(dic.GetValue("RegisterID")))
     {
         var receiptRegister = this.GetEntityByID <S_M_ReceiptRegister>(dic.GetValue("RegisterID"));
         if (receiptRegister == null)
         {
             throw new Formula.Exceptions.BusinessValidationException("未能找到对应的到款登记记录,无法认领到款");
         }
         var receiptID       = dic.GetValue("ID");
         var confirmValue    = this.EPCEntites.Set <S_M_Receipt>().Where(d => d.RegisterID == receiptRegister.ID && d.ID != receiptID).Sum(d => d.ReceiptValue);
         var sumConfirmValue = (confirmValue.HasValue ? confirmValue.Value : 0m) + (String.IsNullOrEmpty(dic.GetValue("ReceiptValue")) ? 0m :
                                                                                    Convert.ToDecimal(dic.GetValue("ReceiptValue")));
         //if (sumConfirmValue > receiptRegister.ReceiptValue)
         //    throw new Formula.Exceptions.BusinessValidationException("认领金额总和不能大于收款登记总金额【" + receiptRegister.ReceiptValue + "】");
     }
     if (isNew)
     {
         if (!String.IsNullOrEmpty(dic.GetValue("RegisterID")))
         {
             dic.SetValue("State", "Create");
         }
     }
 }
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var entity = this.GetEntityByID(dic.GetValue("ID"));

            if (entity == null)
            {
                throw new Formula.Exceptions.BusinessValidationException("保存失败,未能找到指定的收款记录");
            }
            //设置到款与发票和计划的关联关系
            entity.SetRelateInfo();

            //重新汇总合同上的实际到款数据
            var contract = this.GetEntityByID <S_M_ContractInfo>(dic.GetValue("ContractInfo"));

            contract.SummaryReceiptData();

            //重新汇总合同下各收款项的实际到款数据
            foreach (var item in contract.S_M_ContractInfo_ReceiptObj.ToList())
            {
                item.SummaryReceiptValue();
            }
            //如果是通过到款认领功能进行拆分登记,则需要汇总到款登记上的实际认领金额数据
            if (!String.IsNullOrEmpty(entity.RegisterID))
            {
                var receiptRegister = this.GetEntityByID <S_M_ReceiptRegister>(entity.RegisterID);
                receiptRegister.SumConfirmValue();
            }
            this.EPCEntites.SaveChanges();
        }
Beispiel #3
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            DateTime incomeSubmitEndDate = DateTime.Now;

            DateTime.TryParse(dic.GetValue("IncomeSubmitEndDate"), out incomeSubmitEndDate);
            CostFO.ValidatePeriodIsClosed(incomeSubmitEndDate);
        }
Beispiel #4
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            Dictionary <string, object> objDic = new Dictionary <string, object>();

            foreach (var tmp in dic)
            {
                objDic.Add(tmp.Key, tmp.Value);
            }
            dic.SetValue("CtrlSourceAttr", JsonHelper.ToJson(objDic));
            var apportionDefine = this.GetDataDicByID("S_EP_DefineApportion", dic.GetValue("ApportionDefine"), Config.ConnEnum.InfrasBaseConfig);

            if (apportionDefine == null)
            {
                throw new Formula.Exceptions.BusinessValidationException("没有找到对应的成本分摊定义,保存失败");
            }

            var dt = this.SQLDB.ExecuteDataTable(String.Format("SELECT * FROM S_EP_LockAccount WHERE State='{2}' AND BelongYear={0} AND BelongMonth={1}",
                                                               dic.GetValue("BelongYear"), dic.GetValue("BelongMonth"), "Finish"));

            if (dt.Rows.Count > 0)
            {
                throw new Formula.Exceptions.BusinessValidationException(String.Format("{0}年{1}月已经结账锁定,无法进行分摊计算", dic.GetValue("BelongYear"),
                                                                                       dic.GetValue("BelongMonth")));
            }

            dic.SetValue("CostType", apportionDefine.GetValue("CostType"));
            dic.SetValue("ApportionDefineCode", apportionDefine.GetValue("Code"));
            //CostFO.ValidatePeriodIsSettled(DateTime.Now);
        }
Beispiel #5
0
 protected override void BeforeSaveSubTable(Dictionary <string, string> dic, string subTableName, List <Dictionary <string, string> > detailList,
                                            Base.Logic.Domain.S_UI_Form formInfo)
 {
     if (subTableName == "ReceiptObjRelation")
     {
         var sumRelation  = 0M;
         var invoiceValue = String.IsNullOrEmpty(dic.GetValue("InvoiceValue")) ? 0m : Convert.ToDecimal(dic.GetValue("InvoiceValue"));
         foreach (var item in detailList)
         {
             var relationValue = String.IsNullOrEmpty(item.GetValue("RelationValue")) ? 0m : Convert.ToDecimal(item.GetValue("RelationValue"));
             sumRelation += relationValue;
         }
         if (sumRelation > invoiceValue)
         {
             throw new Formula.Exceptions.BusinessValidationException("关联的收款项金额不能大于开票金额");
         }
     }
     if (subTableName == "InvoiceDetail")
     {
         var totalValue   = detailList.Select(c => String.IsNullOrEmpty(c.GetValue("DetailValue")) ? 0m : Convert.ToDecimal(c.GetValue("DetailValue"))).Sum();
         var invoiceValue = String.IsNullOrEmpty(dic.GetValue("InvoiceValue")) ? 0m : Convert.ToDecimal(dic.GetValue("InvoiceValue"));
         if (detailList.Count > 0)
         {
             if (totalValue != invoiceValue)
             {
                 throw new Formula.Exceptions.BusinessValidationException("发票明细的发票金额总和必须等于开票金额【" + invoiceValue + "】");
             }
         }
     }
 }
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     if (isNew)
     {
         dic.SetValue("IsApprove", "False");
     }
     else
     {
         var entity = BusinessEntities.Set <T_Qualification_Postqualificationmanagement>().Find(dic.GetValue("ID"));
         if (entity.IsApprove == "True")
         {
             throw new Exception("当前岗位资格记录已经审批通过,不能修改");
         }
         if (string.IsNullOrEmpty(entity.T_Qualification_PostTotalID))
         {
             return;
         }
         var postTotal = BusinessEntities.Set <T_Qualification_PostTotal>().Find(entity.T_Qualification_PostTotalID);
         if (postTotal != null)
         {
             if (!string.IsNullOrEmpty(postTotal.FlowPhase) && (postTotal.FlowPhase == "End" || postTotal.FlowPhase == "Processing"))
             {
                 throw new Exception("当前岗位资格记录已发起审批,不能修改");
             }
         }
     }
 }
Beispiel #7
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var contract = this.GetEntityByID <S_P_ContractInfo>(dic.GetValue("ContractInfo"));

            if (contract == null)
            {
                throw new Formula.Exceptions.BusinessValidationException("未能找到指定的合同信息");
            }
            var invoiceID     = dic.GetValue("ID");
            var invoiceValue  = String.IsNullOrEmpty(dic.GetValue("InvoiceValue")) ? 0m : Convert.ToDecimal(dic.GetValue("InvoiceValue"));
            var remainValue   = Convert.ToDecimal(contract.S_P_Invoice.Where(d => d.ID != invoiceID).Sum(d => d.InvoiceValue));
            var contractValue = Convert.ToDecimal(contract.ContractAmount);

            if (dic.GetValue("InvoiceType") == "CreditNote")
            {
                if (Math.Abs(invoiceValue) > Math.Abs(remainValue))
                {
                    throw new Formula.Exceptions.BusinessValidationException("红冲发票金额不能超过已开票金额");
                }

                var     tmp = dic.GetValue("InvoiceValue");
                decimal val = 0;
                decimal.TryParse(tmp, out val);
                dic.SetValue("InvoiceValue", (-val).ToString());//红冲取反
            }
            else
            {
                if (invoiceValue + remainValue > contractValue)
                {
                    throw new Formula.Exceptions.BusinessValidationException("累计开票金额不能超过合同总金额");
                }
            }
        }
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            string employeeID = dic.GetValue("EmployeeID");
            var    employee   = BusinessEntities.Set <T_Employee>().Find(employeeID);

            if (employee != null)
            {
                var ad = BusinessEntities.Set <T_EmployeeAcademicDegree>().Where(c => c.EmployeeID == employee.ID).OrderBy("GraduationDate", false).FirstOrDefault();
                if (ad != null)
                {
                    if (DateTime.Compare((DateTime)ad.GraduationDate, Convert.ToDateTime(dic.GetValue("GraduationDate"))) > 0)
                    {
                        employee.Educational      = ad.Education;
                        employee.EducationalMajor = ad.FirstProfession;
                    }
                    else
                    {
                        employee.Educational      = dic.GetValue("Education");
                        employee.EducationalMajor = dic.GetValue("FirstProfession");
                    }
                }
                else
                {
                    employee.Educational      = null;
                    employee.EducationalMajor = null;
                }
            }
            this.BusinessEntities.SaveChanges();
        }
Beispiel #9
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            string   datetTimeStr = dic.GetValue("FactEndDate");
            DateTime dateTime     = Convert.ToDateTime(datetTimeStr);

            CostFO.ValidatePeriodIsClosed(dateTime);
        }
Beispiel #10
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var detailList = JsonHelper.ToObject <List <Dictionary <string, string> > >(dic["ManageWorkloadList"]);
            var cbsids     = detailList.Select(a => a.GetValue("CBSID"));
            var cbsList    = this.BusinessEntities.Set <S_C_CBS>().Where(a => cbsids.Contains(a.ID)).ToList();

            if (cbsList.Count != detailList.Count)
            {
                throw new Formula.Exceptions.BusinessException("S_C_CBS数据不匹配,请联系管理员");
            }
            string msgCBS = "";

            foreach (var item in detailList)
            {
                var cbs        = cbsList.FirstOrDefault(a => a.ID == item.GetValue("CBSID"));
                var settlement = 0m;
                if (!string.IsNullOrEmpty(item.GetValue("Settlement")))
                {
                    settlement = Convert.ToDecimal(item.GetValue("Settlement"));
                }
                decimal remain = Convert.ToDecimal(cbs.Quantity) - Convert.ToDecimal(cbs.SummaryCostQuantity);
                if (settlement > remain)
                {
                    msgCBS += item["Name"].ToString() + ",";
                }
            }
            if (!string.IsNullOrEmpty(msgCBS))
            {
                throw new Formula.Exceptions.BusinessException("管理工时【" + msgCBS.TrimEnd(',') + "】的本次结算工时不能大于可结算工时");
            }
        }
Beispiel #11
0
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     if (isNew)
     {
         throw new Formula.Exceptions.BusinessValidationException("禁止直接新增版本数据,请重新操作");
     }
 }
Beispiel #12
0
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            if (!isNew)
            {
                var name           = dic.GetValue("Name");
                var code           = dic.GetValue("Code");
                var type           = dic.GetValue("Type");
                var belongUser     = dic.GetValue("BelongUser");
                var belongUserName = dic.GetValue("BelongUserName");
                var authInfo       = dic.GetValue("AuthInfo");
                var width          = dic.GetValue("Width");
                var height         = dic.GetValue("Height");
                var blockKey       = dic.GetValue("BlockKey");

                var updateSql = string.Format(@"update S_EP_PlotSealGroup_GroupInfo
set Name='{1}',
Code='{2}',
Type='{3}',
BelongUser='******',
BelongUserName='******',
AuthInfo='{6}',
Width='{7}',
Height='{8}',
BlockKey = '{9}'
where PlotSeal='{0}'", dic.GetValue("ID"), name, code, type, belongUser, belongUserName, authInfo, width, height, blockKey);
                this.ProjectSQLDB.ExecuteNonQuery(updateSql);
            }
        }
Beispiel #13
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            if (isNew)
            {
                dic.SetValue("State", InvoiceApplyState.New.ToString());

                var contract = this.BusinessEntities.Set <S_C_ManageContract>().Find(dic["Contract"]);
                if (contract == null)
                {
                    throw new Formula.Exceptions.BusinessException("必须选择一个合同才能进行开票申请操作");
                }
                var amount = Convert.ToDecimal(dic["Amount"]);
                //从数据库中得到申请中的金额总额
                SQLHelper sqlHeler = SQLHelper.CreateSqlHelper(ConnEnum.Market);
                decimal   dec      = contract.RemainInvoiceValue;
                string    sql      = string.Format(@"select sum(Amount) from T_C_InvoiceApply where FlowPhase!='End'and Contract='{0}'", dic["Contract"]);
                object    sum      = sqlHeler.ExecuteScalar(sql);
                dec -= sum == null || sum == DBNull.Value ? 0m : Convert.ToDecimal(sum);
                if (dec < amount)
                {
                    throw new Formula.Exceptions.BusinessException("开票金额不能大于本合同剩余可开票金额【" + Math.Round(dec, 2) + "】");
                }
            }
            var entity = this.GetEntityByID(dic["ID"]);

            if (entity == null)
            {
                entity = new T_C_InvoiceApply();
            }
            this.UpdateEntity(entity, dic);
            entity.Validate();
        }
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     if (String.IsNullOrEmpty(dic.GetValue("Receiver")))
     {
         var wbsNode = this.GetEntityByID <S_W_WBS>(dic.GetValue("WBSID"));
         if (wbsNode != null)
         {
             var inMajor = dic.GetValue("InMajorValue");
             var majorNodes = wbsNode.AllChildren.Where(d => d.WBSType == WBSNodeType.Major.ToString() && inMajor.Contains(d.WBSValue)).ToList();
             var reciviers = ""; var recivierNames = "";
             foreach (var major in majorNodes)
             {
                 string majorPrinciple = "MajorPrinciple";
                 var    roleList       = major.S_W_RBS.Where(d => d.RoleCode == majorPrinciple).ToList();
                 foreach (var item in roleList)
                 {
                     reciviers     += item.UserID + ",";
                     recivierNames += item.UserName + ",";
                 }
             }
             dic.SetValue("Receiver", reciviers.TrimEnd(','));
             dic.SetValue("ReceiverName", recivierNames.TrimEnd(','));
         }
     }
     if (string.IsNullOrEmpty(dic.GetValue("RelateWBSID")))
     {
         var wbsid   = dic.GetValue("WBSID").Split(',').FirstOrDefault();
         var coopWBS = this.GetEntityByID <S_W_WBS>(wbsid);
         if (coopWBS != null)
         {
             dic.SetValue("RelateWBSID", coopWBS.ParentID);
         }
     }
 }
Beispiel #15
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var GroupInfo = dic.GetValue("GroupInfo");
            var list      = JsonHelper.ToList(GroupInfo);
            var mainSeals = list.Where(a => a.GetValue("IsMain") == "true");

            if (mainSeals.Count() == 0)
            {
                throw new Formula.Exceptions.BusinessException("请选择主章");
            }
            if (mainSeals.Count() > 1)
            {
                throw new Formula.Exceptions.BusinessException("只能有一个图章作为主章");
            }
            var mainSeal    = mainSeals.First();
            var followSeals = list.Where(a => a.GetValue("IsMain") != "true");
            var str         = "主章:" + mainSeal.GetValue("Name");

            if (followSeals.Count() > 0)
            {
                str += ",从章:" + string.Join("、", followSeals.Select(a => a.GetValue("Name")));
            }
            dic.SetValue("GroupDescription", str);
            if (followSeals.Count() == 0)
            {
                dic.SetValue("MainPlotSealID", mainSeal.GetValue("PlotSeal"));
            }
            else
            {
                dic.SetValue("MainPlotSealID", "");
            }
        }
Beispiel #16
0
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            string employeeID = dic.GetValue("EmployeeID");
            var    employee   = BusinessEntities.Set <T_Employee>().Find(employeeID);

            if (employee != null)
            {
                var lastContract = BusinessEntities.Set <T_EmployeeContract>().Where(c => c.EmployeeID == employee.ID).OrderBy("ContractStartDate", false).FirstOrDefault();
                if (lastContract != null)
                {
                    employee.ContractType       = lastContract.ContractCategory;
                    employee.DeterminePostsDate = lastContract.PostDate;
                }
            }

            //只有一个合同生效
            var contractList = BusinessEntities.Set <T_EmployeeContract>().Where(p => p.EmployeeID == employeeID);

            var contractId = dic.GetValue("ID");
            var contract   = BusinessEntities.Set <T_EmployeeContract>().Find(contractId);

            foreach (var item in contractList)
            {
                if (item.ID != contractId)
                {
                    item.IsUseful = "0";
                }
            }

            this.BusinessEntities.SaveChanges();
        }
Beispiel #17
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            dic.SetValue("FullID", dic.GetValue("ID"));
            if (dic.GetValue("IsSubContract") == true.ToString().ToUpper())
            {
                dic.SetValue("FullID", dic.GetValue("ParentContract") + "." + dic.GetValue("ID"));
            }

            if (!string.IsNullOrEmpty(GetQueryString("State")))
            {
                dic.SetValue("ContractState", GetQueryString("State"));
            }
            var ContractAmount = 0.0m;

            decimal.TryParse(dic.GetValue("ContractAmount"), out ContractAmount);
            var contractID = dic.GetValue("ID");
            //验证合同金额不能超过已付款金额
            var sumApplyValue = this.EPCEntites.Set <S_P_Payment>().Where(a => a.ContractInfo == contractID).ToList().Sum(a => a.PaymentValue);                         //s表

            sumApplyValue += this.EPCEntites.Set <T_P_PaymentApply>().Where(a => a.ContractInfo == contractID && a.FlowPhase != "End").ToList().Sum(a => a.ApplyValue); //流程
            if (ContractAmount < sumApplyValue)
            {
                throw new Formula.Exceptions.BusinessValidationException("原币种合同额不能小于已付款金额【" + sumApplyValue + "】");
            }
            var invoiceApplyValue = this.EPCEntites.Set <S_P_Invoice>().Where(a => a.ContractInfo == contractID).ToList().Sum(a => a.InvoiceValue);

            if (ContractAmount < invoiceApplyValue)
            {
                throw new Formula.Exceptions.BusinessValidationException("原币种合同额不能小于收票金额【" + invoiceApplyValue + "】");
            }
        }
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     //if (!string.IsNullOrEmpty(GetQueryString("State")))
     //{
     //    dic.SetValue("ContractState", GetQueryString("State"));
     //}
 }
Beispiel #19
0
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     if (!isNew)
     {
         Expenses.Logic.BusinessFacade.DataInterfaceFo.ValidateDataSyn("S_EP_ReimbursementApply", dic.GetValue("ID"));
     }
     CostFO.ValidatePeriodIsClosed(DateTime.Now);
 }
Beispiel #20
0
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var employee = ComprehensiveDbContext.Set <S_HR_Employee>().Find(dic.GetValue("EmployeeID"));
            var fo       = new EmployeeFo();

            fo.SyncDeptByJob(employee);
            //base.AfterSave(dic, formInfo, isNew);
        }
Beispiel #21
0
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            T_Employee employee = BusinessEntities.Set <T_Employee>().Find(dic.GetValue("EmployeeID"));

            if (employee == null)
            {
                throw new Formula.Exceptions.BusinessException("未找到员工对象");
            }
            StringBuilder sql            = new StringBuilder();
            var           currentListStr = dic.GetValue("CurrentJobList");

            if (!string.IsNullOrEmpty(currentListStr))
            {
                var list = JsonHelper.ToList(currentListStr);
                foreach (var item in list)
                {
                    if (item.GetValue("NeedDelete") == "1")
                    {
                        sql.AppendLine(" delete T_EmployeeJob where id='" + item.GetValue("EmployeeJobID") + "'");
                    }
                }
            }
            var changeListStr = dic.GetValue("ChangeJobList");

            if (!string.IsNullOrEmpty(changeListStr))
            {
                var dtField = DbHelper.GetFieldTable(formInfo.ConnName, "T_EmployeeJob").AsEnumerable();
                var list    = JsonHelper.ToObject <List <Dictionary <string, string> > >(changeListStr);
                foreach (var item in list)
                {
                    item.SetValue("EmployeeID", employee.ID);
                    item.RemoveWhere(a => !dtField.Select(b => b.Field <string>("FIELDCODE").ToUpper()).Contains(a.Key.ToUpper()));
                    sql.AppendLine(item.CreateInsertSql(this.HRSQLDB.DbName, "T_EmployeeJob", FormulaHelper.CreateGuid(), dtField));
                }
            }
            if (sql.ToString() != "")
            {
                if (Config.Constant.IsOracleDb)
                {
                    this.HRSQLDB.ExecuteNonQuery(string.Format(@"
                        begin
                        {0}
                        end;", sql));
                }
                else
                {
                    this.HRSQLDB.ExecuteNonQuery(sql.ToString());
                }
            }

            var updateEmployeeBaseDept = GetQueryString("UpdateEmployeeBaseDept");

            if (updateEmployeeBaseDept == "1")
            {
                employee.UpdateDeptByJob();
                this.BusinessEntities.SaveChanges();
            }
        }
Beispiel #22
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var bid = this.BusinessEntities.Set <S_B_Bid>().Find(dic.GetValue("Project"));

            if (bid != null)
            {
                throw new Formula.Exceptions.BusinessValidationException("【" + dic.GetValue("ProjectName") + "】已经登记了投标信息");
            }
        }
 protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
 {
     if (isNew)
     {
         var id = dic.GetValue("ID");
         dic.SetValue("PhysicalState", PhysicalState.在库.ToString());
     }
     base.BeforeSave(dic, formInfo, isNew);
 }
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            base.BeforeSave(dic, formInfo, isNew);
            S_I_Engineering engineering = EPCEntites.Set <S_I_Engineering>().Find(dic.GetValue("EngineeringInfoID"));

            if (engineering.State != ProjectState.Bid.ToString())
            {
                throw new Formula.Exceptions.BusinessValidationException("已经完成立项的项目不能修改投标结果");
            }
        }
        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var contract = this.GetEntityByID <S_SP_SupplierContract>(dic["SupplierContract"]);

            if (contract != null)
            {
                contract.SummaryData();
                this.BusinessEntities.SaveChanges();
            }
        }
Beispiel #26
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var settleProductionValue = String.IsNullOrEmpty(dic.GetValue("SettleProductionValue")) ? 0 : Convert.ToDecimal(dic.GetValue("SettleProductionValue"));
            var productionValue       = String.IsNullOrEmpty(dic.GetValue("ProductionValue")) ? 0 : Convert.ToDecimal(dic.GetValue("ProductionValue"));

            if (productionValue < settleProductionValue)
            {
                throw new Formula.Exceptions.BusinessValidationException("扣减后的产值金额不能小于已确认产值金额,请重新调整");
            }
        }
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var engineering       = dic.GetValue("Engineering");
            var engineeringInfoID = dic.GetValue("EngineeringInfoID");

            if (!string.IsNullOrEmpty(engineering) && string.IsNullOrEmpty(engineeringInfoID))
            {
                dic.SetValue("EngineeringInfoID", engineering);
            }
        }
        //
        // GET: /AutoForm/ForeignPassportBorrow/

        protected override void AfterSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            if (isNew)
            {
                var PassportID = dic.GetValue("PassportID");
                var Passport   = BusinessEntities.Set <T_Foreign_Passport>().Find(PassportID);
                Passport.PassportState = "借出";
                BusinessEntities.SaveChanges();
            }
        }
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            CheckSubContractConfirmMethod();
            if (String.IsNullOrEmpty(dic.GetValue("ConfirmDate")))
            {
                throw new Formula.Exceptions.BusinessValidationException("委外进度确认必须填写完工日期");
            }
            var dateTime = String.IsNullOrEmpty(dic.GetValue("ConfirmDate")) ? DateTime.Now : Convert.ToDateTime(dic.GetValue("ConfirmDate"));

            CostFO.ValidatePeriodIsClosed(dateTime);
        }
Beispiel #30
0
        protected override void BeforeSave(Dictionary <string, string> dic, Base.Logic.Domain.S_UI_Form formInfo, bool isNew)
        {
            var contractID = dic.GetValue("MainContract");
            //补充协议关联的合同必须有签约日期
            var contract = this.GetEntityByID <S_SP_SupplierContract>(contractID);

            if (contract.SignDate == null)
            {
                throw new Formula.Exceptions.BusinessException("未签约的分包合同不能添加补充协议");
            }
        }