示例#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 List <DataTable> DailySalaryVoucherCashOrBankLedgersComboFill()
        {
            DailyAttendanceDetailsSP spDailyAttendanceDetails = new DailyAttendanceDetailsSP();

            try
            {
                return(SpMaster.DailySalaryVoucherCashOrBankLedgersComboFill());
            }
            catch (Exception)
            {
                throw;
            }
        }
        public List <DataTable> DailySalaryVoucherCashOrBankLedgersComboFill()
        {
            List <DataTable> listObj = new List <DataTable>();

            try
            {
                listObj = SpDailySalaryVoucherMaster.DailySalaryVoucherCashOrBankLedgersComboFill();
            }
            catch (Exception ex)
            {
                MessageBox.Show("DSV8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(listObj);
        }
示例#4
0
        public ActionResult GetDailySalaryVoucherForModal(string salaryDate)
        {
            bool   isSuccess    = true;
            string message      = string.Empty;
            string jsonResult   = string.Empty;
            string jsonCombo    = string.Empty;
            string strVoucherNo = string.Empty;
            string strTableName = "DailySalaryVoucherMaster";

            try
            {
                VoucherTypeSP spVoucherType   = new VoucherTypeSP();
                DataTable     dtblVouchetType = new DataTable();
                dtblVouchetType = spVoucherType.VoucherTypeSelectionComboFill("Daily Salary Voucher");
                int    inCount     = dtblVouchetType.Rows.Count;
                string voucherType = string.Empty;
                if (inCount == 1)
                {
                    voucherType = dtblVouchetType.Rows[0].ItemArray[0].ToString();
                    decimal decDailyVoucherTypeId = decimal.Parse(voucherType);

                    TransactionsGeneralFill    TransactionsGeneralFillobj = new TransactionsGeneralFill();
                    DailySalaryVoucherMasterSP spmaster = new DailySalaryVoucherMasterSP();
                    strVoucherNo = spmaster.SalaryVoucherMasterGetMaxPlusOne(decDailyVoucherTypeId).ToString();
                    strVoucherNo = TransactionsGeneralFillobj.VoucherNumberAutomaicGeneration(decDailyVoucherTypeId, Convert.ToDecimal(strVoucherNo), Convert.ToDateTime(salaryDate), strTableName);
                }

                DataTable dtbl = DailySalaryVoucherDetailsGridfill(false, "0", salaryDate);
                jsonResult = 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, message, voucherNo = strVoucherNo, data = jsonResult, jsonCombo }));
        }