Beispiel #1
0
        private void LoadOptions()
        {
            if (mboIsPriceInq)
            {
                this.lblHeader.Text = "Item: Price Inquiry";
            }
            else
            {
                this.lblHeader.Text = "Select Item to purchase";
            }

            ProductGroup clsProductGroup = new ProductGroup();

            System.Data.DataTable dtaProductGroup = clsProductGroup.ListAsDataTable(SortField: "ProductGroupCode");
            clsProductGroup.CommitAndDispose();

            lstGroup.Items.Clear(); int iImgCtr = 0;
            foreach (System.Data.DataRow dr in dtaProductGroup.Rows)
            {
                lstGroup.Items.Add(dr["ProductGroupCode"].ToString(), dr["ProductGroupCode"].ToString(), iImgCtr);
                if (iImgCtr == 7)
                {
                    iImgCtr = 0;
                }
                else
                {
                    iImgCtr++;
                }
            }
            try { lstGroup.Items[0].Selected = true; }catch { }
        }
Beispiel #2
0
        private void LoadOptions()
        {
            Contacts clsContact = new Contacts();

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.CustomersDataTable(txtContactCode.Text).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboContact.Items.Insert(1, new ListItem(Constants.PLUSCARDMEMBERS, Constants.PLUSCARDMEMBERSID_STRING));
            cboContact.Items.Insert(2, new ListItem(Constants.ICCARDMEMBERS, Constants.ICCARDMEMBERSID_STRING));
            cboContact.Items.Insert(3, new ListItem(Constants.GCCARDMEMBERS, Constants.GCCARDMEMBERSID_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsContact.Connection, clsContact.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroupCode.Text, "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;

            clsContact.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, System.EventArgs.Empty);

            txtQuantity.Text   = "1";
            txtPromoValue.Text = "0";
        }
Beispiel #3
0
        private void LoadOptions()
        {
            Contacts clsContact = new Contacts();

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.SuppliersAsDataTable(txtContactCode.Text).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsContact.Connection, clsContact.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroupCode.Text, "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;

            clsContact.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, System.EventArgs.Empty);

            txtPromoBySupplierValue.Text = "0";

            txtCouponRemarks.Text  = "{DateNow}: Congratulations you qualified for our annual raffle promo brought to you by HOUSEWARE PLAZA SUPERSTORE and {SupplierName}.";
            txtCouponRemarks.Text += Environment.NewLine + Environment.NewLine + "Please proceed to our customer service for more info.";
            txtCouponRemarks.Text += Environment.NewLine + Environment.NewLine + "Products: {ProductGroup}";
            txtCouponRemarks.Text += Environment.NewLine + Environment.NewLine + "Total Amount Puchased: {Amount}";
            txtCouponRemarks.Text += Environment.NewLine + "OR No: {ORNo}";
            txtCouponRemarks.Text += Environment.NewLine + "Customer Name: {CustomerName}";
            txtCouponRemarks.Text += Environment.NewLine + "Check Ctr: {CheckCounter}";
        }
Beispiel #4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Visible)
                {
                    Branch clsBranch = new Branch();
                    cboBranch.DataTextField  = "BranchCode";
                    cboBranch.DataValueField = "BranchID";
                    cboBranch.DataSource     = clsBranch.ListAsDataTable().DefaultView;
                    cboBranch.DataBind();

                    cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));

                    mlngItemNo = 0;

                    ProductGroup clsProductGroup = new ProductGroup(clsBranch.Connection, clsBranch.Transaction);
                    cboProductGroup.DataTextField  = "ProductGroupName";
                    cboProductGroup.DataValueField = "ProductGroupID";
                    cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroup.Text, "ProductGroupName").DefaultView;
                    cboProductGroup.DataBind();
                    cboProductGroup.SelectedIndex = 0;

                    clsBranch.CommitAndDispose();

                    ManageSecurity();
                    LoadList();
                }
            }
        }
Beispiel #5
0
        private void LoadOptions()
        {
            ProductGroup clsProductGroup = new ProductGroup();
            DataClass    clsDataClass    = new DataClass();

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName").DefaultView;
            cboGroup.DataBind();
            cboGroup.SelectedIndex = cboGroup.Items.Count - 1;

            Data.Unit clsUnit = new Data.Unit();

            cboProductSubGroupUnit.DataTextField  = "UnitName";
            cboProductSubGroupUnit.DataValueField = "UnitID";
            cboProductSubGroupUnit.DataSource     = clsUnit.ListAsDataTable(SortField: "UnitName").DefaultView;
            cboProductSubGroupUnit.DataBind();
            cboProductSubGroupUnit.SelectedIndex = cboProductSubGroupUnit.Items.Count - 1;

            clsUnit.CommitAndDispose();

            if (cboGroup.Items.Count != 0)
            {
                Int32 BaseUnitID = clsProductGroup.Details(Convert.ToInt32(cboGroup.SelectedItem.Value)).UnitDetails.UnitID;
                cboProductSubGroupUnit.SelectedIndex = cboProductSubGroupUnit.Items.IndexOf(cboProductSubGroupUnit.Items.FindByValue(BaseUnitID.ToString()));
            }
            clsProductGroup.CommitAndDispose();
        }
