/// <summary> /// Function to save /// </summary> public void SaveFunction() { try { BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction.Date = Convert.ToDateTime(dtpDate.Text.ToString()); infoBonusDeduction.EmployeeId = Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString()); infoBonusDeduction.Month = Convert.ToDateTime(dtpMonth.Text.ToString()); infoBonusDeduction.BonusAmount = Convert.ToDecimal(txtBonusAmount.Text.ToString()); infoBonusDeduction.DeductionAmount = Convert.ToDecimal(txtDeductionAmount.Text.ToString()); infoBonusDeduction.Narration = txtNarration.Text; infoBonusDeduction.Extra1 = string.Empty; infoBonusDeduction.Extra2 = string.Empty; if (spBonusDeduction.BonusDeductionAddIfNotExist(infoBonusDeduction)) { Messages.SavedMessage(); Clear(); } else { Messages.InformationMessage(" Employee bonus deduction already exist"); cmbEmployeeCode.Focus(); } } catch (Exception ex) { MessageBox.Show("BD2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// On 'Print' button click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPrint_Click(object sender, EventArgs e) { try { if (dgvBonusDeductionReport.RowCount > 0) { DataSet ds = new DataSet(); CompanySP spCompany = new CompanySP(); DataTable dtblCompany = spCompany.CompanyViewDataTable(1); ds.Tables.Add(dtblCompany); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); DataTable dtblBonusDeduction = spBonusDeduction.BonusDeductionReportGridFill(dtpFromDate.Text, dtpToDate.Text, dtpSalaryMonth.Text, cmbDesignation.Text, cmbEmployee.Text, strBonusOrDeduction); ds.Tables.Add(dtblBonusDeduction); frmReport frmReportObj = new frmReport(); frmReportObj.MdiParent = formMDI.MDIObj; frmReportObj.BonusDeductionReportPrinting(ds); } else { Messages.InformationMessage("No data found"); } } catch (Exception ex) { MessageBox.Show("BDR:8" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to delete /// </summary> public void Deletefunction() { try { BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); if ((spBonusDeduction.BonusDeductionReferenceDelete(decEmployeeIdForEdit, dtMonth)) == -1) { MessageBox.Show("Can't delete,reference exist", "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { Messages.DeletedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; this.Close(); if (frmBonusDeductionRegisterObj != null) { frmBonusDeductionRegisterObj.Show(); } } } catch (Exception ex) { MessageBox.Show("BD7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <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) { MessageBox.Show("BD9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public ActionResult BonusDeductionEdit_Load(string bonusDeductionId) { string jsonComboData = string.Empty; decimal decBonusDeductionId = Convert.ToDecimal(bonusDeductionId); BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); try { BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction = spBonusDeduction.BonusDeductionViewForUpdate(decBonusDeductionId); DataTable employeeCodeCombo = EmployeeCodeComboFill(); jsonComboData = Utils.ConvertDataTabletoString(employeeCodeCombo); } catch (Exception ex) { return(Json(new { success = "true", ex = "BD2" + ex.Message })); } return(Json(new { success = "true", ex = "no", data = new { date = infoBonusDeduction.Date.ToString("yyyy-MM-dd"), employeeCodes = jsonComboData, employeeId = infoBonusDeduction.EmployeeId, month = infoBonusDeduction.Month.ToString("yyyy-MM"), bonusAmount = infoBonusDeduction.BonusAmount, deductionAmount = infoBonusDeduction.DeductionAmount, narration = infoBonusDeduction.Narration } })); }
/// <summary> /// Function to edit /// </summary> public void EditFunction() { try { BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction.Date = Convert.ToDateTime(dtpDate.Text.ToString()); infoBonusDeduction.EmployeeId = Convert.ToDecimal(cmbEmployeeCode.SelectedValue.ToString()); infoBonusDeduction.Month = Convert.ToDateTime(dtpMonth.Text.ToString()); infoBonusDeduction.BonusAmount = Convert.ToDecimal(txtBonusAmount.Text.ToString()); infoBonusDeduction.DeductionAmount = Convert.ToDecimal(txtDeductionAmount.Text.ToString()); infoBonusDeduction.Narration = txtNarration.Text; infoBonusDeduction.Extra1 = string.Empty; infoBonusDeduction.Extra2 = string.Empty; infoBonusDeduction.BonusDeductionId = decBonusId; spBonusDeduction.BonusDedutionEdit(infoBonusDeduction); Messages.UpdatedMessage(); btnSave.Text = "Save"; btnDelete.Enabled = false; dtpDate.Focus(); if (frmBonusDeductionRegisterObj != null) { frmBonusDeductionRegisterObj.Show(); this.Close(); } } catch (Exception ex) { MessageBox.Show("BD3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to edit /// </summary> public string EditFunction(string employeeId, string date, string month, string bonusAmount, string deductionAmount, string narration, string bonusId) { string message = string.Empty; try { BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction.Date = Convert.ToDateTime(date); infoBonusDeduction.EmployeeId = Convert.ToDecimal(employeeId); infoBonusDeduction.Month = Convert.ToDateTime(month); infoBonusDeduction.BonusAmount = Convert.ToDecimal(bonusAmount); infoBonusDeduction.DeductionAmount = Convert.ToDecimal(deductionAmount); infoBonusDeduction.Narration = narration; infoBonusDeduction.Extra1 = string.Empty; infoBonusDeduction.Extra2 = string.Empty; infoBonusDeduction.BonusDeductionId = Convert.ToDecimal(bonusId); spBonusDeduction.BonusDedutionEdit(infoBonusDeduction); } catch (Exception ex) { } return(message); }
public string SaveFunction(string employeeId, string date, string month, string bonusAmount, string deductionAmount, string narration) { string message = string.Empty; try { BonusDedutionInfo infoBonusDeduction = new BonusDedutionInfo(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); infoBonusDeduction.Date = Convert.ToDateTime(date); infoBonusDeduction.EmployeeId = Convert.ToDecimal(employeeId); infoBonusDeduction.Month = Convert.ToDateTime(month); infoBonusDeduction.BonusAmount = Convert.ToDecimal(bonusAmount); infoBonusDeduction.DeductionAmount = Convert.ToDecimal(deductionAmount); infoBonusDeduction.Narration = narration; infoBonusDeduction.Extra1 = string.Empty; infoBonusDeduction.Extra2 = string.Empty; if (!spBonusDeduction.BonusDeductionAddIfNotExist(infoBonusDeduction)) { message = "Employee bonus deduction already exist"; } } catch (Exception ex) { } return(message); }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { DataTable dtblBonusDeduction = new DataTable(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); dtblBonusDeduction = spBonusDeduction.BonusDeductionSearch(cmbEmployeeName.Text, Convert.ToDateTime(dtpMonth.Text.ToString())); dgvBonusDeduction.DataSource = dtblBonusDeduction; } catch (Exception ex) { MessageBox.Show("BDR3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to fill Datagridview /// </summary> public void GridFill() { try { DataTable dtblBonusDeduction = new DataTable(); BonusDedutionSP spBonus = new BonusDedutionSP(); dtblBonusDeduction = spBonus.BonusDeductionSearchForPopUp(txtEmployeeCode.Text, txtEmployeeName.Text); dgvEmployee.DataSource = dtblBonusDeduction; } catch (Exception ex) { MessageBox.Show("EMPP13:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
public ActionResult DeleteBonusDeduction(string employeeId, string month) { string message = string.Empty; try { BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); if ((spBonusDeduction.BonusDeductionReferenceDelete(Convert.ToDecimal(employeeId), Convert.ToDateTime(month))) == -1) { message = "Can't delete,reference exist"; } } catch (Exception ex) { return(Json(new { success = "true", ex = "BD3:" + ex.Message })); } return(Json(new { success = "true", ex = "no", message })); }
public ActionResult GetBonusDeductionRegister(string employeeName, string month) { string jsonComboData = string.Empty; string jsonTableData = string.Empty; try { DataTable dtblBonusDeduction = new DataTable(); BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); dtblBonusDeduction = spBonusDeduction.BonusDeductionSearch(employeeName, Convert.ToDateTime(month)); jsonTableData = Utils.ConvertDataTabletoString(dtblBonusDeduction); DataTable employeeNameCombo = EmployeeNameComboFill(); jsonComboData = Utils.ConvertDataTabletoString(employeeNameCombo); } catch (Exception ex) { return(Json(new { success = "true", ex = "BDR1:" + ex.Message })); } return(Json(new { success = "true", ex = "no", tableData = jsonTableData, comboData = jsonComboData })); }
/// <summary> /// Function to fill Datagridview /// </summary> private void GridFill() { try { if (rbtnBonus.Checked) { strBonusOrDeduction = rbtnBonus.Text; } else if (rbtnDeduction.Checked) { strBonusOrDeduction = rbtnDeduction.Text; } BonusDedutionSP spBonusDeduction = new BonusDedutionSP(); dgvBonusDeductionReport.DataSource = spBonusDeduction.BonusDeductionReportGridFill(txtDate.Text, txtTodate.Text, dtpSalaryMonth.Text, cmbDesignation.Text, cmbEmployee.Text, strBonusOrDeduction); dgvBonusDeductionReport.Columns["employeeId"].Visible = false; } catch (Exception ex) { MessageBox.Show("BDR:3" + ex.Message, "Open Miracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }