示例#1
0
        /// <summary>
        /// 保存或者编辑工资专户
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public bool SavePayAccount(object obj)
        {
            FormCollection param = (FormCollection)obj;
            T_PayAccount   pay   = new T_PayAccount();

            pay.UnitID    = param["UnitID"];
            pay.UnitName  = new B01BLL().GetByUnitID(param["UnitID"]).UnitName;
            pay.ssyh      = param["ssyh"];
            pay.khmc      = param["khmc"];
            pay.zh        = param["zh"];
            pay.khh       = param["khh"];
            pay.pzzl      = param["pzzl"];
            pay.pzhm      = param["pzhm"];
            pay.ye        = decimal.Parse(param["ye"]);
            pay.if_remove = 0;

            string pay_id = param["JianDie"];

            if (string.IsNullOrEmpty(pay_id))
            {
                //新增
                pay.create_date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                pay.create_name = HCQ2UI_Helper.OperateContext.Current.Usr.user_id;
                return(Add(pay) > 0);
            }
            else
            {
                pay.update_date = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                pay.update_name = HCQ2UI_Helper.OperateContext.Current.Usr.user_id;
                int payId = int.Parse(pay_id);
                return(Modify(pay, o => o.pay_id == payId, "UnitID", "UnitName", "ssyh",
                              "khmc", "zh", "khh", "pzzl", "pzhm", "ye") > 0);
            }
        }
示例#2
0
        /// <summary>
        /// 删除工资专户信息
        /// </summary>
        /// <param name="pay_id"></param>
        /// <returns></returns>
        public bool DeletePayAccount(int pay_id)
        {
            T_PayAccount pay = new T_PayAccount();

            pay.if_remove = 1;
            return(Modify(pay, o => o.pay_id == pay_id, "if_remove") > 0);
        }