Exemplo n.º 1
0
        private bool DoEdit(int _id)
        {
            try
            {
                BLL.village   bll   = new BLL.village();
                Model.village model = bll.GetModel(_id);

                int parentId = int.Parse(ddlParentId.SelectedValue);
                model.name = txtName.Text.Trim();
                //如果选择的父ID不是自己,则更改
                if (parentId != model.id)
                {
                    model.parent_id = parentId;
                }
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                if (bll.Update(model))
                {
                    AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改层级分类:" + model.name); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
Exemplo n.º 2
0
        private void ShowInfo(int _id)
        {
            BLL.village   bll   = new BLL.village();
            Model.village model = bll.GetModel(_id);

            ddlParentId.SelectedValue = model.parent_id.ToString();
            txtName.Text   = model.name;
            txtSortId.Text = model.sort_id.ToString();
        }