Example #1
0
        protected void btnSearchWarehouseBrowser_Click(object sender, EventArgs e)
        {
            Business.SearchOption searchOption = rblWarehouseFilter.SelectedValue.ToSearchOptionEnum();
            String warehouse   = txtWarehouse.Text;
            String description = txtWarehouseDescription.Text;

            ViewState["Warehouses"] = Warehouse.Retrieve(warehouse, description, searchOption);
            DisplayWarehousesInGridView();
        }
Example #2
0
        private void DisplaySelectionCodesInBrowserGridView()
        {
            SelectionCode sc = new SelectionCode();

            sc.selectionCode = txtSelectionCode2.Text;
            sc.Description   = txtSelectionCodeDescription.Text;
            Business.SearchOption searchOption = rblSelectionCodeFilter.SelectedValue.ToSearchOptionEnum();

            gvSelectionCodes.DataSource = sc.Retrieve(searchOption);
            gvSelectionCodes.DataBind();
        }
Example #3
0
        private void DisplayDealingTypesInBrowserGridView()
        {
            DealingType dt = new DealingType();

            dt.AccountCategoryCode = txtDealingType2.Text;
            dt.Description         = txtDealingTypeDescription.Text;
            Business.SearchOption searchOption = rblDealingTypeFilter.SelectedValue.ToSearchOptionEnum();

            gvDealingTypes.DataSource = dt.Retrieve(searchOption);
            gvDealingTypes.DataBind();
        }
Example #4
0
        private void DisplaySalesOrdersInBrowserGridView()
        {
            SalesOrder so = new SalesOrder();

            so.YourRef     = txtYourRef2.Text;
            so.Description = txtSODescription.Text;
            Business.SearchOption searchOption = rblSalesOrderFilter.SelectedValue.ToSearchOptionEnum();

            gvBrowseSalesOrders.DataSource = so.Retrieve(searchOption);
            gvBrowseSalesOrders.DataBind();
        }
Example #5
0
        private void DisplayDeliveryToCustomersInGridView()
        {
            Customer customer = new Customer();

            customer.Alias        = txtDeliveryToCustomerCode.Text;
            customer.CustomerName = txtDeliveryToCustomerName.Text;

            Business.SearchOption searchOption = rblDeliveryToCustomerFilter.SelectedValue.ToSearchOptionEnum();

            gvDeliveryToCustomers.DataSource = customer.Retrieve(searchOption);
            gvDeliveryToCustomers.DataBind();
        }
Example #6
0
        private void DisplayDeliveryNoteNosInGridView()
        {
            Business.SearchOption searchOption = rblDeliveryNoteNoFilter.SelectedValue.ToSearchOptionEnum();
            DeliveryNoteReference dnr          = new DeliveryNoteReference();

            if (!string.IsNullOrEmpty(txtDeliveryNoteNo.Text.Trim()))
            {
                dnr.DeliveryNoteNo = txtDeliveryNoteNo.Text;
            }
            if (!string.IsNullOrEmpty(txtDescription.Text.Trim()))
            {
                dnr.Description = txtDescription.Text;
            }

            gvDeliveryNoteNos.DataSource = dnr.Retrieve(searchOption);
            gvDeliveryNoteNos.DataBind();
        }