Beispiel #6
0
        private void LoadOptions()
        {
            ProductGroup clsProductGroup = new ProductGroup();

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable();
            cboGroup.DataBind();
            cboGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboGroup.SelectedIndex = 0;

            ProductSubGroupColumns clsProductSubGroupColumns = new ProductSubGroupColumns()
            {
                ColumnsNameID = true
            };

            ProductSubGroup clsSubGroup = new ProductSubGroup(clsProductGroup.Connection, clsProductGroup.Transaction);

            cboSubGroup.DataTextField  = "ProductSubGroupName";
            cboSubGroup.DataValueField = "ProductSubGroupID";
            cboSubGroup.DataSource     = clsSubGroup.ListAsDataTable(clsProductSubGroupColumns, SortField: "ProductSubGroupName", SortOrder: System.Data.SqlClient.SortOrder.Ascending);
            cboSubGroup.DataBind();
            cboSubGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboSubGroup.SelectedIndex = 0;
            clsProductGroup.CommitAndDispose();
        }
Beispiel #7
0
        private void LoadOptions()
        {
            DataClass clsDataClass = new DataClass();
            Int32     iID          = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"], Session.SessionID));

            ProductGroup clsProductGroup = new ProductGroup();

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1;

            Data.Unit clsUnit = new Data.Unit(clsProductGroup.Connection, clsProductGroup.Transaction);
            cboProductUnit.DataTextField  = "UnitName";
            cboProductUnit.DataValueField = "UnitID";
            cboProductUnit.DataSource     = clsUnit.ListAsDataTable(SortField: "UnitName").DefaultView;
            cboProductUnit.DataBind();
            cboProductUnit.SelectedIndex = cboProductUnit.Items.Count - 1;
            clsUnit.CommitAndDispose();

            ContactColumns clsContactColumns = new ContactColumns();

            clsContactColumns.ContactID   = true;
            clsContactColumns.ContactName = true;

            ContactColumns clsContactSearchColumns = new ContactColumns();

            Contacts clsContact = new Contacts(clsProductGroup.Connection, clsProductGroup.Transaction);

            cboSupplier.DataTextField  = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource     = clsContact.Suppliers(clsContactColumns, 0, System.Data.SqlClient.SortOrder.Ascending, clsContactSearchColumns, string.Empty, 0, false, "ContactName", System.Data.SqlClient.SortOrder.Ascending).DefaultView;
            cboSupplier.DataBind();
            cboSupplier.SelectedIndex = cboSupplier.Items.Count - 1;

            ProductUnitsMatrix        clsUnitMatrix  = new ProductUnitsMatrix(clsProductGroup.Connection, clsProductGroup.Transaction);
            ProductUnitsMatrixDetails clsUnitDetails = clsUnitMatrix.LastDetails(iID);

            if (clsUnitDetails.BottomUnitName == null)
            {
                cboProductUnit.Enabled = true;
            }

            // Added July 9, 2010
            Terminal        clsTerminal        = new Terminal(clsProductGroup.Connection, clsProductGroup.Transaction);
            TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());

            txtWSPriceMarkUp.Text = clsTerminalDetails.WSPriceMarkUp.ToString();
            txtMargin.Text        = clsTerminalDetails.RETPriceMarkUp.ToString();

            clsProductGroup.CommitAndDispose();
        }
Beispiel #8
0
        private void LoadOptionsProducts()
        {
            ProductGroup clsProductGroup = new ProductGroup();

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable();
            cboGroup.DataBind();
            cboGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboGroup.SelectedIndex = 0;
            clsProductGroup.CommitAndDispose();

            cboGroup_SelectedIndexChanged(null, null);
        }
Beispiel #9
0
        private void LoadOptions()
        {
            DataClass clsDataClass = new DataClass();

            ProductGroup clsProductGroup = new ProductGroup();

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1;

            Data.Unit clsUnit = new Data.Unit(clsProductGroup.Connection, clsProductGroup.Transaction);
            cboProductUnit.DataTextField  = "UnitName";
            cboProductUnit.DataValueField = "UnitID";
            cboProductUnit.DataSource     = clsUnit.ListAsDataTable(SortField: "UnitName").DefaultView;
            cboProductUnit.DataBind();
            cboProductUnit.SelectedIndex = cboProductUnit.Items.Count - 1;

            ContactColumns clsContactColumns = new ContactColumns();

            clsContactColumns.ContactID   = true;
            clsContactColumns.ContactName = true;

            ContactColumns clsContactSearchColumns = new ContactColumns();

            Contacts clsContact = new Contacts(clsProductGroup.Connection, clsProductGroup.Transaction);

            cboSupplier.DataTextField  = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource     = clsContact.Suppliers(clsContactColumns, 0, System.Data.SqlClient.SortOrder.Ascending, clsContactSearchColumns, string.Empty, 0, false, "ContactName", System.Data.SqlClient.SortOrder.Ascending).DefaultView;
            cboSupplier.DataBind();
            cboSupplier.SelectedIndex = cboSupplier.Items.Count - 1;

            //// Added July 9, 2010
            // Remove Nov 22, 2011 - overwritten when a subgroup is selected
            //Terminal clsTerminal = new Terminal(clsProductGroup.Connection, clsProductGroup.Transaction);
            //TerminalDetails clsTerminalDetails = clsTerminal.Details(1);
            //txtWSPriceMarkUp.Text = clsTerminalDetails.WSPriceMarkUp.ToString();
            //txtMargin.Text = clsTerminalDetails.RETPriceMarkUp.ToString();
            //txtVAT.Text = clsTerminalDetails.VAT.ToString("###.#0");
            //txtEVAT.Text = clsTerminalDetails.EVAT.ToString("###.#0");
            //txtLocalTax.Text = clsTerminalDetails.LocalTax.ToString("###.#0");

            clsProductGroup.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, null);
        }
