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["DisciplineID"].ToString(); if (Class.App.ConfirmDeletion() == DialogResult.No) { return; } Class.QuaTrinhLamViec_KyLuat kl = new Class.QuaTrinhLamViec_KyLuat(); kl.DisciplineID = _value; if (kl.Delete()) { Class.App.DeleteSuccessfully(); CT_PROCESS_DISCIPLINE_GetListByEmployee(); } else { Class.App.DeleteNotSuccessfully(); } } }
private void Update_KyLuat() { Class.QuaTrinhLamViec_KyLuat kl = new Class.QuaTrinhLamViec_KyLuat(); kl.DisciplineID = txtDisciplineID.Text; kl.EmployeeCode = Class.App._manv; kl.DisciplineName = txtDisciplineName.Text; kl.DateOccurred = dateDateOccurred.DateTime; kl.Location = txtLocation.Text; kl.Description = txtDescription.Text; kl.Witnesses = txtWitnesses.Text; if (radioViolations.SelectedIndex == 0) { kl.Violations = true; } else { kl.Violations = false; } kl.Notes = txtNotes.Text; kl.Form = txtForm.Text; if (radioSettlement.SelectedIndex == 0) { kl.Settlement = true; } else { kl.Settlement = false; } kl.Reason = txtReason.Text; kl.DecideNumber = txtDecideNumber.Text; kl.Person = txtPerson.Text; kl.Date = dateDate.DateTime; if (txtDisciplineID.Enabled == true) { if (kl.Insert()) { Class.App.SaveSuccessfully(); } else { Class.App.SaveNotSuccessfully(); } } else { if (kl.Update()) { Class.App.SaveSuccessfully(); } else { Class.App.SaveNotSuccessfully(); } } (this.Owner as frmQuaTrinhLamViec_KyLuat).CT_PROCESS_DISCIPLINE_GetListByEmployee(); }
private void call_info(string Form_name, string code) { Class.QuaTrinhLamViec_KyLuat kl = new Class.QuaTrinhLamViec_KyLuat(); kl.DisciplineID = code; DataTable dt = kl.CT_PROCESS_DISCIPLINE_Get(); txtDisciplineID.Text = code; txtDisciplineName.Text = dt.Rows[0]["DisciplineName"].ToString(); dateDateOccurred.DateTime = (DateTime)dt.Rows[0]["DateOccurred"]; txtLocation.Text = dt.Rows[0]["Location"].ToString(); txtDescription.Text = dt.Rows[0]["Description"].ToString(); txtWitnesses.Text = dt.Rows[0]["Witnesses"].ToString(); if ((bool)dt.Rows[0]["Violations"] == true) { radioViolations.SelectedIndex = 0; } else { radioViolations.SelectedIndex = 1; } txtNotes.Text = dt.Rows[0]["Notes"].ToString(); txtForm.Text = dt.Rows[0]["Form"].ToString(); if ((bool)dt.Rows[0]["Settlement"] == true) { radioSettlement.SelectedIndex = 0; } else { radioSettlement.SelectedIndex = 1; } txtReason.Text = dt.Rows[0]["Reason"].ToString(); txtDecideNumber.Text = dt.Rows[0]["DecideNumber"].ToString(); txtPerson.Text = dt.Rows[0]["Person"].ToString(); dateDate.DateTime = (DateTime)dt.Rows[0]["Date"]; }
public void CT_PROCESS_DISCIPLINE_GetListByEmployee() { Class.QuaTrinhLamViec_KyLuat kl = new Class.QuaTrinhLamViec_KyLuat(); gridItem.DataSource = kl.CT_PROCESS_DISCIPLINE_GetListByEmployee(); gridItemDetail.OptionsView.ColumnAutoWidth = false; }