Example #7
0
        protected void lbtnExportToExcel_Click(object sender, EventArgs e)
        {
            string FromFulfilmentDate = txtFulfilmentDate.Text.Trim();
            string ToFulfilmentDate   = txtFulfilmentDate2.Text.Trim();
            string FromOrderDate      = txtOrderDate.Text.Trim();
            string ToOrderDate        = txtOrderDate2.Text.Trim();
            string FromReceivedDate   = txtReceived_Date.Text.Trim();
            string ToReceivedDate     = txtReceived_Date2.Text.Trim();

            if (FromFulfilmentDate != string.Empty || ToFulfilmentDate != string.Empty)
            {
                if (FromFulfilmentDate == string.Empty && ToFulfilmentDate != string.Empty)
                {
                    FromFulfilmentDate = ToFulfilmentDate;
                }

                if (ToFulfilmentDate == string.Empty && FromFulfilmentDate != string.Empty)
                {
                    ToFulfilmentDate = FromFulfilmentDate;
                }
            }

            if (FromOrderDate != string.Empty || ToOrderDate != string.Empty)
            {
                if (FromOrderDate == string.Empty && ToOrderDate != string.Empty)
                {
                    FromOrderDate = ToOrderDate;
                }

                if (ToOrderDate == string.Empty && FromOrderDate != string.Empty)
                {
                    ToOrderDate = FromOrderDate;
                }
            }

            if (FromReceivedDate != string.Empty || ToReceivedDate != string.Empty)
            {
                if (FromReceivedDate == string.Empty && ToReceivedDate != string.Empty)
                {
                    FromReceivedDate = ToReceivedDate;
                }

                if (ToReceivedDate == string.Empty && FromReceivedDate != string.Empty)
                {
                    ToReceivedDate = FromReceivedDate;
                }
            }

            string Warehouse       = txtWhseCode.Text;
            string DeliveryNoteNo  = txtDeliveryNote.Text;
            string DeliveryOrderNo = txtDeliveryOrderNo.Text;
            string ManifestNo      = txtManifestNo.Text;
            string OrderNo         = txtOrderNumber.Text;
            string Debtor          = txtOrderBy.Text;
            string InvoiceToCode   = txtInvoiceTo.Text;
            string DeliveryToCode  = txtDeliveryTo.Text;
            string YourRef         = txtYourRef.Text;
            string Description     = txtDescription.Text;
            string SelectionCode   = txtSelectionCode.Text;
            string DealingType     = txtDealingType.Text;

            Business.SearchOption searchOption = rblFilter.SelectedValue.ToSearchOptionEnum();

            Int32 option;

            switch (searchOption)
            {
            case Business.SearchOption.StartsWith: option = 2; break;

            case Business.SearchOption.Contains: option = 3; break;

            case Business.SearchOption.EndsWith: option = 4; break;

            default: option = 1; break;
            }

            string nullString = null;

            this.ltlMessage.Text         = string.Empty;
            ReportViewer1.Visible        = true;
            ReportViewer1.ProcessingMode = ProcessingMode.Remote;
            IReportServerCredentials irsc = new ReportServerNetworkCredentials();

            ReportViewer1.ServerReport.ReportServerCredentials = irsc;
            ReportViewer1.ServerReport.ReportServerUrl         = new Uri((string)ViewState["ReportServerUrl"]);
            ReportViewer1.ServerReport.ReportPath = "/Delivery/DNTransmittals";
            ReportViewer1.ShowParameterPrompts    = true;


            ReportParameter[] myParam =
            {
                new ReportParameter("Debtor", Debtor == string.Empty ? nullString : Debtor)
                ,                             new ReportParameter("OrderNo",            OrderNo == string.Empty ? nullString : OrderNo)
                ,                             new ReportParameter("YourRef",            YourRef == string.Empty ? nullString : YourRef)
                ,                             new ReportParameter("DeliveryNoteNo",     DeliveryNoteNo == string.Empty ? nullString : DeliveryNoteNo)
                ,                             new ReportParameter("FromFulfilmentDate", FromFulfilmentDate == string.Empty ? nullString : FromFulfilmentDate) // string.Format("{0:MM/dd/yyyy}", DateTime.ParseExact(FromFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("ToFulfilmentDate",   ToFulfilmentDate == string.Empty ? nullString : ToFulfilmentDate)     // string.Format("{0:MM/dd/yyyy}", DateTime.ParseExact(ToFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("FromOrderDate",      FromOrderDate == string.Empty ? nullString : FromOrderDate)           // string.Format("{0:MM/dd/yyyy}", DateTime.ParseExact(FromOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("ToOrderDate",        ToOrderDate == string.Empty ? nullString : ToOrderDate)               // string.Format("{0:MM/dd/yyyy}", DateTime.ParseExact(ToOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("Description",        Description == string.Empty ? nullString : Description)
                ,                             new ReportParameter("InvoiceToCode",      InvoiceToCode == string.Empty ? nullString : InvoiceToCode)
                ,                             new ReportParameter("DeliveryToCode",     DeliveryToCode == string.Empty ? nullString : DeliveryToCode)
                ,                             new ReportParameter("WhseCode",           Warehouse == string.Empty ? nullString : Warehouse)
                ,                             new ReportParameter("DeliveryOrderNo",    DeliveryOrderNo == string.Empty ? nullString : DeliveryOrderNo)
                ,                             new ReportParameter("ManifestNo",         ManifestNo == string.Empty ? nullString : ManifestNo)
                ,                             new ReportParameter("DealingType",        DealingType == string.Empty ? nullString : DealingType)
                ,                             new ReportParameter("SelectionCode",      SelectionCode == string.Empty ? nullString : SelectionCode)
                ,                             new ReportParameter("FromReceivedDate",   FromReceivedDate == string.Empty ? nullString :  string.Format("{0:MM/dd/yyyy}",DateTime.ParseExact(FromReceivedDate, "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("ToReceivedDate",     ToReceivedDate == string.Empty ? nullString :  string.Format("{0:MM/dd/yyyy}", DateTime.ParseExact(ToReceivedDate,   "dd/MM/yyyy", CultureInfo.InvariantCulture)))
                ,                             new ReportParameter("SearchOption",       option.ToString())
            };

            ReportViewer1.ServerReport.SetParameters(myParam);
            ReportViewer1.ServerReport.Refresh();

            string mimeType;
            string encoding;
            string extension;

            string[]  streams;
            Warning[] warnings;
            byte[]    bytes = ReportViewer1.ServerReport.Render("Excel", string.Empty, out mimeType, out encoding, out extension, out streams, out warnings);

            Response.Clear();
            Response.ContentType = "application/excel";
            Response.AddHeader("Content-disposition", "filename=DNTransmittalsReceived.xls");
            Response.OutputStream.Write(bytes, 0, bytes.Length);
            Response.OutputStream.Flush();
            Response.OutputStream.Close();
            Response.Flush();
            Response.Close();
        }
Example #8
0
        private void SearchDeliveryNotes()
        {
            DeliveryNoteTransmittal dnt = new DeliveryNoteTransmittal();

            string FromFulfilmentDate = txtFulfilmentDate.Text.Trim();
            string ToFulfilmentDate   = txtFulfilmentDate2.Text.Trim();

            if (FromFulfilmentDate != string.Empty || ToFulfilmentDate != string.Empty)
            {
                if (FromFulfilmentDate == string.Empty && ToFulfilmentDate != string.Empty)
                {
                    FromFulfilmentDate = ToFulfilmentDate;
                }

                if (ToFulfilmentDate == string.Empty && FromFulfilmentDate != string.Empty)
                {
                    ToFulfilmentDate = FromFulfilmentDate;
                }

                dnt.FulfilmentDate  = DateTime.ParseExact(FromFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                dnt.FulfilmentDate2 = DateTime.ParseExact(ToFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }

            string FromOrderDate = txtOrderDate.Text.Trim();
            string ToOrderDate   = txtOrderDate2.Text.Trim();

            if (FromOrderDate != string.Empty || ToOrderDate != string.Empty)
            {
                if (FromOrderDate == string.Empty && ToOrderDate != string.Empty)
                {
                    FromOrderDate = ToOrderDate;
                }

                if (ToOrderDate == string.Empty && FromOrderDate != string.Empty)
                {
                    ToOrderDate = FromOrderDate;
                }

                dnt.OrderDate  = DateTime.ParseExact(FromOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                dnt.OrderDate2 = DateTime.ParseExact(ToOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }

            string FromReceivedDate = txtReceived_Date.Text.Trim();
            string ToReceivedDate   = txtReceived_Date2.Text.Trim();

            if (FromReceivedDate != string.Empty || ToReceivedDate != string.Empty)
            {
                if (FromReceivedDate == string.Empty && ToReceivedDate != string.Empty)
                {
                    FromReceivedDate = ToReceivedDate;
                }

                if (ToReceivedDate == string.Empty && FromReceivedDate != string.Empty)
                {
                    ToReceivedDate = FromReceivedDate;
                }

                dnt.ReceivedDate  = DateTime.ParseExact(FromReceivedDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                dnt.ReceivedDate2 = DateTime.ParseExact(ToReceivedDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }

            dnt.Warehouse       = txtWhseCode.Text;
            dnt.DeliveryNoteNo  = txtDeliveryNote.Text;
            dnt.DeliveryOrderNo = txtDeliveryOrderNo.Text;
            dnt.ManifestNo      = txtManifestNo.Text;
            dnt.OrderNo         = txtOrderNumber.Text;
            dnt.Debtor          = txtOrderBy.Text;
            dnt.InvoiceToCode   = txtInvoiceTo.Text;
            dnt.DeliveryToCode  = txtDeliveryTo.Text;
            dnt.YourRef         = txtYourRef.Text;
            dnt.Description     = txtDescription.Text;
            dnt.SelectionCode   = txtSelectionCode.Text;
            dnt.DealingType     = txtDealingType.Text;
            Business.SearchOption searchOption = rblFilter.SelectedValue.ToSearchOptionEnum();

            gvDeliveryNotes.DataSource = dnt.Retrieve(searchOption);
            gvDeliveryNotes.DataBind();
        }
Example #9
0
        private void SearchDeliveryNotes()
        {
            DeliveryNote dn = new DeliveryNote();

            string FromFulfilmentDate = txtFulfilmentDate.Text.Trim();
            string ToFulfilmentDate   = txtFulfilmentDate2.Text.Trim();

            if (FromFulfilmentDate != string.Empty || ToFulfilmentDate != string.Empty)
            {
                if (FromFulfilmentDate == string.Empty && ToFulfilmentDate != string.Empty)
                {
                    FromFulfilmentDate = ToFulfilmentDate;
                }

                if (ToFulfilmentDate == string.Empty && FromFulfilmentDate != string.Empty)
                {
                    ToFulfilmentDate = FromFulfilmentDate;
                }

                dn.FulfilmentDate  = DateTime.ParseExact(FromFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                dn.FulfilmentDate2 = DateTime.ParseExact(ToFulfilmentDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }

            string FromOrderDate = txtOrderDate.Text.Trim();
            string ToOrderDate   = txtOrderDate2.Text.Trim();

            if (FromOrderDate != string.Empty || ToOrderDate != string.Empty)
            {
                if (FromOrderDate == string.Empty && ToOrderDate != string.Empty)
                {
                    FromOrderDate = ToOrderDate;
                }

                if (ToOrderDate == string.Empty && FromOrderDate != string.Empty)
                {
                    ToOrderDate = FromOrderDate;
                }

                dn.OrderDate  = DateTime.ParseExact(FromOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
                dn.OrderDate2 = DateTime.ParseExact(ToOrderDate, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }

            dn.Warehouse       = txtWhseCode.Text;
            dn.DeliveryNoteNo  = txtDeliveryNote.Text;
            dn.DeliveryOrderNo = txtDeliveryOrderNo.Text;
            dn.ManifestNo      = txtManifestNo.Text;
            dn.OrderNo         = txtOrderNumber.Text;
            dn.CustomerCode    = txtOrderBy.Text;
            dn.InvoiceToCode   = txtInvoiceTo.Text;
            dn.DeliveryToCode  = txtDeliveryTo.Text;
            dn.YourRef         = txtYourRef.Text;
            dn.Description     = txtDescription.Text;
            dn.SelectionCode   = txtSelectionCode.Text;
            dn.DealingType     = txtDealingType.Text;
            Business.SearchOption searchOption = rblFilter.SelectedValue.ToSearchOptionEnum();

            gvDeliveryNotes.DataSource = dn.Retrieve(searchOption);
            gvDeliveryNotes.DataBind();

            pnlDataEntry.Visible   = gvDeliveryNotes.Rows.Count != 0;
            pnlButtonEntry.Visible = pnlDataEntry.Visible;
        }