Пример #1
0
        private void ShowInfo(int _id)
        {
            BLL.payMethod   bll   = new BLL.payMethod();
            Model.payMethod model = bll.GetModel(_id);

            txtTitle.Text    = model.pm_name;
            txtSortId.Text   = model.pm_sort.ToString();
            cbIsUse.Checked  = model.pm_isUse.Value;
            cbIsType.Checked = model.pm_type.Value;
        }
Пример #2
0
        private string DoEdit(int _id)
        {
            BLL.payMethod   bll   = new BLL.payMethod();
            Model.payMethod model = bll.GetModel(_id);
            if (string.IsNullOrEmpty(txtTitle.Text.Trim()))
            {
                return("请填写收付款方式");
            }
            if (bll.Exists(txtTitle.Text.Trim(), _id))
            {
                return("该收付款方式已存在");
            }
            string _content = string.Empty;

            if (model.pm_name != txtTitle.Text.Trim())
            {
                _content += "收付款方式:" + model.pm_name + "→<font color='red'>" + txtTitle.Text.Trim() + "</font><br/>";
            }
            model.pm_name = txtTitle.Text.Trim();
            if (model.pm_isUse != cbIsUse.Checked)
            {
                _content += "启用状态:" + (model.pm_isUse.Value ? "启用" : "禁用") + "→<font color='red'>" + (cbIsUse.Checked ? "启用" : "禁用") + "</font><br/>";
            }
            model.pm_isUse = cbIsUse.Checked;
            if (model.pm_type != cbIsType.Checked)
            {
                _content += "仅限财务使用:" + (model.pm_type.Value ? "是" : "否") + "→<font color='red'>" + (cbIsType.Checked ? "是" : "否") + "</font><br/>";
            }
            model.pm_type = cbIsType.Checked;
            model.pm_sort = Utils.StrToInt(txtSortId.Text.Trim(), 0);
            if (bll.Update(model))
            {
                //CacheHelper.Remove(DTKeys.CACHE_SITE_HTTP_DOMAIN); //更新一下域名缓存
                //Undo
                if (!string.IsNullOrEmpty(_content))
                {
                    logmodel                = new Model.business_log();
                    logmodel.ol_relateID    = _id;
                    logmodel.ol_title       = "修改收付款方式";
                    logmodel.ol_content     = _content;
                    logmodel.ol_operateDate = DateTime.Now;
                    AddBusinessLog(DTEnums.ActionEnum.Edit.ToString(), logmodel); //记录日志
                }
                return("");
            }

            return("修改失败");
        }