示例#1
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        public void SaveForm(string keyValue, FeechangelogEntity entity)
        {
            try
            {
                if (entity != null)
                {
                    if (entity.new_money < 0)
                    {
                        entity.new_money = 0;
                    }
                }

                service.SaveForm(keyValue, entity);
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        public ActionResult RemovesForm(string keyValue, string FeeincomeEntryJson)
        {
            string property_id = "";

            if (!string.IsNullOrEmpty(Utils.GetCookie("property_id")))
            {
                property_id = Utils.GetCookie("property_id");
            }
            FeechangelogBLL           bll  = new FeechangelogBLL();
            List <FeechangelogEntity> list = new List <FeechangelogEntity>();

            var FeeincomeEntryList = FeeincomeEntryJson.ToList <FeeincomeAdjustEntity>();
            int maxid = bll.GetMaxID(0).ToInt();

            foreach (FeeincomeAdjustEntity item in FeeincomeEntryList)
            {
                FeechangelogEntity mod_log = new FeechangelogEntity();

                mod_log.itemid       = property_id + Utils.SupplementZero(maxid.ToString(), 8);
                mod_log.property_id  = property_id;
                mod_log.room_id      = item.room_id;
                mod_log.contract_id  = item.rentcontract_id;
                mod_log.owner_id     = item.owner_id;
                mod_log.source_money = item.fee_income.ToDouble();
                mod_log.new_money    = -1;
                mod_log.feeitem_id   = item.feeitem_id;
                mod_log.operatetime  = DateTime.Now;
                mod_log.operatername = Code.OperatorProvider.Provider.Current().UserName;
                mod_log.income_date  = (item.fee_year + "-" + item.fee_month + "-01").ToDate();
                mod_log.memo         = item.memo;

                list.Add(mod_log);

                maxid++;
            }

            feeincomebll.RemoveForm(keyValue, list);
            return(Success("删除成功。"));
        }
示例#3
0
        public ActionResult SavesForm(string keyValue, 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>();
            List <FeechangelogEntity> list_fl = new List <FeechangelogEntity>();
            List <FeeincomeCutEntity> list_fc = new List <FeeincomeCutEntity>();
            FeechangelogBLL           bll     = new FeechangelogBLL();
            int maxid = bll.GetMaxID(0).ToInt();

            foreach (FeeincomeAdjustEntity item in FeeincomeEntryList)
            {
                if (item.price < 0)
                {
                    item.price = 0;
                }

                #region 费用应收表

                FeeincomeEntity ent_f = new FeeincomeEntity();
                ent_f.income_id  = item.income_id;
                ent_f.fee_income = item.price;

                list_f.Add(ent_f);

                #endregion

                #region 费用调整日志

                //新增日志
                FeechangelogEntity mod_log = new FeechangelogEntity();
                mod_log.itemid       = property_id + Utils.SupplementZero(maxid.ToString(), 8);
                mod_log.property_id  = property_id;
                mod_log.room_id      = item.room_id;
                mod_log.contract_id  = item.rentcontract_id;
                mod_log.owner_id     = item.owner_id;
                mod_log.source_money = item.fee_income.ToDouble();
                mod_log.new_money    = item.price.ToDouble();
                mod_log.feeitem_id   = item.feeitem_id;
                mod_log.operatetime  = DateTime.Now;
                mod_log.operatername = Code.OperatorProvider.Provider.Current().UserName;
                mod_log.income_date  = (item.fee_year + "-" + item.fee_month + "-01").ToDate();
                mod_log.memo         = item.memo;

                list_fl.Add(mod_log);

                #endregion

                #region 费用减免记录

                FeeincomeCutEntity mod_fc = new FeeincomeCutEntity();
                mod_fc.property_id  = property_id;
                mod_fc.room_id      = item.room_id;
                mod_fc.owner_id     = item.owner_id;
                mod_fc.contract_id  = item.rentcontract_id;
                mod_fc.feeitem_id   = item.feeitem_id;
                mod_fc.fee_year     = item.fee_year;
                mod_fc.fee_month    = item.fee_month;
                mod_fc.fee_cutmoney = (item.fee_income - item.price).ToDouble();
                mod_fc.inputtime    = DateTime.Now;
                mod_fc.inputempid   = Code.OperatorProvider.Provider.Current().UserName;

                list_fc.Add(mod_fc);

                #endregion

                maxid++;
            }

            feeincomebll.SavesForm(list_f, list_fl, list_fc);
            return(Success("操作成功。"));
        }
示例#4
0
        public ActionResult RemoveForm(string keyValue)
        {
            string property_id = "";

            if (!string.IsNullOrEmpty(Utils.GetCookie("property_id")))
            {
                property_id = Utils.GetCookie("property_id");
            }
            FeechangelogBLL           bll  = new FeechangelogBLL();
            List <FeechangelogEntity> list = new List <FeechangelogEntity>();

            if (keyValue.IndexOf(',') == -1)
            {
                #region 单个

                FeeincomeEntity    model   = feeincomebll.GetEntity(keyValue);
                FeechangelogEntity mod_log = new FeechangelogEntity();
                mod_log.itemid       = property_id + bll.GetMaxID(8);
                mod_log.property_id  = property_id;
                mod_log.room_id      = model.room_id;
                mod_log.contract_id  = model.rentcontract_id;
                mod_log.owner_id     = model.owner_id;
                mod_log.source_money = model.fee_income.ToDouble();
                mod_log.new_money    = 0;
                mod_log.feeitem_id   = model.feeitem_id;
                mod_log.operatetime  = DateTime.Now;
                mod_log.operatername = Code.OperatorProvider.Provider.Current().Account;
                mod_log.income_date  = (model.fee_year + "-" + model.fee_month + "-01").ToDate();
                mod_log.memo         = "删除";

                list.Add(mod_log);

                #endregion
            }
            else
            {
                #region 多个

                string[] keyValues = keyValue.Split(',');
                string   str       = "";
                foreach (string item in keyValues)
                {
                    str += "'" + item + "',";
                }
                if (str != "")
                {
                    str = str.Substring(0, str.Length - 1);
                }
                int maxid = bll.GetMaxID(0).ToInt();
                IEnumerable <FeeincomeEntity> ie = feeincomebll.GetLists(str);
                if (ie.Count() > 0)
                {
                    foreach (FeeincomeEntity item in ie)
                    {
                        //新增日志
                        FeechangelogEntity mod_log = new FeechangelogEntity();
                        mod_log.itemid       = property_id + Utils.SupplementZero(maxid.ToString(), 8);
                        mod_log.property_id  = property_id;
                        mod_log.room_id      = item.room_id;
                        mod_log.contract_id  = item.rentcontract_id;
                        mod_log.owner_id     = item.owner_id;
                        mod_log.source_money = item.fee_income.ToDouble();
                        mod_log.new_money    = 0;
                        mod_log.feeitem_id   = item.feeitem_id;
                        mod_log.operatetime  = DateTime.Now;
                        mod_log.operatername = Code.OperatorProvider.Provider.Current().UserName;
                        mod_log.income_date  = (item.fee_year + "-" + item.fee_month + "-01").ToDate();
                        mod_log.memo         = "删除";

                        list.Add(mod_log);

                        maxid++;
                    }
                }

                #endregion
            }

            feeincomebll.RemoveForm(keyValue, list);
            return(Success("删除成功。"));
        }
示例#5
0
 public ActionResult SaveForm(string keyValue, FeechangelogEntity entity)
 {
     feechangelogbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }