protected void btnSave_Click(object sender, EventArgs e)
        {
            ICreditNote creditNote = new CreditNoteEntity();

            BuildCreditNoteEntity(creditNote);

            List <ICreditNoteCharge> cnCharges = ViewState["CN_CHARGE"] as List <ICreditNoteCharge>;

            creditNote.CreditNoteCharges = cnCharges;

            long creditNoteId = new CreditNoteBLL().SaveCreditNote(creditNote);

            ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('Record saved successfully!');</script>", false);

            if (txtExpImp.Text == "IMPORT")
            {
                Response.Redirect("~/Transaction/BL-Query.aspx?BlNo=" + GeneralFunctions.EncryptQueryString(txtBLRef.Text));
            }
            else
            {
                Response.Redirect("~/Export/Export-bl-query.aspx?BLNumber=" + GeneralFunctions.EncryptQueryString(txtBLRef.Text));
            }

            //Response.Redirect("~/Transaction/BL-Query.aspx?BlNo=" + GeneralFunctions.EncryptQueryString(txtBLRef.Text));
        }
        protected void ddlChargeName_SelectedIndexChanged(object sender, EventArgs e)
        {
            ICreditNoteCharge cnCharge = new CreditNoteBLL().GetChargeDetails(Convert.ToInt32(ddlFChargeName.SelectedValue), txtInvoiceRef.Text);

            if (cnCharge != null)
            {
                txtChargeInvoice.Text    = cnCharge.GrossCRNAmount.ToString();
                txtChargeServiceTax.Text = cnCharge.ServiceTaxAmount.ToString();
            }
        }
Exemple #3
0
        private void LoadChargesDDL()
        {
            DataTable dt = new CreditNoteBLL().GetAllfwdCharges(txtInvoiceRef.Text);

            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.NewRow();
                dr["fk_ChargeID"] = "0";
                dr["ChargeDescr"] = "--Select--";
                dt.Rows.InsertAt(dr, 0);
                ddlFChargeName.DataValueField = "fk_ChargeID";
                ddlFChargeName.DataTextField  = "ChargeDescr";
                ddlFChargeName.DataSource     = dt;
                ddlFChargeName.DataBind();
            }
        }
        private void LoadCreditNote(int LineId, int LocationId, int InvoiceId)
        {
            ICreditNote creditNote = new CreditNoteBLL().GetHeaderInformation(LineId, LocationId, InvoiceId);

            if (creditNote != null)
            {
                txtLocation.Text            = creditNote.LocationName;
                txtLine.Text                = creditNote.NVOCCName;
                txtInvoiceType.Text         = creditNote.InvoiceTypeName;
                txtInvoiceRef.Text          = creditNote.InvoiceNumber;
                txtContainers.Text          = creditNote.Containers;
                txtInvoiceDate.Text         = creditNote.InvoiceDate.ToShortDateString();
                txtBLRef.Text               = creditNote.BLNumber;
                txtCNDate.Text              = DateTime.Now.ToShortDateString();
                txtExpImp.Text              = creditNote.ExportImport;
                ViewState["INVOICETYPE_ID"] = creditNote.InvoiceTypeID;
            }
        }
Exemple #5
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            ICreditNote creditNote = new CreditNoteEntity();

            BuildCreditNoteEntity(creditNote);

            List <ICreditNoteCharge> cnCharges = ViewState["CN_CHARGE"] as List <ICreditNoteCharge>;

            creditNote.CreditNoteCharges = cnCharges;

            long creditNoteId = new CreditNoteBLL().SavefwdCreditNote(creditNote);

            ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('Record saved successfully!');</script>", false);

            string encryptedId = GeneralFunctions.EncryptQueryString(Convert.ToInt32(ViewState["jobId"]).ToString());

            Response.Redirect("~/Forwarding/Transaction/Dashboard.aspx?JobId=" + encryptedId);

            //Response.Redirect("~/Forwarding/Transaction/Dashboard?BlNo=" + GeneralFunctions.EncryptQueryString(txtBLRef.Text));


            //Response.Redirect("~/Transaction/BL-Query.aspx?BlNo=" + GeneralFunctions.EncryptQueryString(txtBLRef.Text));
        }
Exemple #6
0
        private void LoadForView(long CreditNoteId)
        {
            ICreditNote creditNote             = new CreditNoteBLL().GetCreditNoteForView(CreditNoteId);
            List <ICreditNoteCharge> cnCharges = creditNote.CreditNoteCharges;

            if (creditNote != null)
            {
                txtLocation.Text     = creditNote.LocationName;
                txtLine.Text         = creditNote.NVOCCName;
                txtInvoiceType.Text  = creditNote.InvoiceTypeName;
                txtInvoiceRef.Text   = creditNote.InvoiceNumber;
                txtContainers.Text   = creditNote.Containers;
                txtInvoiceDate.Text  = creditNote.InvoiceDate.ToShortDateString();
                txtBLRef.Text        = creditNote.BLNumber;
                txtCreditNoteNo.Text = creditNote.CrnNo;
                txtCNDate.Text       = creditNote.CrnDate.ToShortDateString();
            }

            LoadChargesDDL();
            ViewState["CN_CHARGE"] = cnCharges;

            gvwCreditNote.DataSource = cnCharges;
            gvwCreditNote.DataBind();
        }