コード例 #1
0
        public ActionResult SaveForm(string keyValue, CustomerRatingEntity entity)
        {
            #region 计算企业信用等级
            int sumScore = 0;
            int score    = 0;

            if (int.TryParse(dataItemCache.GetDataItemValue(entity.NatureCode), out score))
            {//企业性质
                sumScore += score;
            }
            if (int.TryParse(dataItemCache.GetDataItemValue(entity.RegisterCapital), out score))
            {//注册资金
                sumScore += score;
            }
            if (int.TryParse(dataItemCache.GetDataItemValue(entity.SalesRevenue), out score))
            {//销售收入
                sumScore += score;
            }
            if (int.TryParse(dataItemCache.GetDataItemValue(entity.ContractPeriod), out score))
            {//合同账期
                sumScore += score;
            }
            if (int.TryParse(dataItemCache.GetDataItemValue(entity.OverdueAdvances), out score))
            {//逾期垫款
                sumScore += score;
            }
            entity.RatingScore = customerbll.GetCalcRatingBefore(sumScore);
            customerbll.UpdateRatingScore(entity.CustomerId, entity.RatingScore);
            #endregion


            customerratingbll.SaveForm(keyValue, entity);
            return(Success("操作成功。"));
        }
コード例 #2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, CustomerRatingEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }