/// <summary> /// Function to call this form from frmBonusDeductionRegister for updation /// </summary> /// <param name="decBonusDeductionId"></param> /// <param name="frm"></param> public void CallFromBonusDeductionRegister(decimal decBonusDeductionId, frmBonusDeductionRegister frm) { try { base.Show(); BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction = spBonusDeduction.BonusDeductionViewForUpdate(decBonusDeductionId); dtpDate.Text = infoBonusDeduction.Date.ToString(); cmbEmployeeCode.SelectedValue = infoBonusDeduction.EmployeeId; decEmployeeIdForEdit = infoBonusDeduction.EmployeeId; dtpMonth.Text = infoBonusDeduction.Month.ToString(); dtMonth = infoBonusDeduction.Month; txtBonusAmount.Text = infoBonusDeduction.BonusAmount.ToString(); txtDeductionAmount.Text = infoBonusDeduction.DeductionAmount.ToString(); txtNarration.Text = infoBonusDeduction.Narration; btnSave.Text = "Update"; dtpMonth.Enabled = false; cmbEmployeeCode.Enabled = false; btnDelete.Enabled = true; txtDate.Focus(); decBonusId = decBonusDeductionId; frmBonusDeductionRegisterObj = frm; frm.Enabled = false; } catch (Exception ex) { formMDI.infoError.ErrorString = "BD9:" + ex.Message; } }
/// <summary> /// Function to call this form from frmBonusDeductionRegister to view employee list /// </summary> /// <param name="frmBonusDeduction"></param> /// <param name="decId"></param> public void CallFromBonusDeductionregister(frmBonusDeductionRegister frmBonusDeduction, decimal decId) { try { base.Show(); this.frmBonusDeductionObj = frmBonusDeduction; int inRowCount = dgvEmployee.Rows.Count; for (int ini = 0; ini < inRowCount; ini++) { if (Convert.ToDecimal(dgvEmployee.Rows[ini].Cells["dgvtxtEmployeeId"].Value.ToString()) == decId) { dgvEmployee.Rows[ini].DefaultCellStyle.BackColor = Color.MediumSeaGreen; } } txtEmployeeCode.Focus(); } catch (Exception ex) { formMDI.infoError.ErrorString = "EMPP5:" + ex.Message; } }