private void frmAddEditEmployeeQualification_Load(object sender, EventArgs e) { try { ServiceEmployee _service = new ServiceEmployee(); if (this.EmployeeQualificationID == 0) { txtQualification.Text = txtNameOfInstitute.Text = txtGradeClass.Text = string.Empty; if (this.SelectedEmployeeID != 0) { TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID); this.Text = string.Format("{0} ({1}) - Add Qualification", emp.EmployeeName, emp.EmployeeCode); } } else { ScatterData(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployeeQualification::frmAddEditEmployeeQualification_Load", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ScatterData() { ServiceEmployee _service = new ServiceEmployee(); try { TBL_MP_Master_Employee_Qualification model = _service.GetEmployeeQualificationDBRecordByID(this.EmployeeQualificationID); if (model != null) { txtQualification.Text = model.Qualification; txtNameOfInstitute.Text = model.NameOfInstitute; txtGradeClass.Text = model.Grade; TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(model.FK_EmployeeId); this.Text = string.Format("{0} ({1}) - Update Qualification", emp.EmployeeName, emp.EmployeeCode); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployeeQualification::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmAddEditEmployeeRelation_Load(object sender, EventArgs e) { try { ServiceEmployee _service = new ServiceEmployee(); PopulateRelationshipDropdown(); if (EmployeeRelationshipID == 0) { txtRelativeName.Text = txtRemark.Text = string.Empty; dtDateOfBirth.Checked = false; if (this.SelectedEmployeeID != 0) { TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID); this.Text = string.Format("{0} ({1}) - Add Relationship", emp.EmployeeName, emp.EmployeeCode); } } else { ScatterData(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployeeRelation::frmAddEditEmployeeRelation_Load", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ScatterData() { ServiceEmployee _service = new ServiceEmployee(); try { TBL_MP_Master_Employee_Relative model = _service.GetEmployeeRelativeDBRecordByID(this.EmployeeRelationshipID); if (model != null) { txtRelativeName.Text = model.RelativeName; txtRemark.Text = model.Remarks; if (model.RelativeDOB != null) { dtDateOfBirth.Value = (DateTime)model.RelativeDOB; } else { dtDateOfBirth.Checked = false; } cboSelectRelation.SelectedItem = ((List <SelectListItem>)cboSelectRelation.DataSource).Where(x => x.ID == model.FK_UL_RelationID).FirstOrDefault(); } TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID); this.Text = string.Format("{0} ({1}) - Add Relationship", emp.EmployeeName, emp.EmployeeCode); } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployeeRelation::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void ScatterData() { ServiceEmployee _service = new ServiceEmployee(); try { TBL_MP_Master_Employee_MedicalDetail obj = (new ServiceEmployee()).GetEmployeeMedicalInfoDbRecord(this.EmployeeMedicalID); if (obj != null) { //populate all textboxes,datepickers from obj txtMedicalName.Text = obj.MedicalName; cboRelation.SelectedItem = ((List <SelectListItem>)cboRelation.DataSource).Where(x => x.ID == obj.FK_UL_RelationID).FirstOrDefault(); txtCardNo.Text = obj.CardNo; txtCardType.Text = obj.CardType; txtCompanyName.Text = obj.CompanyName; txtRemark.Text = obj.Remark; chkIsActive.Checked = obj.IsActive; dtIssueDate.Value = obj.IssueDate; dtExpieryDate.Value = obj.ExpiryDate; } TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(obj.fk_EmployeeId); this.Text = string.Format("{0} ({1}) - Update Medical Info", emp.EmployeeName, emp.EmployeeCode); } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditMedicalInfo::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmAddEditMedicalInfo_Load(object sender, EventArgs e) { try { ServiceEmployee _service = new ServiceEmployee(); PopulateRelationshipDropdown(); if (EmployeeMedicalID == 0) { txtMedicalName.Text = txtCardNo.Text = txtCardType.Text = txtCompanyName.Text = txtRemark.Text = String.Empty; dtExpieryDate.Checked = false; chkIsActive.Checked = true; if (this.selectedEmployeeMedicalID != 0) { TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(selectedEmployeeMedicalID); this.Text = string.Format("{0} ({1}) - Add Medical Info", emp.EmployeeName, emp.EmployeeCode); } } else { ScatterData(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditMedicalInfo::frmAddEditMedicalInfo_Load", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ScatterData() { ServiceEmployee _service = new ServiceEmployee(); try { TBL_MP_Master_Employee_LastEmployerDetail model = _service.GetLastEmployerInfoDBRecordByID(this.SelectID); if (model != null) { txtName.Text = model.LastEmployerName; txtAddress.Text = model.Address; txtContactNo.Text = model.ContactNo.ToString(); chkIsActive.Checked = model.isActive; } TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID); this.Text = string.Format("{0} ({1}) - Update X-Employer's Info.", emp.EmployeeName, emp.EmployeeCode); } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditLastEmployerInfo::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmAddEditLastEmployerInfo_Load(object sender, EventArgs e) { try { ServiceEmployee _service = new ServiceEmployee(); if (this.SelectID == 0) { txtName.Text = txtAddress.Text = txtContactNo.Text = string.Empty; chkIsActive.Checked = false; if (this.SelectedEmployeeID != 0) { TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(SelectedEmployeeID); this.Text = string.Format("{0} ({1}) - Add Last Employer Info", emp.EmployeeName, emp.EmployeeCode); } } else { ScatterData(); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditLastEmployerInfo::frmAddEditLastEmployerInfo_Load", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ScatterData() { ServiceEmployee _service = new ServiceEmployee(); try { TBL_MP_Master_Employee model = _service.GetEmployeeDbRecordByID(this.EmployeeID); if (model != null) { txtEmployeeCode.Text = model.EmployeeCode; txtEmployeeName.Text = model.EmployeeName; txtEmail.Text = model.EmailAddress; txtMobileNo.Text = model.PhoneNo1; cboDepartment.SelectedItem = ((List <SelectListItem>)cboDepartment.DataSource).Where(x => x.ID == model.FK_DepartmentId).FirstOrDefault(); cboDesignation.SelectedItem = ((List <SelectListItem>)cboDesignation.DataSource).Where(x => x.ID == model.FK_DesignationId).FirstOrDefault(); cboEmploymentType.SelectedItem = ((List <SelectListItem>)cboEmploymentType.DataSource).Where(x => x.ID == model.FK_EmploymentTypeID).FirstOrDefault(); chkIsActive.Checked = (bool)model.isActive; chkHasResigned.Checked = (bool)model.IsResigned; // txtUserName.Text = model.FK_LoginID; //txtPassword.Text = model.FK_LoginPassword; //txtUserName.Text = model.TBL_User_Master. cboEmployeeBoss.SelectedItem = ((List <SelectListItem>)cboEmployeeBoss.DataSource).Where(x => x.ID == model.FK_BossID).FirstOrDefault(); TBL_MP_Master_Employee emp = _service.GetEmployeeDbRecordByID(EmployeeID); this.Text = string.Format("{0} ({1}) - Add Relationship", emp.EmployeeName, emp.EmployeeCode); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployee::ScatterData", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnSave_Click(object sender, EventArgs e) { TBL_MP_Master_Employee model = null; ServiceEmployee serviceEmployee = new ServiceEmployee(); try { if (!this.ValidateChildren()) { return; } if (this.EmployeeID == 0) { model = new TBL_MP_Master_Employee(); } else { model = serviceEmployee.GetEmployeeDbRecordByID(this.EmployeeID); } #region GATHER DATA INTO MODEL FROM VIEW model.EmployeeCode = txtEmployeeCode.Text; model.EmployeeName = txtEmployeeName.Text; model.EmailAddress = txtEmail.Text; model.PhoneNo1 = txtMobileNo.Text; model.FK_DepartmentId = ((SelectListItem)cboDepartment.SelectedItem).ID; model.FK_DesignationId = ((SelectListItem)cboDesignation.SelectedItem).ID; model.FK_EmploymentTypeID = ((SelectListItem)cboEmploymentType.SelectedItem).ID; model.isActive = chkIsActive.Checked; model.IsResigned = chkHasResigned.Checked; model.FK_BossID = ((SelectListItem)cboEmployeeBoss.SelectedItem).ID; #endregion if (this.EmployeeID == 0) { //CREATE EMPLOYEE model.FK_CompanyID = Program.CURR_USER.CompanyID; model.FK_YearID = Program.CURR_USER.FinYearID; model.FK_BranchID = Program.CURR_USER.BranchID; model.CreatedBy = Program.CURR_USER.EmployeeID; model.CreatedDateTime = AppCommon.GetServerDateTime(); this.EmployeeID = serviceEmployee.AddNewEmployee(model); } else { model.ModifiedBy = Program.CURR_USER.EmployeeID; model.ModifiedDateTime = AppCommon.GetServerDateTime(); serviceEmployee.UpdateEmployee(model); } this.DialogResult = DialogResult.OK; } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "frmAddEditEmployee::btnSave_Click", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void PoulateSalesQuotationMasterInfo() { try { TBL_MP_CRM_SalesQuotation dbModel = (new ServiceSalesQuotation()).GetSalesQuotationMasterDBInfo(this.SelectedQuotationID); if (dbModel != null) { txtSalesQuotationNo.Text = dbModel.Quotation_No; txtSalesQuotationDate.Text = dbModel.Quotation_Date.ToString("dd MMM yyyy"); txtSalesEnquiryNo.Text = dbModel.TBL_MP_CRM_SalesEnquiry.SalesEnquiry_No; txtSalesEnquiryDate.Text = dbModel.TBL_MP_CRM_SalesEnquiry.SalesEnquiry_Date.ToString("dd MMM yyyy"); txtClientName.Text = dbModel.Tbl_MP_Master_Party.PartyName; txtRemarks.Text = dbModel.Remarks; // GETTING SALES QUOTATION STATUS SelectListItem selStatus = (new ServiceSalesQuotation()).GetAllActiveQuotationStatusesList().Where(x => x.ID == dbModel.FK_Userlist_Quotation_Status_ID).FirstOrDefault(); if (selStatus != null) { lblQuotationStatus.Text = String.Format("STATUS : {0}", selStatus.Description); } ServiceEmployee _empService = new ServiceEmployee(); TBL_MP_Master_Employee obj = _empService.GetEmployeeDbRecordByID(dbModel.FK_RepresentativeID); if (obj != null) { txtSalesRepresentativeName.Text = obj.EmployeeName; lblSalesRepresentativeCode.Text = string.Format("Code: {0}", obj.EmployeeCode); } obj = _empService.GetEmployeeDbRecordByID(dbModel.FK_BOQRepresentativeID); if (obj != null) { txtBOQRepresentativeName.Text = obj.EmployeeName; lblBoqRepresentativeCode.Text = string.Format("Code: {0}", obj.EmployeeCode); } headerBottom.Values.Heading = string.Format("Created: {0} dt. {1}", ServiceEmployee.GetEmployeeNameByID(dbModel.FK_PreparedBy), dbModel.CreatedDatetime); if (dbModel.LastModifiedBy != null) { headerBottom.Values.Description = string.Format("Modified: {0} dt. {1}", ServiceEmployee.GetEmployeeNameByID((int)dbModel.LastModifiedBy), dbModel.LastModifiedDate); } else { headerBottom.Values.Description = string.Empty; } lblQuotationApprovalInfo.Text = "Unapproved Quotation"; lblQuotationApprovalInfo.StateCommon.Back.Color1 = (dbModel.FK_ApprovedBy == null) ? Color.Red : Color.Green; WhosWhoModel premission = Program.CONTROL_ACCESS.ListControlAccess.Where(x => x.FormID == DB_FORM_IDs.SALES_QUOTATION).FirstOrDefault(); if (premission != null) { if (premission.CanApprove) { if (dbModel.FK_ApprovedBy == null) { btnApprove.Visible = true; } else { lblQuotationApprovalInfo.Text = string.Format("Approved: {0}", ServiceEmployee.GetEmployeeNameByID((int)dbModel.FK_ApprovedBy)); btnApprove.Visible = false; } } else { btnApprove.Visible = false; } } } ServiceSalesQuotationBOQ _service = new ServiceSalesQuotationBOQ(); SalesQuotationBOQSummary model = _service.GetQuotationBOQSummaryForQuotationID(this.SelectedQuotationID); if (model != null) { PopulateBOQSummary(model); } } catch (Exception ex) { string errMessage = ex.Message; if (ex.InnerException != null) { errMessage += string.Format("\n{0}", ex.InnerException.Message); } MessageBox.Show(errMessage, "ControlSalesQuotaionGeneralDetails::PoulateSalesQuotationMasterInfo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }