Пример #1
0
 protected void btnDelete_Click(object sender, System.EventArgs e)
 {
     System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
     if (this.hfldContract.Value.Contains("["))
     {
         list = JsonHelper.GetListFromJson(this.hfldContract.Value);
     }
     else
     {
         list.Add(this.hfldContract.Value);
     }
     try
     {
         foreach (string current in list)
         {
             System.Collections.Generic.List <PayoutContractModel> list2 = this.payoutContract.GetList(string.Format(" Con_Payout_Contract.MainContractID = '{0}'", current));
             if (list2.Count > 0)
             {
                 base.RegisterScript("top.ui.alert('请先删除补充协议!');");
                 return;
             }
             if (this.payoutContract.IsReferenced(current))
             {
                 base.RegisterScript("top.ui.alert('请先删除此合同的关联数据!');");
                 return;
             }
         }
         PayoutTarget payoutTarget = new PayoutTarget();
         payoutTarget.DelByContractId(list);
         this.payoutContract.Delete(list);
         ConConfigContractService conConfigContractService = new ConConfigContractService();
         conConfigContractService.Deltes(list);
         base.RegisterScript("window.location = window.location;");
     }
     catch
     {
         base.RegisterScript("top.ui.alert('删除失败!');");
     }
 }
Пример #2
0
        public string GetPayoutPayAmount(decimal diffRate, string ContractId)
        {
            ConConfigContractService service = new ConConfigContractService();
            string  str      = "普通";
            decimal?nullable = new decimal?(diffRate * 100M);

            if (!service.IsExist(ContractId))
            {
                return(str);
            }
            ConConfigContract contract = (from p in service
                                          where p.ContractId == ContractId
                                          select p).FirstOrDefault <ConConfigContract>();
            decimal?nullable2         = nullable;
            decimal?highPayAlarmLimit = contract.HighPayAlarmLimit;

            if ((nullable2.GetValueOrDefault() >= highPayAlarmLimit.GetValueOrDefault()) && (nullable2.HasValue & highPayAlarmLimit.HasValue))
            {
                return("高");
            }
            decimal?nullable4             = nullable;
            decimal?midPayAlarmLowerLimit = contract.MidPayAlarmLowerLimit;

            if ((nullable4.GetValueOrDefault() >= midPayAlarmLowerLimit.GetValueOrDefault()) && (nullable4.HasValue & midPayAlarmLowerLimit.HasValue))
            {
                return("中");
            }
            decimal?nullable6             = nullable;
            decimal?lowPayAlarmLowerLimit = contract.LowPayAlarmLowerLimit;

            if ((nullable6.GetValueOrDefault() >= lowPayAlarmLowerLimit.GetValueOrDefault()) && (nullable6.HasValue & lowPayAlarmLowerLimit.HasValue))
            {
                return("低");
            }
            return("普通");
        }
Пример #3
0
        private static void IncometContractAlarm()
        {
            ConConfigContractService service = new ConConfigContractService();
            IncometPaymentBll        bll     = new IncometPaymentBll();

            using (List <IncometPaymentModel> .Enumerator enumerator = bll.GetListByWhere(string.Empty).GetEnumerator())
            {
                IncometPaymentModel item;
                while (enumerator.MoveNext())
                {
                    item = enumerator.Current;
                    if (!pTDbsjBll.Exists(item.ID))
                    {
                        int?incomeAlarmDays = (from p in service
                                               where p.ContractId == item.ContractID
                                               select p).FirstOrDefault <ConConfigContract>().IncomeAlarmDays;
                        PTDbsjModel model = new PTDbsjModel {
                            C_OpenFlag = "0",
                            DTM_DBSJ   = DateTime.Now,
                            I_XGID     = item.ID
                        };
                        StringBuilder builder = new StringBuilder();
                        builder.AppendFormat("收款编号为{0}", item.CllectionCode);
                        builder.Append("的合同需要在");
                        builder.Append(incomeAlarmDays);
                        builder.Append("日内付款");
                        model.V_Content = builder.ToString();
                        model.V_DBLJ    = "StockManage/basicset/ShowView.aspx?i=" + item.ID;
                        model.V_LXBM    = "021";
                        model.V_TPLJ    = "new_Mail.gif";
                        model.V_YHDM    = "00000000";
                        pTDbsjBll.Add(model);
                    }
                }
            }
        }