Example #1
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, FeereceiveEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
Example #2
0
 public ActionResult SaveForm(string keyValue, FeereceiveEntity entity)
 {
     feereceivebll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }
Example #3
0
        public ActionResult FixedCost(string keyValue, string ticket_id, string FeeincomeEntryJson)
        {
            string property_id = "";

            if (!string.IsNullOrEmpty(Utils.GetCookie("property_id")))
            {
                property_id = Utils.GetCookie("property_id");
            }
            var FeeincomeEntryList = FeeincomeEntryJson.ToList <FeeincomeAdjustEntity>();

            List <FeeincomeEntity>  list_f  = new List <FeeincomeEntity>();
            FeeticketEntity         end_ft  = new FeeticketEntity();
            List <FeereceiveEntity> list_fe = new List <FeereceiveEntity>();
            List <FeecheckEntity>   list_fK = new List <FeecheckEntity>();

            #region 费用实收

            int maxid = new FeereceiveBLL().GetMaxID(0).ToInt();

            FeeincomeAdjustEntity entity = FeeincomeEntryList[0];

            FeereceiveEntity ent_fe = new FeereceiveEntity();
            ent_fe.receive_id      = property_id + Utils.SupplementZero(maxid.ToString(), 8);
            ent_fe.property_id     = property_id;
            ent_fe.receive_date    = entity.receive_date;
            ent_fe.ticket_id       = ticket_id;
            ent_fe.owner_id        = entity.owner_id;
            ent_fe.rentcontract_id = entity.rentcontract_id;
            ent_fe.fee_money       = entity.fee_income;
            ent_fe.userid          = Code.OperatorProvider.Provider.Current().UserName;
            ent_fe.inputtime       = DateTime.Now;
            ent_fe.room_id         = entity.room_id;
            if (entity.isprint == "1")
            {
                ent_fe.isprint   = entity.isprint;
                ent_fe.printname = entity.printname;
            }

            list_fe.Add(ent_fe);

            #endregion

            int maxid_f = new FeecheckBLL().GetMaxID(0).ToInt();
            for (int i = 0; i < FeeincomeEntryList.Count; i++)
            {
                FeeincomeAdjustEntity item = FeeincomeEntryList[i];

                #region 费用应收

                FeeincomeEntity mod_f = new FeeincomeEntity();
                mod_f.fee_already = item.fee_already;
                mod_f.fee_date    = item.receive_date;
                mod_f.userid      = Code.OperatorProvider.Provider.Current().UserName;
                mod_f.inputtime   = DateTime.Now;
                mod_f.income_id   = item.income_id;

                list_f.Add(mod_f);

                #endregion

                #region 收费核销

                FeecheckEntity ent_fk = new FeecheckEntity();
                ent_fk.check_id    = property_id + Utils.SupplementZero(maxid_f.ToString(), 8);
                ent_fk.receive_id  = ent_fe.receive_id;
                ent_fk.income_id   = item.income_id;
                ent_fk.check_money = item.fee_income;

                list_fK.Add(ent_fk);

                maxid_f++;

                #endregion

                // 归总金额
                if (i > 0)
                {
                    ent_fe.fee_money += item.fee_income;
                }
            }

            #region 发票领用

            end_ft.ticket_id     = ticket_id;
            end_ft.ticket_status = 1;

            #endregion

            feeincomebll.FixedCost(list_f, end_ft, list_fe, list_fK);

            return(Success("操作成功。"));
        }
Example #4
0
        public string Post(PostBody model)
        {
            string keyValue           = model.keyValue;
            string ticket_id          = model.ticket_id;
            string FeeincomeEntryJson = model.FeeincomeEntryJson;

            string property_id = "";

            if (!string.IsNullOrEmpty(Utils.GetCookie("property_id")))
            {
                property_id = Utils.GetCookie("property_id");
            }
            var FeeincomeEntryList = FeeincomeEntryJson.ToList <FeeincomeAdjustEntity>();

            List <FeeincomeEntity>  list_f  = new List <FeeincomeEntity>();
            FeeticketEntity         end_ft  = new FeeticketEntity();
            List <FeereceiveEntity> list_fe = new List <FeereceiveEntity>();
            List <FeecheckEntity>   list_fK = new List <FeecheckEntity>();
            FeereceiveBLL           bll     = new FeereceiveBLL();
            int maxid = bll.GetMaxID(0).ToInt();

            FeecheckBLL bll_f   = new FeecheckBLL();
            int         maxid_f = bll_f.GetMaxID(0).ToInt();

            foreach (FeeincomeAdjustEntity item in FeeincomeEntryList)
            {
                #region 费用应收

                FeeincomeEntity mod_f = new FeeincomeEntity();
                mod_f.fee_already = item.fee_already + item.fee_income;
                mod_f.fee_date    = item.receive_date;
                mod_f.userid      = "李俊";
                mod_f.inputtime   = DateTime.Now;
                mod_f.income_id   = item.income_id;

                list_f.Add(mod_f);

                #endregion

                #region 费用实收

                FeereceiveEntity ent_fe = new FeereceiveEntity();
                ent_fe.receive_id      = property_id + Utils.SupplementZero(maxid.ToString(), 8);
                ent_fe.property_id     = property_id;
                ent_fe.receive_date    = item.receive_date;
                ent_fe.ticket_id       = ticket_id;
                ent_fe.owner_id        = item.owner_id;
                ent_fe.rentcontract_id = item.rentcontract_id;
                ent_fe.fee_money       = item.fee_income;
                ent_fe.userid          = "李俊";
                ent_fe.inputtime       = DateTime.Now;
                ent_fe.room_id         = item.room_id;
                if (item.isprint == "1")
                {
                    ent_fe.isprint   = item.isprint;
                    ent_fe.printname = item.printname;
                }

                list_fe.Add(ent_fe);

                #endregion

                #region 收费核销

                FeecheckEntity ent_fk = new FeecheckEntity();
                ent_fk.check_id    = property_id + Utils.SupplementZero(maxid_f.ToString(), 8);
                ent_fk.receive_id  = ent_fe.receive_id;
                ent_fk.income_id   = item.income_id;
                ent_fk.check_money = item.fee_income;

                list_fK.Add(ent_fk);

                #endregion

                maxid++;
                maxid_f++;
            }

            #region 发票领用

            end_ft.ticket_id     = ticket_id;
            end_ft.ticket_status = 1;

            #endregion

            FeeincomeBLL feeincomebll = new FeeincomeBLL();
            feeincomebll.FixedCost(list_f, end_ft, list_fe, list_fK);

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