Exemple #1
0
 /// <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 view details for update based on parameter
        /// </summary>
        /// <param name="decBonusDeductionId"></param>
        /// <returns></returns>
        public BonusDedutionInfo BonusDeductionViewForUpdate(decimal decBonusDeductionId)
        {
            BonusDedutionInfo bonusdedutioninfo = new BonusDedutionInfo();

            try
            {
                bonusdedutioninfo = SPBonusDedution.BonusDeductionViewForUpdate(decBonusDeductionId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("BDBll9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(bonusdedutioninfo);
        }