Beispiel #10
0
        protected void imgProductGroupSearch_Click(object sender, System.Web.UI.ImageClickEventArgs e)
        {
            ProductGroup clsProductGroup = new ProductGroup();

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroup.Text).DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            if (cboProductGroup.Items.Count > 1 && txtProductGroup.Text.Trim() != string.Empty)
            {
                cboProductGroup.SelectedIndex = 1;
            }
            else
            {
                cboProductGroup.SelectedIndex = 0;
            }
            clsProductGroup.CommitAndDispose();
        }
Beispiel #11
0
        private void LoadOptions()
        {
            ProductGroup clsProductGroup = new ProductGroup();

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable();
            cboGroup.DataBind();
            cboGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboGroup.SelectedIndex = 0;

            ProductSubGroupColumns clsProductSubGroupColumns = new ProductSubGroupColumns()
            {
                ColumnsNameID = true
            };

            ProductSubGroup clsSubGroup = new ProductSubGroup(clsProductGroup.Connection, clsProductGroup.Transaction);

            cboSubGroup.DataTextField  = "ProductSubGroupName";
            cboSubGroup.DataValueField = "ProductSubGroupID";
            cboSubGroup.DataSource     = clsSubGroup.ListAsDataTable(clsProductSubGroupColumns, SortField: "ProductSubGroupName", SortOrder: System.Data.SqlClient.SortOrder.Ascending);
            cboSubGroup.DataBind();
            cboSubGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboSubGroup.SelectedIndex = 0;

            Contacts clsContact = new Contacts(clsProductGroup.Connection, clsProductGroup.Transaction);

            cboSupplier.DataTextField  = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource     = clsContact.SuppliersAsDataTable(string.Empty, 0, "ContactName", SortOption.Ascending);
            cboSupplier.DataBind();
            cboSupplier.Items.Add(new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboSupplier.SelectedIndex = cboSupplier.Items.Count - 1;

            clsProductGroup.CommitAndDispose();

            txtStartTransactionDate.Text = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
            txtEndTransactionDate.Text   = DateTime.Now.ToString("yyyy-MM-dd");
        }
Beispiel #12
0
        private void LoadOptions()
        {
            txtExpiryDate.Text = DateTime.Now.ToString("yyyy-MM-dd");

            Branch clsBranch = new Branch();

            clsBranch.GetConnection();

            Int64 UID = Convert.ToInt64(Session["UID"]);

            cboBranch.DataTextField  = "BranchCode";
            cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource     = clsBranch.ListAsDataTable().DefaultView;
            cboBranch.DataBind();
            cboBranch.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboBranch.SelectedIndex = 0;

            Contacts clsContact = new Contacts(clsBranch.Connection, clsBranch.Transaction);

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.SuppliersAsDataTable(txtContactCode.Text, 100).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsBranch.Connection, clsBranch.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroupCode.Text).DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;

            clsBranch.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, System.EventArgs.Empty);
        }
Beispiel #13
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Visible)
                {
                    Branch clsBranch = new Branch();
                    cboBranch.DataTextField  = "BranchCode";
                    cboBranch.DataValueField = "BranchID";
                    cboBranch.DataSource     = clsBranch.ListAsDataTable().DefaultView;
                    cboBranch.DataBind();

                    cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));

                    mlngItemNo = 0;

                    ProductGroup clsProductGroup = new ProductGroup(clsBranch.Connection, clsBranch.Transaction);
                    cboProductGroup.DataTextField  = "ProductGroupName";
                    cboProductGroup.DataValueField = "ProductGroupID";
                    cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroup.Text).DefaultView;
                    cboProductGroup.DataBind();
                    cboProductGroup.SelectedIndex = 0;

                    clsBranch.CommitAndDispose();

                    txtClosingDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
                    ManageSecurity();
                    LoadList();
                    cmdZeroOutActualQuantity.Attributes.Add("onClick", "return confirm_zeroout_inventory();");
                    imgZeroOutActualQuantity.Attributes.Add("onClick", "return confirm_zeroout_inventory();");
                    cmdCopyPOSToActual.Attributes.Add("onClick", "return confirm_copypostoactual_inventory();");
                    imgCopyPOSToActual.Attributes.Add("onClick", "return confirm_copypostoactual_inventory();");
                    //cmdCloseInventory.Attributes.Add("onClick", "return confirm_close_inventory();");
                    //imgCloseInventory.Attributes.Add("onClick", "return confirm_close_inventory();");
                }
            }
        }
