private string DoEdit(int _id) { try { BLL.department bll = new BLL.department(); Model.department model = bll.GetModel(_id); manager = GetAdminInfo(); string content = string.Empty; model.de_type = string.IsNullOrEmpty(ddltype.SelectedValue) ? (byte)0 : Utils.ObjToByte(ddltype.SelectedValue); model.de_parentid = int.Parse(ddlParentId.SelectedValue); if (model.de_name != txtTitle.Text.Trim()) { content += "机构名称:" + model.de_name + "→<font color='red'>" + txtTitle.Text.Trim() + "</font><br/>"; } model.de_name = txtTitle.Text.Trim(); if (model.de_isUse != cbIsUse.Checked) { content += "状态:" + Common.BusinessDict.isUseStatus(1)[model.de_isUse] + "→<font color='red'>" + Common.BusinessDict.isUseStatus(1)[cbIsUse.Checked] + "</font>"; } model.de_isUse = cbIsUse.Checked; model.de_sort = Convert.ToInt32(txtSortId.Text.Trim()); return(bll.Update(model, content, manager.user_name, manager.real_name)); } catch (Exception e) { return(e.Message); } }
private bool DoEdit(int _id) { try { BLL.department bll = new BLL.department(); Model.department model = bll.GetModel(_id); model.department_name = txtTitle.Text.Trim(); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = 0; if (cbIsLock.Checked == true) { model.is_lock = 1; } model.remark = txtRemark.Text.Trim(); if (model.is_sys == 0) { int parentId = int.Parse(ddlParentId.SelectedValue); //如果选择的父ID不是自己,则更改 if (parentId != model.id) { model.parent_id = parentId; } } if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "修改部门信息:" + model.department_name); //记录日志 return(true); } } catch { return(false); } return(false); }