Beispiel #1
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}";
		}
        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;

                    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.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();");
				}
        }
		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");
		}
		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);
		}
 protected void imgContactCodeSearch_Click(object sender, System.Web.UI.ImageClickEventArgs e)
 {
     Contacts clsContact = new Contacts();
     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));
     if (cboContact.Items.Count > 1 && txtContactCode.Text.Trim() != string.Empty) cboContact.SelectedIndex = 1; else cboContact.SelectedIndex = 0;
     clsContact.CommitAndDispose();
 }
Beispiel #6
0
		private void LoadOptions()
		{
			Contacts clsContact = new Contacts();
            cboSupplier.DataTextField = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource = clsContact.SuppliersAsDataTable(null, 0, "ContactName", SortOption.Ascending).DefaultView;
			cboSupplier.DataBind();

			Branch clsBranch = new Branch(clsContact.Connection, clsContact.Transaction);
			cboBranch.DataTextField = "BranchCode";
			cboBranch.DataValueField = "BranchID";
			cboBranch.DataSource = clsBranch.ListAsDataTable().DefaultView;
			cboBranch.DataBind();
			clsContact.CommitAndDispose();

			cboSupplier.SelectedIndex = 0;
			cboSupplier_SelectedIndexChanged(null, null);
            cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));
			cboBranch_SelectedIndexChanged(null, null);

			NewTransaction();
		}
Beispiel #7
0
		private void LoadOptions()
		{
			Contacts clsContact = new Contacts();
            cboSupplier.DataTextField = "ContactName";
			cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource = clsContact.SuppliersAsDataTable(null, 0, "ContactName", SortOption.Ascending).DefaultView;
			cboSupplier.DataBind();

            bool boIsePurchaseOrder = bool.TryParse(lblIsePurchaseOrder.Text, out boIsePurchaseOrder) ? boIsePurchaseOrder : false;

			Branch clsBranch = new Branch(clsContact.Connection, clsContact.Transaction);
			cboBranch.DataTextField = "BranchCode";
			cboBranch.DataValueField = "BranchID";
			cboBranch.DataSource = clsBranch.ListAsDataTable(OnlyIncludeIneSales: boIsePurchaseOrder).DefaultView;
			cboBranch.DataBind();

			clsContact.CommitAndDispose();

			cboSupplier.SelectedIndex = 0;
			cboSupplier_SelectedIndexChanged(null, null);
            cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));
			cboBranch_SelectedIndexChanged(null, null);

            lblIsePurchaseOrder.Text = boIsePurchaseOrder ? "true" : "false";

			NewTransaction();
		}
		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 #9
0
		private void LoadOptions()
		{
			DataClass clsDataClass = new DataClass();

			Contacts clsContact = new Contacts();
            cboSupplier.DataTextField = "ContactName";
            cboSupplier.DataValueField = "ContactID";
            cboSupplier.DataSource = clsContact.SuppliersAsDataTable(null, 0, "ContactName", SortOption.Ascending).DefaultView;
			cboSupplier.DataBind();
			clsContact.CommitAndDispose();
			cboSupplier.SelectedIndex = 0;
			cboSupplier_SelectedIndexChanged(null, null);

            bool boIsePurchaseOrder = bool.TryParse(Common.Decrypt(Request.QueryString["isepurchaseorder"].ToString(), Session.SessionID), out boIsePurchaseOrder) ? boIsePurchaseOrder : false;

			Branch clsBranch = new Branch();
			cboBranch.DataTextField = "BranchCode";
			cboBranch.DataValueField = "BranchID";
            cboBranch.DataSource = clsBranch.ListAsDataTable(OnlyIncludeIneSales: boIsePurchaseOrder).DefaultView;
			cboBranch.DataBind();
			clsBranch.CommitAndDispose();
            cboBranch.SelectedIndex = cboBranch.Items.IndexOf(cboBranch.Items.FindByValue(Constants.BRANCH_ID_MAIN.ToString()));
			cboBranch_SelectedIndexChanged(null, null);
		}
		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 #11
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 #12
0
		private void LoadList()
		{	
			Contacts clsContact = new Contacts();

			string SortField = "ContactID";
			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);	}

			if (Request.QueryString["Search"]==null)
			{
				PageData.DataSource = clsContact.SuppliersAsDataTable(null,0,SortField, sortoption).DefaultView;
			}
			else
			{						
				string SearchKey = Common.Decrypt((string)Request.QueryString["search"],Session.SessionID);
				PageData.DataSource = clsContact.SuppliersAsDataTable(SearchKey,0,SortField, sortoption).DefaultView;
			}

			clsContact.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;
		}