Beispiel #14
0
        private void LoadOptions()
        {
            ProductGroup clsProductGroup = new ProductGroup();
            DataClass    clsDataClass    = new DataClass();

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName").DefaultView;
            cboGroup.DataBind();
            cboGroup.SelectedIndex = cboGroup.Items.Count - 1;
            cboGroup_SelectedIndexChanged(null, System.EventArgs.Empty);

            Data.Unit clsUnit = new Data.Unit();

            cboProductSubGroupUnit.DataTextField  = "UnitName";
            cboProductSubGroupUnit.DataValueField = "UnitID";
            cboProductSubGroupUnit.DataSource     = clsUnit.ListAsDataTable(SortField: "UnitName").DefaultView;
            cboProductSubGroupUnit.DataBind();
            cboProductSubGroupUnit.SelectedIndex = cboProductSubGroupUnit.Items.Count - 1;

            Terminal        clsTerminal        = new Terminal(clsUnit.Connection, clsUnit.Transaction);
            TerminalDetails clsTerminalDetails = clsTerminal.Details(Int32.Parse(Session["BranchID"].ToString()), Session["TerminalNo"].ToString());

            txtVAT.Text      = clsTerminalDetails.VAT.ToString("###.#0");
            txtEVAT.Text     = clsTerminalDetails.EVAT.ToString("###.#0");
            txtLocalTax.Text = clsTerminalDetails.LocalTax.ToString("###.#0");

            clsUnit.CommitAndDispose();

            if (cboGroup.Items.Count != 0)
            {
                Int32 BaseUnitID = clsProductGroup.Details(Convert.ToInt32(cboGroup.SelectedItem.Value)).UnitDetails.UnitID;
                cboProductSubGroupUnit.SelectedIndex = cboProductSubGroupUnit.Items.IndexOf(cboProductSubGroupUnit.Items.FindByValue(BaseUnitID.ToString()));
            }
            clsProductGroup.CommitAndDispose();
        }
Beispiel #15
0
        private void LoadOptions()
        {
            txtExpiryDate.Text = DateTime.Now.AddMonths(6).ToString("yyyy-MM-dd");

            cboReportType.Items.Clear();
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION, ReportTypes.REPORT_SELECTION));
            //cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            //cboReportType.Items.Add(new ListItem(ReportTypes.DetailedInventory, ReportTypes.DetailedInventory));
            //cboReportType.Items.Add(new ListItem(ReportTypes.DetailedInventoryWQtyInOut, ReportTypes.DetailedInventoryWQtyInOut));
            //cboReportType.Items.Add(new ListItem(ReportTypes.SummarizedInventory, ReportTypes.SummarizedInventory));
            //cboReportType.Items.Add(new ListItem(ReportTypes.SummarizedInventoryWQtyInOut, ReportTypes.SummarizedInventoryWQtyInOut));
            //cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            //cboReportType.Items.Add(new ListItem(ReportTypes.ForPhysicalInventory, ReportTypes.ForPhysicalInventory));
            //cboReportType.Items.Add(new ListItem(ReportTypes.TotalStockInventoryDetailed, ReportTypes.TotalStockInventoryDetailed));
            //cboReportType.Items.Add(new ListItem(ReportTypes.TotalStockInventorySummarized, ReportTypes.TotalStockInventorySummarized));
            //cboReportType.Items.Add(new ListItem(ReportTypes.TotalStockInventoryWSupplier, ReportTypes.TotalStockInventoryWSupplier));
            //cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            cboReportType.Items.Add(new ListItem(ReportTypes.SummarizedInventoryByBranch, ReportTypes.SummarizedInventoryByBranch));
            cboReportType.Items.Add(new ListItem(ReportTypes.SummarizedInventoryBySupplier, ReportTypes.SummarizedInventoryBySupplier));
            cboReportType.Items.Add(new ListItem(ReportTypes.SummarizedInventoryByGroup, ReportTypes.SummarizedInventoryByGroup));
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));

            cboMonth.Items.Clear();
            cboMonth.Items.Add(new ListItem("Jan", "01"));
            cboMonth.Items.Add(new ListItem("Feb", "02"));
            cboMonth.Items.Add(new ListItem("Mar", "03"));
            cboMonth.Items.Add(new ListItem("Apr", "04"));
            cboMonth.Items.Add(new ListItem("May", "05"));
            cboMonth.Items.Add(new ListItem("Jun", "06"));
            cboMonth.Items.Add(new ListItem("Jul", "07"));
            cboMonth.Items.Add(new ListItem("Aug", "08"));
            cboMonth.Items.Add(new ListItem("Sep", "09"));
            cboMonth.Items.Add(new ListItem("Oct", "10"));
            cboMonth.Items.Add(new ListItem("Nov", "11"));
            cboMonth.Items.Add(new ListItem("Dec", "12"));
            cboMonth.SelectedIndex = DateTime.Now.Month - 1;

            cboYear.Items.Clear();
            for (int year = 2013; year <= DateTime.Now.Year; year++)
            {
                cboYear.Items.Add(new ListItem(year.ToString(), year.ToString()));
            }
            cboYear.SelectedIndex = cboYear.Items.Count - 1;

            Branch clsBranch = new Branch();

            clsBranch.GetConnection();

            Int64 UID = Convert.ToInt64(Session["UID"]);

            Security.AccessRights clsAccessRights = new Security.AccessRights(clsBranch.Connection, clsBranch.Transaction);
            if (clsAccessRights.Details(UID, (int)AccessTypes.ReorderReport).Read)
            {
                cboReportType.Items.Add(new ListItem(ReportTypes.ItemsForReOrder, ReportTypes.ItemsForReOrder));
            }

            if (clsAccessRights.Details(UID, (int)AccessTypes.OverStockReport).Read)
            {
                cboReportType.Items.Add(new ListItem(ReportTypes.OverStockItems, ReportTypes.OverStockItems));
            }

            if (clsAccessRights.Details(UID, (int)AccessTypes.InventoryReport).Read)
            {
                cboReportType.Items.Add(new ListItem(ReportTypes.ExpiredInventory, ReportTypes.ExpiredInventory));
            }

            cboReportType.SelectedIndex = 0;

            cboBranch.DataTextField  = "BranchCode";
            cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource     = clsBranch.ListAsDataTable(OnlyIncludeIneSales: true).DefaultView;
            cboBranch.DataBind();
            cboBranch.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboBranch.SelectedIndex = 0;

            Contacts clsContact = new Contacts(clsBranch.Connection, clsBranch.Transaction);

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.SuppliersAsDataTable(txtContactCode.Text, 100).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsBranch.Connection, clsBranch.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroupCode.Text, "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;

            clsBranch.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, System.EventArgs.Empty);
        }
