public void SuaKV(CKhuVuc kv) { Provider dao = new Provider(); try { dao.Connect(); string sql = "CUSTOMER_GROUP_Update"; CommandType type = CommandType.StoredProcedure; dao.ExeCuteNonQuery(type, sql, new SqlParameter { ParameterName = "@Customer_Group_ID", Value = kv.MaKV }, new SqlParameter { ParameterName = "@Customer_Group_Name", Value = kv.TenKV }, new SqlParameter { ParameterName = "@Description", Value = kv.GhiChu }, new SqlParameter { ParameterName = "@Active", Value = kv.ConQL }); } catch (SqlException ex) { throw ex; } finally { dao.DisConnect(); } }
public fThemSimple(bool isAdd = true, CKhuVuc kv = null, fKhuVuc.sendMessage send = null) { InitializeComponent(); if (isAdd == false && kv == null) { XtraMessageBox.Show("ERROR : Dữ liệu không được cung cấp để thực hiện hành động !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } if (isAdd == true) { table = BUS_KhuVuc.KhuVuc(); Text = "Thêm khu vực"; } else { editKV = kv; Text = "Sửa thông tin khu vực"; } add = isAdd; sendKV = send; flag = 0; InitKV(); }
public static void SuaKV(CKhuVuc kv) { try { KhuVuc dao = new KhuVuc(); dao.SuaKV(kv); } catch (SqlException ex) { throw ex; } }
private void btnSua_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int rowIndex = gvMain.FocusedRowHandle; CKhuVuc kv = new CKhuVuc { MaKV = gvMain.GetRowCellValue(rowIndex, "CUSTOMER_GROUP_ID").ToString(), TenKV = gvMain.GetRowCellValue(rowIndex, "CUSTOMER_GROUP_Name").ToString(), GhiChu = gvMain.GetRowCellValue(rowIndex, "Description").ToString(), ConQL = bool.Parse(gvMain.GetRowCellValue(rowIndex, "Active").ToString()) }; fThemSimple sua = new fThemSimple(false, kv, LoadData); sua.ShowDialog(); }
private void ThemKV() { CKhuVuc kv = new CKhuVuc(txtMa.Text, txtTen.Text, txtGhiChu.Text, ceConQL.Checked); BUS_KhuVuc.ThemKV(kv); sendKV?.Invoke(); Action.Module = "Khu Vực"; Action.ActionName = "Thêm"; Action.Reference = txtMa.Text; Action.LuuThongTin(); this.Close(); }