Beispiel #1
0
        public static long SaveCreditNoteFooter(ICreditNoteCharge creditNoteCharge)
        {
            string strExecution       = "usp_CN_SaveCrediNoteFooter";
            long   creditNoteChargeId = 0;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                if (creditNoteCharge.CRNChargeID != 0)
                {
                    oDq.AddBigIntegerParam("@CRNChargeID", creditNoteCharge.CRNChargeID);
                }

                oDq.AddBigIntegerParam("@CRNID", creditNoteCharge.CRNID);

                if (creditNoteCharge.TerminalID != 0)
                {
                    oDq.AddBigIntegerParam("@TerminalID", creditNoteCharge.TerminalID);
                }

                oDq.AddDecimalParam("@CRNAmount", 12, 2, creditNoteCharge.CRNAmount);
                oDq.AddDecimalParam("@CRBUSD", 12, 2, creditNoteCharge.CRBUSD);
                oDq.AddDecimalParam("@GrossCRNAmount", 12, 2, creditNoteCharge.GrossCRNAmount);
                oDq.AddDecimalParam("@ServiceTaxAmount", 12, 2, creditNoteCharge.ServiceTaxAmount);
                oDq.AddDecimalParam("@ServiceTaxCessAmount", 12, 2, creditNoteCharge.ServiceTaxCessAmount);
                oDq.AddDecimalParam("@ServiceTaxACess", 12, 2, creditNoteCharge.ServiceTaxACess);
                oDq.AddBigIntegerParam("@ChargeId", creditNoteCharge.ChargeId);

                creditNoteChargeId = Convert.ToInt64(oDq.GetScalar());
            }

            return(creditNoteChargeId);
        }
Beispiel #2
0
        private void RemoveCreditNoteCharge(long cnChargeId)
        {
            List <ICreditNoteCharge> cnCharges = null;

            if (ViewState["CN_CHARGE"] != null)
            {
                cnCharges = ViewState["CN_CHARGE"] as List <ICreditNoteCharge>;
            }

            ICreditNoteCharge cnCharge = cnCharges.Single(c => c.CRNChargeID == cnChargeId);

            cnCharges.Remove(cnCharge);

            ViewState["CN_CHARGE"] = cnCharges;
            RefreshGridView();
        }
Beispiel #3
0
        private void BuildCreditNoteCharge(ICreditNoteCharge cnCharge)
        {
            if (ViewState["EDIT_CN_CHARGEID"] == null)
            {
                if (ViewState["CN_CHARGEID"] == null)
                {
                    cnCharge.CRNChargeID = -1;
                }
                else
                {
                    cnCharge.CRNChargeID = Convert.ToInt32(ViewState["CN_CHARGEID"]) - 1;
                }

                ViewState["CN_CHARGEID"] = cnCharge.CRNChargeID;
            }
            else
            {
                List <ICreditNoteCharge> cnCharges = null;

                if (ViewState["CN_CHARGE"] != null)
                {
                    cnCharges = ViewState["CN_CHARGE"] as List <ICreditNoteCharge>;
                }

                cnCharge.CRNChargeID = Convert.ToInt64(ViewState["EDIT_CN_CHARGEID"]);

                ICreditNoteCharge cnChargeTemp = cnCharges.Single(c => c.CRNChargeID == Convert.ToInt64(ViewState["EDIT_CN_CHARGEID"]));
                cnCharges.Remove(cnChargeTemp);

                ViewState["CN_CHARGE"]        = cnCharges;
                ViewState["EDIT_CN_CHARGEID"] = null;
            }

            cnCharge.ChargeId         = Convert.ToInt64(ddlFChargeName.SelectedValue);
            cnCharge.ChargeName       = ddlFChargeName.SelectedItem.Text;
            cnCharge.ChargeAmount     = Convert.ToDecimal(txtChargeInvoice.Text);
            cnCharge.ChargeServiceTax = Convert.ToDecimal(txtChargeServiceTax.Text);
            //cnCharge.CRNChargeID = Convert.ToInt64(ddlFChargeName.SelectedValue);
            cnCharge.GrossCRNAmount       = Convert.ToDecimal(txtCNAmount.Text);
            cnCharge.TotalServiceTax      = Convert.ToDecimal(txtCNServiceTax.Text);
            cnCharge.ServiceTaxACess      = Convert.ToDecimal(ViewState["ADDCESS"]);
            cnCharge.ServiceTaxAmount     = Convert.ToDecimal(ViewState["STAX"]);
            cnCharge.ServiceTaxCessAmount = Convert.ToDecimal(ViewState["CESSAMOUNT"]);
            cnCharge.STaxPer = Convert.ToDecimal(txtStaxper.Text);

            cnCharge.CRNAmount = (cnCharge.GrossCRNAmount + cnCharge.TotalServiceTax);
        }
Beispiel #4
0
        public static ICreditNoteCharge GeChargeDetails(int ChargeId, string InvoiceNo)
        {
            string            strExecution     = "usp_CN_GetChargeDetail";
            ICreditNoteCharge creditNoteCharge = null;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@ChargeId", ChargeId);
                oDq.AddVarcharParam("@InvoiceNo", 30, InvoiceNo);

                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    creditNoteCharge = new CreditNoteChargeEntity(reader);
                }

                reader.Close();
            }

            return(creditNoteCharge);
        }
Beispiel #5
0
        private void EditCreditNoteCharge(long cnChargeId)
        {
            List <ICreditNoteCharge> cnCharges = null;

            if (ViewState["CN_CHARGE"] != null)
            {
                cnCharges = ViewState["CN_CHARGE"] as List <ICreditNoteCharge>;
            }

            ICreditNoteCharge cnCharge = cnCharges.Single(c => c.CRNChargeID == cnChargeId);

            ddlFChargeName.SelectedValue = cnCharge.ChargeId.ToString();
            txtChargeInvoice.Text        = Convert.ToString(cnCharge.ChargeAmount);
            txtChargeServiceTax.Text     = Convert.ToString(cnCharge.ChargeServiceTax);
            txtCNAmount.Text             = Convert.ToString(cnCharge.GrossCRNAmount);
            txtCNServiceTax.Text         = Convert.ToString(cnCharge.TotalServiceTax);

            ViewState["ADDCESS"]    = cnCharge.ServiceTaxACess;
            ViewState["STAX"]       = cnCharge.ServiceTaxAmount;
            ViewState["CESSAMOUNT"] = cnCharge.ServiceTaxCessAmount;

            ViewState["EDIT_CN_CHARGEID"] = cnCharge.CRNChargeID;
        }