Beispiel #16
0
        private void LoadList()
        {
            ProductGroup clsProductGroup = new ProductGroup();
            DataClass    clsDataClass    = new DataClass();

            string SortField = "a.ProductGroupID";

            if (Request.QueryString["sortfield"] != null)
            {
                SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID);
            }

            SortOption sortoption = SortOption.Ascending;

            if (Request.QueryString["sortoption"] != null)
            {
                sortoption = (SortOption)Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true);
            }

            string SearchKey = "";

            if (Request.QueryString["Search"] != null)
            {
                SearchKey = Common.Decrypt((string)Request.QueryString["search"], Session.SessionID);
            }
            PageData.DataSource = clsProductGroup.ListAsDataTable(SearchKey, SortField, sortoption).DefaultView;
            clsProductGroup.CommitAndDispose();

            int iPageSize = Convert.ToInt16(Session["PageSize"]);

            PageData.AllowPaging = true;
            PageData.PageSize    = iPageSize;
            try
            {
                PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1;
                lstItem.DataSource        = PageData;
                lstItem.DataBind();
            }
            catch
            {
                PageData.CurrentPageIndex = 1;
                lstItem.DataSource        = PageData;
                lstItem.DataBind();
            }

            cboCurrentPage.Items.Clear();
            for (int i = 0; i < PageData.PageCount; i++)
            {
                int iValue = i + 1;
                cboCurrentPage.Items.Add(new ListItem(iValue.ToString(), iValue.ToString()));
                if (PageData.CurrentPageIndex == i)
                {
                    cboCurrentPage.Items[i].Selected = true;
                }
                else
                {
                    cboCurrentPage.Items[i].Selected = false;
                }
            }
            lblDataCount.Text = " of " + " " + PageData.PageCount;
        }
Beispiel #17
0
        private void LoadOptions()
        {
            DataClass       clsDataClass      = new DataClass();
            ChartOfAccounts clsChartOfAccount = new ChartOfAccounts();

            System.Data.DataTable dtList = clsDataClass.DataReaderToDataTable(clsChartOfAccount.List("ChartOfAccountName", SortOption.Ascending));

            ProductGroup clsProductGroup = new ProductGroup(clsChartOfAccount.Connection, clsChartOfAccount.Transaction);

            System.Data.DataTable dtProductGroup = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName");

            ProductSubGroupColumns clsProductSubGroupColumns = new ProductSubGroupColumns()
            {
                ColumnsNameID = true
            };

            ProductSubGroup clsSubGroup = new ProductSubGroup(clsChartOfAccount.Connection, clsChartOfAccount.Transaction);

            System.Data.DataTable dtProductSubGroup = clsSubGroup.ListAsDataTable(clsProductSubGroupColumns, SortField: "ProductSubGroupName", SortOrder: System.Data.SqlClient.SortOrder.Ascending);

            Products clsProduct = new Products(clsChartOfAccount.Connection, clsChartOfAccount.Transaction);

            System.Data.DataTable dtProduct = clsProduct.ListAsDataTable("ProductID", SortOption.Ascending);

            clsChartOfAccount.CommitAndDispose();

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = dtProductGroup.DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Add(new ListItem("Apply to all Product Groups", "0"));
            cboProductGroup.SelectedIndex = cboProductGroup.Items.Count - 1;

            cboProductSubGroup.DataTextField  = "ProductSubGroupName";
            cboProductSubGroup.DataValueField = "ProductSubGroupID";
            cboProductSubGroup.DataSource     = dtProductSubGroup.DefaultView;
            cboProductSubGroup.DataBind();
            cboProductSubGroup.Items.Add(new ListItem("Do not Apply to Product Sub Groups", "-1"));
            cboProductSubGroup.Items.Add(new ListItem("Apply to all Product Sub Groups", "0"));
            cboProductSubGroup.SelectedIndex = cboProductSubGroup.Items.Count - 1;

            cboProduct.DataTextField  = "ProductCode";
            cboProduct.DataValueField = "ProductID";
            cboProduct.DataSource     = dtProduct.DefaultView;
            cboProduct.DataBind();
            cboProduct.Items.Add(new ListItem("Do not Apply to Products", "-1"));
            cboProduct.Items.Add(new ListItem("Apply to all Products", "0"));
            cboProduct.SelectedIndex = cboProduct.Items.Count - 1;

            cboChartOfAccountPurchase.DataTextField  = "ChartOfAccountNameComplete";
            cboChartOfAccountPurchase.DataValueField = "ChartOfAccountID";
            cboChartOfAccountPurchase.DataSource     = dtList.DefaultView;
            cboChartOfAccountPurchase.DataBind();
            cboChartOfAccountPurchase.Items.Add(new ListItem("Not Applicable", "0"));
            cboChartOfAccountPurchase.SelectedIndex = cboChartOfAccountPurchase.Items.Count - 1;

            cboChartOfAccountSold.DataTextField  = "ChartOfAccountNameComplete";
            cboChartOfAccountSold.DataValueField = "ChartOfAccountID";
            cboChartOfAccountSold.DataSource     = dtList.DefaultView;
            cboChartOfAccountSold.DataBind();
            cboChartOfAccountSold.Items.Add(new ListItem("Not Applicable", "0"));
            cboChartOfAccountSold.SelectedIndex = cboChartOfAccountSold.Items.Count - 1;

            cboChartOfAccountInventory.DataTextField  = "ChartOfAccountNameComplete";
            cboChartOfAccountInventory.DataValueField = "ChartOfAccountID";
            cboChartOfAccountInventory.DataSource     = dtList.DefaultView;
            cboChartOfAccountInventory.DataBind();
            cboChartOfAccountInventory.Items.Add(new ListItem("Not Applicable", "0"));
            cboChartOfAccountInventory.SelectedIndex = cboChartOfAccountInventory.Items.Count - 1;

            cboChartOfAccountIDTaxPurchase.DataTextField  = "ChartOfAccountNameComplete";
            cboChartOfAccountIDTaxPurchase.DataValueField = "ChartOfAccountID";
            cboChartOfAccountIDTaxPurchase.DataSource     = dtList.DefaultView;
            cboChartOfAccountIDTaxPurchase.DataBind();
            cboChartOfAccountIDTaxPurchase.Items.Add(new ListItem("Not Applicable", "0"));
            cboChartOfAccountIDTaxPurchase.SelectedIndex = cboChartOfAccountIDTaxPurchase.Items.Count - 1;

            cboChartOfAccountIDTaxSold.DataTextField  = "ChartOfAccountNameComplete";
            cboChartOfAccountIDTaxSold.DataValueField = "ChartOfAccountID";
            cboChartOfAccountIDTaxSold.DataSource     = dtList.DefaultView;
            cboChartOfAccountIDTaxSold.DataBind();
            cboChartOfAccountIDTaxSold.Items.Add(new ListItem("Not Applicable", "0"));
            cboChartOfAccountIDTaxSold.SelectedIndex = cboChartOfAccountIDTaxSold.Items.Count - 1;
        }
