private void AddRow(HRM_PROCESS_ASSIGNMENT item) { GridView gridView = this.gbList; int focusedRowHandle = gridView.FocusedRowHandle; gridView.AddNewRow(); focusedRowHandle = gridView.FocusedRowHandle; gridView.SetRowCellValue(focusedRowHandle, "AssignmentID", item.AssignmentID); gridView.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode); HRM_EMPLOYEE hRMEMPLOYEE = new HRM_EMPLOYEE(); hRMEMPLOYEE.Get(item.EmployeeCode); gridView.SetRowCellValue(focusedRowHandle, "DepartmentName", hRMEMPLOYEE.DepartmentName); gridView.SetRowCellValue(focusedRowHandle, "GroupName", hRMEMPLOYEE.GroupName); gridView.SetRowCellValue(focusedRowHandle, "FirstName", hRMEMPLOYEE.FirstName); gridView.SetRowCellValue(focusedRowHandle, "LastName", hRMEMPLOYEE.LastName); gridView.SetRowCellValue(focusedRowHandle, "AssignmentName", item.AssignmentName); gridView.SetRowCellValue(focusedRowHandle, "Reason", item.Reason); gridView.SetRowCellValue(focusedRowHandle, "Where", item.Where); gridView.SetRowCellValue(focusedRowHandle, "FromDate", item.FromDate); gridView.SetRowCellValue(focusedRowHandle, "ToDate", item.ToDate); gridView.SetRowCellValue(focusedRowHandle, "Money", item.Money); gridView.SetRowCellValue(focusedRowHandle, "Date", item.Date); gridView.SetRowCellValue(focusedRowHandle, "Person", item.Person); gridView.UpdateCurrentRow(); }
protected override void LoadGrid() { base.LoadGrid(); HRM_PROCESS_ASSIGNMENT hRMPROCESSASSIGNMENT = new HRM_PROCESS_ASSIGNMENT(); this.gcList.DataSource = hRMPROCESSASSIGNMENT.GetAllListByDays(this.m_FromDate, this.m_ToDate); }
protected override void Delete() { string str; object rowCellValue; if (MyRule.IsDelete("bbiProcessAssignment")) { bool flag = false; int[] selectedRows = this.gbList.GetSelectedRows(); if (XtraMessageBox.Show("Bạn có muốn xóa không?", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No) { base.SetWaitDialogCaption("Đang xóa..."); HRM_PROCESS_ASSIGNMENT hRMPROCESSASSIGNMENT = new HRM_PROCESS_ASSIGNMENT(); for (int i = (int)selectedRows.Length; i > 0; i--) { flag = true; rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "AssignmentID"); if (rowCellValue != null) { SYS_LOG.Insert("Đi Công Tác", "Xoá", rowCellValue.ToString()); str = hRMPROCESSASSIGNMENT.Delete(new Guid(rowCellValue.ToString())); if (str == "OK") { this.gbList.DeleteRow(selectedRows[i - 1]); } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } } } this.DoHide(); if (!flag) { rowCellValue = this.gbList.GetFocusedRowCellValue("AssignmentID"); if (rowCellValue != null) { SYS_LOG.Insert("Đi Công Tác", "Xoá", rowCellValue.ToString()); base.SetWaitDialogCaption("Đang xóa..."); str = hRMPROCESSASSIGNMENT.Delete(new Guid(rowCellValue.ToString())); if (str == "OK") { this.gbList.DeleteRow(this.gbList.FocusedRowHandle); } else if (str != "OK") { MessageBox.Show(string.Concat("Thông tin không được xóa\r\n", str), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Hand); } this.DoHide(); } } } } }
public void Init(string EmployeeCode, int Month, int Year) { this.barManager1.SetPopupContextMenu(this.gcList, this.ppMenu); HRM_PROCESS_ASSIGNMENT hRMPROCESSASSIGNMENT = new HRM_PROCESS_ASSIGNMENT(); string employeeCode = EmployeeCode; string str = employeeCode; this.m_EmployeeCode = employeeCode; int month = Month; int num = month; this.m_Month = month; int num1 = num; int year = Year; num = year; this.m_Year = year; this.gcList.DataSource = hRMPROCESSASSIGNMENT.GetListByMonth(str, num1, num); }
public void Save() { HRM_PROCESS_ASSIGNMENT hRMPROCESSASSIGNMENT = new HRM_PROCESS_ASSIGNMENT(); hRMPROCESSASSIGNMENT.DeleteByMonth(this.m_EmployeeCode, this.m_Month, this.m_Year); try { foreach (DataRow row in (this.gcList.DataSource as DataTable).Rows) { decimal num = new decimal(0); decimal num1 = new decimal(0); decimal num2 = new decimal(0); try { num = decimal.Parse(row["Money"].ToString()); } catch { num = new decimal(0); } try { num1 = decimal.Parse(row["PayMoney"].ToString()); } catch { num1 = new decimal(0); } num2 = num - num1; Guid guid = Guid.NewGuid(); hRMPROCESSASSIGNMENT.Insert(guid, this.m_EmployeeCode, row["AssignmentName"].ToString(), row["Reason"].ToString(), row["Where"].ToString(), DateTime.Parse(row["FromDate"].ToString()), DateTime.Parse(row["ToDate"].ToString()), num, num1, num2, DateTime.Parse(row["Date"].ToString()), "", "", ""); } this.UpdateEmployeeSalary(); this.RaiseSavedHander(); } catch { } }
protected override void Change() { base.Change(); HRM_PROCESS_ASSIGNMENT hRMPROCESSASSIGNMENT = new HRM_PROCESS_ASSIGNMENT(); object focusedRowCellValue = this.gbList.GetFocusedRowCellValue("AssignmentID"); if (focusedRowCellValue != null) { base.SetWaitDialogCaption("Đang kiểm tra dữ liệu...."); if (!(hRMPROCESSASSIGNMENT.Get(new Guid(focusedRowCellValue.ToString())) != "OK")) { this.DoHide(); //xfmAssignmentAdd _xfmAssignmentAdd = new xfmAssignmentAdd(Actions.Update, hRMPROCESSASSIGNMENT); //_xfmAssignmentAdd.Updated += new xfmAssignmentAdd.UpdatedEventHander(this.frm_Updated); //_xfmAssignmentAdd.Added += new xfmAssignmentAdd.AddedEventHander(this.frm_Added); //_xfmAssignmentAdd.ShowDialog(); } else { this.DoHide(); XtraMessageBox.Show("Dữ liệu không tồn tại", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private void frm_Updated(object sender, HRM_PROCESS_ASSIGNMENT Item) { this.UpdateRow(Item); }
private void frm_Added(object sender, HRM_PROCESS_ASSIGNMENT Item) { this.AddRow(Item); }