Exemplo n.º 1
0
        public ActionResult EditCashItem(CashDetailModel item)
        {
            if (!ModelState.IsValid)
            {
                return(operateContext.RedirectAjax(1, "数据验证失败~", "", ""));
            }
            int cd_id = Helper.ToInt(Request["cd_id"]);

            if (cd_id <= 0)
            {
                return(operateContext.RedirectAjax(1, "编辑缴纳金额主键值为空~", "", ""));
            }
            operateContext.bllSession.BB_CashDetail.EditCashItem(item, cd_id);
            return(operateContext.RedirectAjax(0, "编辑数据成功~", "", ""));
        }
Exemplo n.º 2
0
 /// <summary>
 ///  添加缴纳金额
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public int AddCashItem(CashDetailModel item)
 {
     if (null == item)
     {
         return(0);
     }
     HCQ2_Model.BB_CashDetail model = new HCQ2_Model.BB_CashDetail
     {
         ip_id           = item.ip_id,
         cash_start_date = DateTime.ParseExact(item.cash_start_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
         cash_end_date   = DateTime.ParseExact(item.cash_end_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
         cash_money      = item.cash_money
     };
     return(Add(model));
 }
Exemplo n.º 3
0
 /// <summary>
 ///  编辑缴纳金额
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public int EditCashItem(CashDetailModel item, int cd_id)
 {
     if (null == item)
     {
         return(0);
     }
     HCQ2_Model.BB_CashDetail model = new HCQ2_Model.BB_CashDetail
     {
         ip_id           = item.ip_id,
         cash_start_date = DateTime.ParseExact(item.cash_start_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
         cash_end_date   = DateTime.ParseExact(item.cash_end_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
         cash_money      = item.cash_money
     };
     return(Modify(model, s => s.cd_id == cd_id, "cash_start_date", "cash_end_date", "cash_money"));
 }
Exemplo n.º 4
0
 public ActionResult AddCashItem(CashDetailModel item)
 {
     if (!ModelState.IsValid)
     {
         return(operateContext.RedirectAjax(1, "数据验证失败~", "", ""));
     }
     try
     {
         int mark = operateContext.bllSession.BB_CashDetail.AddCashItem(item);
         if (mark > 0)
         {
             return(operateContext.RedirectAjax(0, "添加用户成功~", "", ""));
         }
         return(operateContext.RedirectAjax(1, "添加用户失败~", "", ""));
     }
     catch (Exception ex)
     {
         return(operateContext.RedirectAjax(1, ex.Message, "", ""));
     }
 }
Exemplo n.º 5
0
        public NetWorthDetailModel GetNetWorthById(Guid userId, Guid netWorthId)
        {
            var netWorthDetailModel = new NetWorthDetailModel();

            try
            {
                var netWorth       = _netWorthRepository.GetNetWorth(userId, netWorthId);
                var cash           = _cashRepository.GetCash(netWorth.Id);
                var investedAssets = _investedAssetsRepository.GetInvestedAssets(netWorth.Id);
                var useAssets      = _useAssetsRepository.GetUseAssets(netWorth.Id);
                var liabilities    = _liabilitiesRepository.GetLiabilities(netWorth.Id);

                var cashDetailModel           = new CashDetailModel();
                var investedAssetsDetailModel = new InvestedAssetsDetailModel();
                var useAssetsDetailModel      = new UseAssetsDetailModel();
                var liabilitiesDetailModel    = new LiabilitiesDetailModel();

                _mapper.Map(cash, cashDetailModel);
                _mapper.Map(investedAssets, investedAssetsDetailModel);
                _mapper.Map(useAssets, useAssetsDetailModel);
                _mapper.Map(liabilities, liabilitiesDetailModel);

                netWorthDetailModel.Total               = netWorth.Total;
                netWorthDetailModel.CashTotal           = cash.GetTotal();
                netWorthDetailModel.Cash                = cashDetailModel;
                netWorthDetailModel.InvestedAssetsTotal = investedAssets.GetTotal();
                netWorthDetailModel.InvestedAssets      = investedAssetsDetailModel;
                netWorthDetailModel.UseAssetsTotal      = useAssets.GetTotal();
                netWorthDetailModel.UseAssets           = useAssetsDetailModel;
                netWorthDetailModel.LiabilitiesTotal    = liabilities.GetTotal();
                netWorthDetailModel.Liabilities         = liabilitiesDetailModel;

                return(netWorthDetailModel);
            }
            catch (Exception e)
            {
                return(null);
            }
        }