Beispiel #18
0
        private void LoadOptions()
        {
            txtStartTransactionDate.Text = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
            txtEndTransactionDate.Text   = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");

            Contacts clsContact = new Contacts();

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.SuppliersAsDataTable(Limit: 100).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsContact.Connection, clsContact.Transaction);

            cboGroup.DataTextField  = "ProductGroupName";
            cboGroup.DataValueField = "ProductGroupID";
            cboGroup.DataSource     = clsProductGroup.ListAsDataTable();
            cboGroup.DataBind();
            cboGroup.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.ZERO_STRING));
            cboGroup.SelectedIndex = 0;

            ProductSubGroupColumns clsProductSubGroupColumns = new ProductSubGroupColumns()
            {
                ColumnsNameID = true
            };

            ProductSubGroup clsProductSubGroup = new ProductSubGroup(clsContact.Connection, clsContact.Transaction);

            cboSubGroup.DataTextField  = "ProductSubGroupName";
            cboSubGroup.DataValueField = "ProductSubGroupID";
            cboSubGroup.DataSource     = clsProductSubGroup.ListAsDataTable(clsProductSubGroupColumns);
            cboSubGroup.DataBind();
            cboSubGroup.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.ZERO_STRING));
            cboSubGroup.SelectedIndex = 0;

            Data.Inventory clsInventory = new Data.Inventory(clsContact.Connection, clsContact.Transaction);
            cboInventoryNo.DataTextField  = "ReferenceNo";
            cboInventoryNo.DataValueField = "PostingReference";
            cboInventoryNo.DataSource     = clsInventory.ClosingInventoryReferenceNos(Convert.ToDateTime(txtStartTransactionDate.Text), Convert.ToDateTime(txtEndTransactionDate.Text));
            cboInventoryNo.DataBind();
            cboInventoryNo.Items.Insert(0, new ListItem(Constants.PLEASE_SELECT, Constants.PLEASE_SELECT + DateTime.MinValue.ToString("yyyy-MM-dd")));
            cboInventoryNo.SelectedIndex = 0;

            clsContact.CommitAndDispose();

            lblType.Text = ""; lblType.ToolTip = "";
            if (Request.QueryString["type"] != null)
            {
                lblType.Text = Common.Decrypt(Request.QueryString["type"].ToString(), Session.SessionID);
            }
            if (Request.QueryString["typedet"] != null)
            {
                lblType.ToolTip = Common.Decrypt(Request.QueryString["typedet"].ToString(), Session.SessionID);
            }
            lblBranchID.Text = "0";
            if (Request.QueryString["branchid"] != null)
            {
                lblBranchID.Text = Common.Decrypt(Request.QueryString["branchid"].ToString(), Session.SessionID);
            }

            if (Request.QueryString["refno"] != null)
            {
                string strRefNo = "refno";
                strRefNo = Common.Decrypt(Request.QueryString["refno"].ToString(), Session.SessionID);
                cboInventoryNo.SelectedIndex = cboInventoryNo.Items.IndexOf(cboInventoryNo.Items.FindByText(strRefNo));
            }

            if (Request.QueryString["prdgrpid"] != null)
            {
                string strPrdGrpID = "prdgrpid";
                strPrdGrpID            = Common.Decrypt(Request.QueryString["prdgrpid"].ToString(), Session.SessionID);
                cboGroup.SelectedIndex = cboGroup.Items.IndexOf(cboGroup.Items.FindByValue(strPrdGrpID));
            }

            if (Request.QueryString["contactid"] != null)
            {
                string strContactID = "contactid";
                strContactID             = Common.Decrypt(Request.QueryString["contactid"].ToString(), Session.SessionID);
                cboContact.SelectedIndex = cboContact.Items.IndexOf(cboContact.Items.FindByValue(strContactID));
            }
        }
