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); }
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); }