protected void lbtnUpdate_Click(object sender, EventArgs e) { if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strNhomChucNang_Sua"))) { try { int tint, ordersort; string function_Group_ID; foreach (ListViewItem lvit in this.lv_ThongTinSP.Items) { if (((HiddenField)lvit.FindControl("hfFunction_Group_ID")).Value != "") { function_Group_ID = ((HiddenField)lvit.FindControl("hfFunction_Group_ID")).Value; } else { this.ltr_Notice.Text = this.objComm.ShowNotice( false, "Cập nhật thông tin thất bại.\nLỗi trong quá trình nhận dạng nhóm chức năng"); return; } string ods = ((ASPxTextBox)lvit.FindControl("txt_OrderSort")).Text; if (Int32.TryParse(ods, out tint)) { ordersort = tint; } else { this.ltr_Notice.Text = this.objComm.ShowNotice( false, "Cập nhật thông tin thất bại.\nThứ tự nhập vào không phải kiểu số.\nHãy kiểm tra và thử lại!"); return; } TBT_AdminFunctionGroup ctit = MemberGroupDAO.LayNhomChucNangById(Int32.Parse(function_Group_ID)); ctit.FunctionGroupName = ((TextBox)lvit.FindControl("txt_FunctionGroupName")).Text; ctit.FunctionGroupOrder = ordersort; ctit.FunctionGroupDesc = ((TextBox)lvit.FindControl("txt_FunctionGroupDesc")).Text; MemberGroupDAO.Update(); } this.ltr_Notice.Text = this.objComm.ShowNotice(true, "Cập nhật thông tin thành công!"); } catch { if (!this.Page.ClientScript.IsStartupScriptRegistered("popup")) { this.Page.ClientScript.RegisterStartupScript( this.GetType(), "popup", "popup('Cập nhật thất bại! Bạn hãy tải lại trang để thử lại cập nhật.');", true); } } } else { this.objComm.wr( "<script language='javascript'>alert('Bạn không có quyền thực hiện chức năng này.');location.href='/AppAdmin/Article/Index.aspx';</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (this.objCheckPermision.Permission(this.objCheckPermision.LayQuyen("strTinhNangChucNang_Xem"))) { if (!this.Page.IsPostBack) { if (Common.RequestID("manhom") != "") { function_Group_ID = Int32.Parse(Common.RequestID("manhom")); } this.ltr_Title.Text = "Danh sách tính năng của nhóm chức năng: " + MemberGroupDAO.LayNhomChucNangById(function_Group_ID).FunctionGroupName; this.BinList(); } } else { this.iRightAccess.Visible = false; this.objControl.LoadMyControl(this.idNotPermissionAccess, NotPermissControl); } }