Beispiel #19
0
        private void LoadOptions()
        {
            txtStartDate.Text = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd");
            txtEndDate.Text   = DateTime.Now.ToString("yyyy-MM-dd");

            Int64 UID = Convert.ToInt64(Session["UID"]);

            Security.AccessRights clsAccessRights = new Security.AccessRights();

            cboReportType.Items.Clear();
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION, ReportTypes.REPORT_SELECTION));

            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            cboReportType.Items.Add(new ListItem(ReportTypes.ProductList, ReportTypes.ProductList));

            if (clsAccessRights.Details(UID, (int)AccessTypes.PricesReport).Read)
            {
                cboReportType.Items.Add(new ListItem(ReportTypes.ProductPriceList, ReportTypes.ProductPriceList));
            }

            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            cboReportType.Items.Add(new ListItem(ReportTypes.ProductListWithInvalidMatrix, ReportTypes.ProductListWithInvalidMatrix));
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            cboReportType.Items.Add(new ListItem(ReportTypes.WeightedProductsForWeighingScale, ReportTypes.WeightedProductsForWeighingScale));
            cboReportType.Items.Add(new ListItem(ReportTypes.CountedProductsForWeighingScale, ReportTypes.CountedProductsForWeighingScale));
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));

            if (clsAccessRights.Details(UID, (int)AccessTypes.ProductsInDemoReport).Read)
            {
                cboReportType.Items.Add(new ListItem(ReportTypes.ProductsInDemoReport, ReportTypes.ProductsInDemoReport));
            }

            clsAccessRights.CommitAndDispose();
            cboReportType.SelectedIndex = 0;


            Branch clsBranch = new Branch();

            cboBranch.DataTextField  = "BranchCode";
            cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource     = clsBranch.ListAsDataTable().DefaultView;
            cboBranch.DataBind();
            cboBranch.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboBranch.SelectedIndex = 0;

            Contacts clsContact = new Contacts(clsBranch.Connection, clsBranch.Transaction);

            cboContact.DataTextField  = "ContactName";
            cboContact.DataValueField = "ContactID";
            cboContact.DataSource     = clsContact.SuppliersAsDataTable(txtContactCode.Text, 100).DefaultView;
            cboContact.DataBind();
            cboContact.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboContact.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsBranch.Connection, clsBranch.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupID";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(txtProductGroupCode.Text, "ProductGroupName").DefaultView;
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;

            clsBranch.CommitAndDispose();

            cboProductGroup_SelectedIndexChanged(null, System.EventArgs.Empty);
        }
