Example #1
0
        protected void GetIS()
        {
            var ldata = Import_Shipment_Header.RetrieveData(oCon, txtSearch.Text.Trim());

            grvImpShp.DataSource = ldata;
            grvImpShp.DataBind();
            grvImpShp.GridLines = GridLines.None;
        }
Example #2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var import_Shipment_Header_Model = new Import_Shipment_Header_Model
            {
                Brokerage               = Convert.ToDecimal(txtBrokerage.Text),
                CEDEC                   = Convert.ToDecimal(txtCEDEC.Text),
                CustomsStamps           = Convert.ToDecimal(txtCustomsStamps.Text),
                DeliveryCharges         = Convert.ToDecimal(txtDeliveryCharges.Text),
                DocumentaryStamps       = Convert.ToDecimal(txtDocumentaryStamps.Text),
                DocumentationCharges    = Convert.ToDecimal(txtDocumentationCharges.Text),
                ForkliftCost            = Convert.ToDecimal(txtForkliftCost.Text),
                FreightCharges          = Convert.ToDecimal(txtFreightCharges.Text),
                HandlingFee             = Convert.ToDecimal(txtHandlingFee.Text),
                ImportationInsurance    = Convert.ToDecimal(txtImportationInsurance.Text),
                ImportDuties            = Convert.ToDecimal(txtImportDuties.Text),
                ImportProcessingFee     = Convert.ToDecimal(txtImportProcessingFee.Text),
                Miscellaneous           = Convert.ToDecimal(txtMiscellaneous.Text),
                NotarialFee             = Convert.ToDecimal(txtNotarialFee.Text),
                OtherCharges            = Convert.ToDecimal(txtOtherCharges.Text),
                ProcessingFee           = Convert.ToDecimal(txtProcessingFee.Text),
                WarehouseStorageCharges = Convert.ToDecimal(txtWarehouseStorageCharges.Text),
                Xerox                   = Convert.ToDecimal(txtXerox.Text),
                ImportShipmentNumber    = txtImpShipNum.Text,
                Total_Charges           = Convert.ToDecimal(txtTotalCharges.Text)
            };
            var ismHead = Import_Shipment_Header.Save(oCon, import_Shipment_Header_Model);

            DataTable dt = (DataTable)Session["Data"];

            for (int x = 0; x <= dt.Rows.Count - 1; x++)
            {
                var detail = new Import_Shipment_Detail_Model
                {
                    idImpShpHead = ismHead,
                    idPOHeader   = Convert.ToInt32(dt.Rows[x][0].ToString()),
                    POCharge     = Convert.ToDecimal(dt.Rows[x][2].ToString())
                };
                Import_Shipment_Detail.Save(oCon, detail);
            }

            defaultSettings();
            clearFlds();
            //Session.Remove("Data");
            GetIS();
        }
