protected void GrDelete(object sender, CommandEventArgs e) { int nPageNumber = int.Parse(txtPageNumber.Text); int nPageSize = int.Parse(txtPageSize.Text); SessionUserLogin nUserLogin = (SessionUserLogin)Session["UserLogin"]; nUserLogin.CheckRole("CA0006"); if (!nUserLogin.Role.Del) { Response.Write("<script >alert('Bạn không có quyền xóa danh mục này!')</script>"); } else { try { int mKey = int.Parse(e.CommandArgument.ToString()); Equipment_Info info = new Equipment_Info(mKey); info.Delete(); DataTable nTable = Equipment_Data.GetList(nPageSize, nPageNumber, txtSearch.Text); GV_Equipment.DataSource = nTable; GV_Equipment.DataBind(); LoadPages(); } catch { Response.Write("<script >alert('Có lỗi gì đó vui lòng thử lại!')</script>"); } } }
protected void LoadInfo(int Key) { Equipment_Info info = new Equipment_Info(Key); txtEquipmentName.Text = info.EquipmentName; txtNotice.Text = info.Notice; }
protected void SaveInfo() { Equipment_Info info = new Equipment_Info(int.Parse(txtKey.Text)); info.EquipmentName = txtEquipmentName.Text; info.Notice = txtNotice.Text; info.Save(); }