public decimal MonthlySalaryAddWithIdentity(MonthlySalaryInfo monthlysalaryinfo)
        {
            decimal decResult = 0;

            try
            {
                decResult = SPMonthlySalary.MonthlySalaryAddWithIdentity(monthlysalaryinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("MS4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(decResult);
        }
Exemple #2
0
 /// <summary>
 /// Function for Save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         MonthlySalarySP          spMonthlySalary          = new MonthlySalarySP();
         MonthlySalaryInfo        infoMonthlySalary        = new MonthlySalaryInfo();
         MonthlySalaryDetailsSP   spMonthlySalaryDetails   = new MonthlySalaryDetailsSP();
         MonthlySalaryDetailsInfo infoMonthlySalaryDetails = new MonthlySalaryDetailsInfo();
         infoMonthlySalary.SalaryMonth            = Convert.ToDateTime(dtpSalaryMonth.Text);
         infoMonthlySalary.Narration              = txtNarration.Text.Trim();
         infoMonthlySalary.Extra1                 = string.Empty;
         infoMonthlySalary.Extra2                 = string.Empty;
         decMasterIdForEdit                       = spMonthlySalary.MonthlySalaryAddWithIdentity(infoMonthlySalary);
         infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
         int RowCount = dgvMonthySalarySettings.RowCount;
         for (int i = 0; i < RowCount; i++)
         {
             if (dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString() != string.Empty)
             {
                 infoMonthlySalaryDetails.EmployeeId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvtxtEmployeeId"].Value.ToString());
                 if (dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value != null && dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString() != "0")
                 {
                     infoMonthlySalaryDetails.SalaryPackageId = Convert.ToDecimal(dgvMonthySalarySettings.Rows[i].Cells["dgvcmbPackage"].Value.ToString());
                     infoMonthlySalaryDetails.Extra1          = string.Empty;
                     infoMonthlySalaryDetails.Extra2          = string.Empty;
                     infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
                     spMonthlySalaryDetails.MonthlySalaryDetailsAddWithMonthlySalaryId(infoMonthlySalaryDetails);
                 }
             }
         }
         Messages.SavedMessage();
         GridFill();
         dtpSalaryMonth.Focus();
         btnDelete.Enabled = true;
         DeleteButtonEnableDisableChoose();
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSS7" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #3
0
        public string SaveMonthlySalarySettings(string month, string tableData)
        {
            try
            {
                List <Dictionary <string, object> > items = JsonConvert.DeserializeObject <List <Dictionary <string, object> > >(tableData);

                MonthlySalarySP          spMonthlySalary          = new MonthlySalarySP();
                MonthlySalaryInfo        infoMonthlySalary        = new MonthlySalaryInfo();
                MonthlySalaryDetailsSP   spMonthlySalaryDetails   = new MonthlySalaryDetailsSP();
                MonthlySalaryDetailsInfo infoMonthlySalaryDetails = new MonthlySalaryDetailsInfo();
                infoMonthlySalary.SalaryMonth = Convert.ToDateTime(month);
                infoMonthlySalary.Narration   = string.Empty;
                infoMonthlySalary.Extra1      = string.Empty;
                infoMonthlySalary.Extra2      = string.Empty;
                decimal decMasterIdForEdit = spMonthlySalary.MonthlySalaryAddWithIdentity(infoMonthlySalary);
                infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
                int RowCount = items.Count;
                for (int i = 0; i < RowCount; i++)
                {
                    if (items[i]["employeeId"] != null)
                    {
                        infoMonthlySalaryDetails.EmployeeId = Convert.ToDecimal(items[i]["employeeId"]);
                        if (items[i]["selectedSalaryPackageId"].ToString() != string.Empty && items[i]["selectedSalaryPackageId"].ToString() != "0")
                        {
                            infoMonthlySalaryDetails.SalaryPackageId = Convert.ToDecimal(items[i]["selectedSalaryPackageId"].ToString());
                            infoMonthlySalaryDetails.Extra1          = string.Empty;
                            infoMonthlySalaryDetails.Extra2          = string.Empty;
                            infoMonthlySalaryDetails.MonthlySalaryId = decMasterIdForEdit;
                            spMonthlySalaryDetails.MonthlySalaryDetailsAddWithMonthlySalaryId(infoMonthlySalaryDetails);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return("MSS7" + ex.Message);
            }
            return("no");
        }