예제 #1
0
        public JsonResult GetDailySalaryVoucher(string dailySalaryMasterId)
        {
            bool   isSuccess   = true;
            string message     = "success";
            string jsonResults = "";
            string jsonCombo   = "";
            DailySalaryVoucherMasterInfo info = new DailySalaryVoucherMasterInfo();
            bool isAutomatic = false;

            try
            {
                DailySalaryVoucherMasterSP SpMaster = new DailySalaryVoucherMasterSP();
                VoucherTypeSP spVoucherType         = new VoucherTypeSP();
                DataTable     dtbl = new DataTable();
                DailySalaryVoucherDetailsSP spDetails = new DailySalaryVoucherDetailsSP();
                int nDailySalaryMasterId = int.Parse(dailySalaryMasterId);
                info = SpMaster.DailySalaryVoucherViewFromRegister(nDailySalaryMasterId);
                info.DailySalaryVoucehrMasterId = nDailySalaryMasterId;
                isAutomatic = spVoucherType.CheckMethodOfVoucherNumbering(info.VoucherTypeId);
                bool isEditMode = nDailySalaryMasterId > 0 ? true : false;
                dtbl        = spDetails.DailySalaryVoucherDetailsGridViewAll(info.SalaryDate.ToString(), isEditMode, info.VoucherNo);
                jsonResults = Utils.ConvertDataTabletoString(dtbl);

                DailySalaryVoucherMasterSP spMaster = new DailySalaryVoucherMasterSP();
                DataTable newDtbl = new DataTable();
                newDtbl   = spMaster.DailySalaryVoucherCashOrBankLedgersComboFill();
                jsonCombo = Utils.ConvertDataTabletoString(newDtbl);
            }
            catch (Exception ex)
            {
                isSuccess = false;
                message   = ex.Message;
            }

            return(Json(new  {
                isSuccess = isSuccess,
                message = message,
                data = new
                {
                    dailySalaryMasterId = info.DailySalaryVoucehrMasterId,
                    voucherNo = info.VoucherNo,
                    invoiceNo = info.InvoiceNo,
                    date = info.Date.ToString("yyyy-MM-dd"),
                    salaryDate = info.SalaryDate.ToString("yyyy-MM-dd"),
                    totalAmount = info.TotalAmount,
                    narration = info.Narration,
                    suffixPrefixId = info.SuffixPrefixId,
                    voucherTypeId = info.VoucherTypeId,
                    ledgerId = info.LedgerId,
                    jsonDetails = jsonResults,
                    jsonCombo = jsonCombo
                }
            }));
        }
 public DailySalaryVoucherMasterInfo DailySalaryVoucherViewFromRegister(decimal decDailySalaryVoucehrMasterId)
 {
     try
     {
         return(SpMaster.DailySalaryVoucherViewFromRegister(decDailySalaryVoucehrMasterId));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public DailySalaryVoucherMasterInfo DailySalaryVoucherViewFromRegister(decimal decDailySalaryVoucehrMasterId)
        {
            DailySalaryVoucherMasterInfo infoDailySalaryVoucherMaster = new DailySalaryVoucherMasterInfo();

            try
            {
                infoDailySalaryVoucherMaster = SpDailySalaryVoucherMaster.DailySalaryVoucherViewFromRegister(decDailySalaryVoucehrMasterId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("DSV9:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(infoDailySalaryVoucherMaster);
        }