protected void btn_edit_Click(object sender, EventArgs e) { RolesBSO rolesBSO = new RolesBSO(); IRoles roles = ReceiveHtml(); try { if (CheckedList().Equals("")) { error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Loi : Xin hay lua chon it nhat 1 quyen </div>"; } else { rolesBSO.UpdateRoles(roles); error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật thành công !</div>"; initControl(roles.RolesID); } } catch (Exception ex) { error.Text = ex.Message.ToString(); } }
protected void btn_add_Click(object sender, EventArgs e) { RolesBSO rolesBSO = new RolesBSO(); IRoles roles = ReceiveHtml(); try { if (CheckedList().Equals("")) { error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Loi : Xin hay lua chon it nhat 1 quyen </div>"; } else { if (hddRoles_ID.Value != "") { if (rolesBSO.UpdateRoles(roles) > 0) { error.Text = error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Cập nhật Thành công !</div>"; } else { error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Lưu thông tin không thành công</div>"; } } else { int id = rolesBSO.CreateRoles(roles); error.Text = error.Text = "<div class='alert alert-sm alert-danger bg-gradient'>Thêm mới Thành công !</div>"; initControl(id); } } } catch (Exception ex) { error.Text = ex.Message.ToString(); } }
protected void btn_edit_Click(object sender, EventArgs e) { RolesBSO rolesBSO = new RolesBSO(); IRoles roles = ReceiveHtml(); try { if (CheckedList().Equals("")) { error.Text = "Loi : Xin hay lua chon it nhat 1 quyen"; } else { rolesBSO.UpdateRoles(roles); error.Text = String.Format(Resources.StringAdmin.UpdateSuccessful, "Roles", roles.RolesName); } } catch (Exception ex) { error.Text = ex.Message.ToString(); } }