Beispiel #1
0
 /// <summary>
 /// Function to reset form
 /// </summary>
 public void Clear()
 {
     try
     {
         txtVoucherDateFrom.Text    = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
         txtVoucherDateTo.Text      = PublicVariables._dtCurrentDate.ToString("dd-MMM-yyyy");
         dtpVoucherDateFrom.Value   = PublicVariables._dtCurrentDate;
         dtpVoucherDateFrom.MinDate = PublicVariables._dtFromDate;
         dtpVoucherDateFrom.MaxDate = PublicVariables._dtToDate;
         dtpVoucherDateTo.Value     = PublicVariables._dtCurrentDate;
         dtpVoucherDateTo.MinDate   = PublicVariables._dtFromDate;
         dtpVoucherDateTo.MaxDate   = PublicVariables._dtToDate;
         dtpSalaryMonth.Value       = PublicVariables._dtCurrentDate;
         dtpSalaryMonth.MinDate     = PublicVariables._dtFromDate;
         dtpSalaryMonth.MaxDate     = PublicVariables._dtToDate;
         txtVoucherNo.Clear();
         cmbVoucherTypeName.SelectedIndex = -1;
         VoucherTypeNameComboFill();
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         obj.CashOrBankComboFill(cmbCashBankAC, false);
         cmbCashBankAC.SelectedIndex = -1;
         GridFill();
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSR3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Function to call frmLedgerPopup form to select and view ledgers
 /// </summary>
 /// <param name="frmLedgerPopup"></param>
 /// <param name="decId"></param>
 public void CallFromLedgerPopup(frmLedgerPopup frmLedgerPopup, decimal decId) //PopUp
 {
     try
     {
         base.Show();
         this.frmLedgerPopupObj = frmLedgerPopup;
         TransactionsGeneralFill obj = new TransactionsGeneralFill();
         obj.CashOrBankComboFill(cmbCashBankAC, false);
         cmbCashBankAC.SelectedValue = decId;
         cmbCashBankAC.Focus();
         frmLedgerPopupObj.Close();
         frmLedgerPopupObj = null;
     }
     catch (Exception ex)
     {
         MessageBox.Show("MSR4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #3
0
        public ActionResult CheckBankOrCash()
        {
            bool isBankAccount = false;

            try
            {
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                DataTable cashOrBank        = obj.CashOrBankComboFill(false);
                DataTable employee          = EmployeeComboFill();

                if (cashOrBank.Rows.Count > 0)
                {
                    decimal cashOrBankId   = (decimal)cashOrBank.Rows[0][1];
                    string  cashOrBankName = (string)cashOrBank.Rows[0][0];
                    isBankAccount = CheckWhetherBankOrCash(cashOrBankId, cashOrBankName);
                }
            }
            catch (Exception ex)
            {
                return(Json(new { success = "true", ex = "AP2:" + ex.Message }));
            }
            return(Json(new { success = "true", ex = "no", isBankAccount }));
        }
Beispiel #4
0
        public ActionResult GetAdvancePaymentDetails()
        {
            string jsonCashOrBank = string.Empty;
            string jsonEmployee   = string.Empty;
            string jsonDate       = string.Empty;

            try
            {
                CallFromVoucherTypeSelection();
                VoucherNoGeneration(DateTime.UtcNow);
                jsonDate = DateTime.UtcNow.ToString("yyyy-MM-dd");
                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                DataTable cashOrBank        = obj.CashOrBankComboFill(false);
                DataTable employee          = EmployeeComboFill();
                jsonCashOrBank = Utils.ConvertDataTabletoString(cashOrBank);
                jsonEmployee   = Utils.ConvertDataTabletoString(employee);
            }
            catch (Exception ex)
            {
                return(Json(new { success = "true", ex = "AP1:" + ex.Message }));
            }
            return(Json(new { success = "true", ex = "no", voucherNo = strVoucherNo, employee = jsonEmployee, cashOrBank = jsonCashOrBank, date = jsonDate }));
        }
Beispiel #5
0
        public ActionResult GetAdvancePaymentEditDetails(string advancePaymentEditId)
        {
            try
            {
                decAdvancePaymentEditId = Convert.ToDecimal(advancePaymentEditId);
                AdvancePaymentSP   spadvance     = new AdvancePaymentSP();
                AdvancePaymentInfo infoadvance   = new AdvancePaymentInfo();
                VoucherTypeSP      spvouchertype = new VoucherTypeSP();
                infoadvance  = spadvance.AdvancePaymentView(decAdvancePaymentEditId);
                strVoucherNo = infoadvance.VoucherNo;
                string txtAdvanceVoucherNo = infoadvance.InvoiceNo;
                strInvoiceNo = infoadvance.InvoiceNo;
                string employeeId    = infoadvance.EmployeeId.ToString();
                string salaryMonth   = infoadvance.SalaryMonth.ToString("yyyy-MM");
                string txtDate       = infoadvance.Date.ToString("yyyy-MM-dd");
                string txtChequeDate = infoadvance.Date.ToString("yyyy-MM-dd");
                string ledgerId      = infoadvance.LedgerId.ToString();
                string txtCheckNo    = infoadvance.Chequenumber;
                string txtAmount     = infoadvance.Amount.ToString();
                string txtNarration  = infoadvance.Narration;
                bool   isBankAccount = false;
                decAdvancePaymentsId = decAdvancePaymentId;

                TransactionsGeneralFill obj = new TransactionsGeneralFill();
                DataTable cashOrBank        = obj.CashOrBankComboFill(false);
                DataTable employee          = EmployeeComboFill();
                string    jsonCashOrBank    = Utils.ConvertDataTabletoString(cashOrBank);
                string    jsonEmployee      = Utils.ConvertDataTabletoString(employee);

                if (cashOrBank.Rows.Count > 0)
                {
                    decimal cashOrBankId   = (decimal)cashOrBank.Rows[0][1];
                    string  cashOrBankName = (string)cashOrBank.Rows[0][0];
                    isBankAccount = CheckWhetherBankOrCash(cashOrBankId, cashOrBankName);
                }

                decPaymentVoucherTypeId  = infoadvance.VoucherTypeId;
                decPaymentSuffixPrefixId = infoadvance.SuffixPrefixId;
                isAutomatic = spvouchertype.CheckMethodOfVoucherNumbering(decPaymentVoucherTypeId);

                return(Json(new
                {
                    success = "true",
                    ex = "no",
                    data = new
                    {
                        voucherNo = strVoucherNo,
                        employee = jsonEmployee,
                        employeeId,
                        salaryMonth,
                        chequeNo = txtCheckNo,
                        date = txtDate,
                        amount = txtAmount,
                        cashOrBank = jsonCashOrBank,
                        ledgerId,
                        chequeDate = txtChequeDate,
                        narration = txtNarration,
                        isAutomatic,
                        isBankAccount
                    }
                }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = "true", ex = "AP3:" + ex.Message }));
            }
        }