private void btnDel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { int SelectedRow = gridItemDetail.FocusedRowHandle; if (SelectedRow >= 0) { DataRow drow = gridItemDetail.GetDataRow(SelectedRow); string _value = drow["GroupCode"].ToString(); if (Class.App.ConfirmDeletion("Bạn chắc muốn xóa thông tin Nhóm này không ? \n Lưu ý: Mọi thông tin Nhân Viên thuộc nhóm này sẽ bị xóa hết !") == DialogResult.No) { return; } Class.DanhMuc_Nhom dm = new Class.DanhMuc_Nhom(); dm.GroupCode = _value; if (dm.Delete()) { Class.App.DeleteSuccessfully(); GetAllList_GROUP(); } else { Class.App.DeleteNotSuccessfully(); } } }
private string call_Code_New() { txtGroupCode.Text = ""; txtGroupName.Text = ""; txtFactQuantity.Text = "0"; txtQuantity.Text = "0"; txtDescription.Text = ""; this.Text = "Thêm Tổ, Nhóm"; Class.DanhMuc_Nhom dm = new Class.DanhMuc_Nhom(); return(dm.GetNewCode()); }
private void call_info(string Form_name, string code) { Class.DanhMuc_Nhom ds = new Class.DanhMuc_Nhom(); DataTable dt = ds.GetGroupByCode(code); txtGroupCode.Text = dt.Rows[0]["GroupCode"].ToString(); txtGroupName.Text = dt.Rows[0]["GroupName"].ToString(); txtBranchName.EditValue = dt.Rows[0]["BranchCode"].ToString(); txtDepartment.EditValue = dt.Rows[0]["DepartmentCode"].ToString(); txtQuantity.Text = dt.Rows[0]["Quantity"].ToString(); txtFactQuantity.Text = dt.Rows[0]["FactQuantity"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); }
private void btnUpdateNew_Click(object sender, EventArgs e) { if (txtGroupCode.Text.Length < 1 || txtBranchName.EditValue == null || txtGroupName.Text.Length < 1 || txtDepartment.EditValue == null) { Class.App.InputNotAccess(); return; } Class.DanhMuc_Nhom ds = new Class.DanhMuc_Nhom(); ds.GroupCode = txtGroupCode.Text; ds.GroupName = txtGroupName.Text; ds.DepartmentCode = txtDepartment.EditValue.ToString(); ds.Quantity = int.Parse(txtQuantity.Text); ds.FactQuantity = int.Parse(txtFactQuantity.Text); ds.Description = txtDescription.Text; if (txtGroupCode.Enabled == true) { if (ds.Insert()) { Class.App.SaveSuccessfully(); } else { Class.App.SaveNotSuccessfully(); } } else { if (ds.Update()) { Class.App.SaveSuccessfully(); } else { Class.App.SaveNotSuccessfully(); } } if (_reCallFunction == "frmDanhSachNhom") { (this.Owner as frmDanhSachNhom).GetAllList_GROUP(); } if (_reCallFunction == "frmDanhSachNhanVien") { (this.Owner as frmDanhSachNhanVien).loaddsCocautochuc(); } txtGroupCode.Enabled = true; txtGroupCode.Text = call_Code_New(); }
public void GetAllList_GROUP() { Class.DanhMuc_Nhom ds = new Class.DanhMuc_Nhom(); gridItem.DataSource = ds.GetAllList_GROUP(); gridItemDetail.ExpandAllGroups(); }