Beispiel #20
0
        private void LoadOptions()
        {
            Int64 UID = Convert.ToInt64(Session["UID"]);

            Security.AccessRights clsAccessRights = new Security.AccessRights();

            cboReportType.Items.Clear();
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION, ReportTypes.REPORT_SELECTION));
            cboReportType.Items.Add(new ListItem(ReportTypes.MANAGEMENT_PerBranch, ReportTypes.MANAGEMENT_PerBranch));
            cboReportType.Items.Add(new ListItem(ReportTypes.MANAGEMENT_PerBranchPerMonth, ReportTypes.MANAGEMENT_PerBranchPerMonth));
            cboReportType.Items.Add(new ListItem(ReportTypes.MANAGEMENT_PerBranchPerMonthWithCovers, ReportTypes.MANAGEMENT_PerBranchPerMonthWithCovers));
            cboReportType.Items.Add(new ListItem(ReportTypes.MANAGEMENT_PerBranchPerDay, ReportTypes.MANAGEMENT_PerBranchPerDay));
            cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR));
            cboReportType.Items.Add(new ListItem(ReportTypes.MANAGEMENT_PerCustomerGroupPerDay, ReportTypes.MANAGEMENT_PerCustomerGroupPerDay));
            cboReportType.SelectedIndex = 0;

            cboConsignment.Items.Clear();
            cboConsignment.Items.Add(new ListItem("Both", "-1"));
            cboConsignment.Items.Add(new ListItem("Yes", true.ToString()));
            cboConsignment.Items.Add(new ListItem("No", false.ToString()));

            cboTransactionStatus.Items.Clear();
            foreach (string status in Enum.GetNames(typeof(TransactionStatus)))
            {
                cboTransactionStatus.Items.Add(new ListItem(status, status));
            }
            cboTransactionStatus.SelectedIndex = cboTransactionStatus.Items.IndexOf(cboTransactionStatus.Items.FindByText(TransactionStatus.NotYetApplied.ToString()));

            cboPaymentType.Items.Clear();
            foreach (string PaymentType in Enum.GetNames(typeof(PaymentTypes)))
            {
                cboPaymentType.Items.Add(new ListItem(PaymentType, PaymentType));
            }
            cboPaymentType.SelectedIndex = cboPaymentType.Items.IndexOf(cboPaymentType.Items.FindByText(PaymentTypes.NotYetAssigned.ToString()));

            txtStartTransactionDate.Text = Common.ToShortDateString(DateTime.Now.AddDays(-1));
            txtEndTransactionDate.Text   = Common.ToShortDateString(DateTime.Now);

            Customer clsCustomer = new Customer();

            cboContactName.DataTextField  = "ContactName";
            cboContactName.DataValueField = "ContactID";
            cboContactName.DataSource     = clsCustomer.CustomersDataTable(txtContactName.Text, 0, false, "ContactName", SortOption.Ascending);
            cboContactName.DataBind();
            if (string.IsNullOrEmpty(txtContactName.Text))
            {
                cboContactName.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            }
            else
            {
                cboContactName.Items.Insert(0, new ListItem(Constants.ALL + " LIKE " + txtContactName.Text, Constants.ZERO_STRING));
            }
            cboContactName.SelectedIndex = 0;

            cboAgent.Items.Clear();
            Contacts clsContact = new Contacts(clsCustomer.Connection, clsCustomer.Transaction);

            cboAgent.DataTextField  = "ContactName";
            cboAgent.DataValueField = "ContactID";
            cboAgent.DataSource     = clsContact.AgentsAsDataTable(txtAgent.Text, 0, "ContactName", SortOption.Ascending);
            cboAgent.DataBind();
            if (string.IsNullOrEmpty(txtAgent.Text))
            {
                cboAgent.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            }
            else
            {
                cboAgent.Items.Insert(0, new ListItem(Constants.ALL + " LIKE " + txtAgent.Text, Constants.ZERO_STRING));
            }
            cboAgent.SelectedIndex = 0;

            Terminal clsTerminal = new Terminal(clsCustomer.Connection, clsCustomer.Transaction);

            cboTerminalNo.DataTextField  = "TerminalNo";
            cboTerminalNo.DataValueField = "TerminalNo";
            cboTerminalNo.DataSource     = clsTerminal.ListAsDataTable();
            cboTerminalNo.DataBind();
            cboTerminalNo.Items.Insert(0, new ListItem(Constants.ALL, Constants.ALL));
            cboTerminalNo.SelectedIndex = 0;

            Branch clsBranch = new Branch(clsCustomer.Connection, clsCustomer.Transaction);

            cboBranch.DataTextField  = "BranchCode";
            cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource     = clsBranch.ListAsDataTable().DefaultView;
            cboBranch.DataBind();
            cboBranch.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboBranch.SelectedIndex = 0;

            Security.AccessUser clsAccessUser = new Security.AccessUser(clsCustomer.Connection, clsCustomer.Transaction);
            cboCashierName.DataTextField  = "Name";
            cboCashierName.DataValueField = "UID";
            cboCashierName.DataSource     = clsAccessUser.Cashiers(txtCashierName.Text, 0);
            cboCashierName.DataBind();
            if (string.IsNullOrEmpty(txtCashierName.Text))
            {
                cboCashierName.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            }
            else
            {
                cboCashierName.Items.Insert(0, new ListItem(Constants.ALL + " LIKE " + txtCashierName.Text, Constants.ZERO_STRING));
            }
            cboCashierName.SelectedIndex = 0;

            ProductGroup clsProductGroup = new ProductGroup(clsCustomer.Connection, clsCustomer.Transaction);

            cboProductGroup.DataTextField  = "ProductGroupName";
            cboProductGroup.DataValueField = "ProductGroupName";
            cboProductGroup.DataSource     = clsProductGroup.ListAsDataTable(SortField: "ProductGroupName");
            cboProductGroup.DataBind();
            cboProductGroup.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING));
            cboProductGroup.SelectedIndex = 0;
            clsCustomer.CommitAndDispose();

            #region Sales Per Day
            cboMonth.Items.Add(new ListItem("January", "1"));
            cboMonth.Items.Add(new ListItem("February", "2"));
            cboMonth.Items.Add(new ListItem("March", "3"));
            cboMonth.Items.Add(new ListItem("April", "4"));
            cboMonth.Items.Add(new ListItem("May", "5"));
            cboMonth.Items.Add(new ListItem("June", "6"));
            cboMonth.Items.Add(new ListItem("July", "7"));
            cboMonth.Items.Add(new ListItem("August", "8"));
            cboMonth.Items.Add(new ListItem("September", "9"));
            cboMonth.Items.Add(new ListItem("October", "10"));
            cboMonth.Items.Add(new ListItem("November", "11"));
            cboMonth.Items.Add(new ListItem("Decemeber", "12"));
            cboMonth.SelectedIndex = DateTime.Now.Month - 1;

            int x = 2007;
            while (x <= DateTime.Now.Year)
            {
                cboYear.Items.Add(new ListItem(x.ToString(), x.ToString()));
                x++;
            }
            cboYear.SelectedIndex = cboYear.Items.Count - 1;
            #endregion
        }