Example #3
0
        protected void GetSavedItems()
        {
            var ldata = Import_Shipment_Detail.RetrieveData(oCon, Convert.ToInt32(Session["idImpShpHead"].ToString()));

            //Session["Data"] = ldata;
            gvPO.DataSource = ldata;
            gvPO.DataBind();
            gvPO.GridLines = GridLines.None;

            var ldata2 = Import_Shipment_Header.RetrieveData(oCon, Convert.ToInt32(Session["idImpShpHead"].ToString()));

            txtBrokerage.Text               = ldata2[0].Brokerage.ToString();
            txtCEDEC.Text                   = ldata2[0].CEDEC.ToString();
            txtCustomsStamps.Text           = ldata2[0].CustomsStamps.ToString();
            txtDeliveryCharges.Text         = ldata2[0].DeliveryCharges.ToString();
            txtDocumentaryStamps.Text       = ldata2[0].DocumentaryStamps.ToString();
            txtDocumentationCharges.Text    = ldata2[0].DocumentationCharges.ToString();
            txtForkliftCost.Text            = ldata2[0].ForkliftCost.ToString();
            txtFreightCharges.Text          = ldata2[0].FreightCharges.ToString();
            txtHandlingFee.Text             = ldata2[0].HandlingFee.ToString();
            txtImportDuties.Text            = ldata2[0].ImportDuties.ToString();
            txtImportProcessingFee.Text     = ldata2[0].ImportProcessingFee.ToString();
            txtImportationInsurance.Text    = ldata2[0].ImportationInsurance.ToString();
            txtMiscellaneous.Text           = ldata2[0].Miscellaneous.ToString();
            txtNotarialFee.Text             = ldata2[0].NotarialFee.ToString();
            txtOtherCharges.Text            = ldata2[0].OtherCharges.ToString();
            txtProcessingFee.Text           = ldata2[0].ProcessingFee.ToString();
            txtWarehouseStorageCharges.Text = ldata2[0].WarehouseStorageCharges.ToString();
            txtXerox.Text                   = ldata2[0].Xerox.ToString();
            txtImpShipNum.Text              = ldata2[0].ImportShipmentNumber.ToString();
            txtTotalCharges.Text            = ldata2[0].Total_Charges.ToString();

            POPanel.Visible       = false;
            pnlAllDetails.Visible = true;
            btnBack.Visible       = true;
            btnAddNew.Visible     = false;
            btnCompute.Visible    = false;
            tblSearch.Visible     = false;
        }
        protected void btnSearchImpShpNum_Click(object sender, EventArgs e)
        {
            try
            {
                var ldata2  = Import_Shipment_Header.RetrieveData(oCon, txtImpShpNum.Text.Trim());
                var dtCount = Import_Shipment_Detail.RetrieveData(oCon, ldata2[0].idImpShpHead);
                var impdet  = Import_Shipment_Detail.RetrieveData(oCon, ldata2[0].idImpShpHead, Convert.ToInt32(Session["idPOHeader"].ToString()));
                txtTotalCharges.Text = impdet[0].POCharge.ToString();

                var count = dtCount.Rows.Count;

                txtBrokerage.Text               = (ldata2[0].Brokerage / count).ToString("N4");
                txtCEDEC.Text                   = (ldata2[0].CEDEC / count).ToString("N4");
                txtCustomsStamps.Text           = (ldata2[0].CustomsStamps / count).ToString("N4");
                txtDeliveryCharges.Text         = (ldata2[0].DeliveryCharges / count).ToString("N4");
                txtDocumentaryStamps.Text       = (ldata2[0].DocumentaryStamps / count).ToString("N4");
                txtDocumentationCharges.Text    = (ldata2[0].DocumentationCharges / count).ToString("N4");
                txtForkliftCost.Text            = (ldata2[0].ForkliftCost / count).ToString("N4");
                txtFreightCharges.Text          = (ldata2[0].FreightCharges / count).ToString("N4");
                txtHandlingFee.Text             = (ldata2[0].HandlingFee / count).ToString("N4");
                txtImportDuties.Text            = (ldata2[0].ImportDuties / count).ToString("N4");
                txtImportProcessingFee.Text     = (ldata2[0].ImportProcessingFee / count).ToString("N4");
                txtImportationInsurance.Text    = (ldata2[0].ImportationInsurance / count).ToString("N4");
                txtMiscellaneous.Text           = (ldata2[0].Miscellaneous / count).ToString("N4");
                txtNotarialFee.Text             = (ldata2[0].NotarialFee / count).ToString("N4");
                txtOtherCharges.Text            = (ldata2[0].OtherCharges / count).ToString("N4");
                txtProcessingFee.Text           = (ldata2[0].ProcessingFee / count).ToString("N4");
                txtWarehouseStorageCharges.Text = (ldata2[0].WarehouseStorageCharges / count).ToString("N4");
                txtXerox.Text                   = (ldata2[0].Xerox / count).ToString("N4");
                txtImpShpNum.Text               = ldata2[0].ImportShipmentNumber;
            }
            catch
            {
                HttpContext.Current.Response.Write("<script>alert(" + ControlChars.Quote + "PO not linked to Import Shipment Number!" + ControlChars.Quote + ");</script>");
            }
        }