private void ItemAttachmentWnd_Load(object sender, System.EventArgs e) { try { this.BackgroundImage = new Bitmap(Application.StartupPath + "/images/Background.jpg"); } catch {} try { this.imgIcon.Image = new Bitmap(Application.StartupPath + "/images/Credits.jpg"); } catch {} try { this.cmdCancel.Image = new Bitmap(Application.StartupPath + "/images/blank_medium_dark_red.jpg"); } catch { } try { this.cmdEnter.Image = new Bitmap(Application.StartupPath + "/images/blank_medium_dark_green.jpg"); } catch { } lblHeader.Text = SalesTransactionItemDetails.ProductCode; Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.TransactionItemAttachmentDelete); mboDeleteTransactionItemAttachment = clsDetails.Write; clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.TransactionItemAttachmentViewDeleted); mboViewDeletedTransactionItemAttachment = clsDetails.Write; clsAccessRights.CommitAndDispose(); LoadOptions(); LoadData(); }
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); }
private void LoadOptions() { Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.ReprintZRead); cmdF9.Visible = clsDetails.Read; lblReprintZReadName.Visible = clsDetails.Read; clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.ReprintZRead); cmdF10.Visible = clsDetails.Read; lblPrintPLUReportPerOrderSlipPrinterName.Visible = clsDetails.Read; clsAccessRights.CommitAndDispose(); }
private void ManageSecurity() { Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.CreditPaymentReversal); mboCreditPaymentReversal = clsDetails.Write; clsAccessRights.CommitAndDispose(); }
private void ManageSecurity() { long UID = long.Parse(Session["UID"].ToString()); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductsListReport); lblSeparator1.Visible = clsDetails.Write; imgProductHistory.Visible = clsDetails.Write; cmdProductHistory.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PricesReport); lblSeparator2.Visible = clsDetails.Write; imgProductPriceHistory.Visible = clsDetails.Write; cmdProductPriceHistory.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChangePrice); lblSeparator3.Visible = clsDetails.Write; imgChangePrice.Visible = clsDetails.Write; cmdChangePrice.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Products); lblSeparator4.Visible = clsDetails.Write; imgEditNow.Visible = clsDetails.Write; cmdEditNow.Visible = clsDetails.Write; clsAccessRights.CommitAndDispose(); }
private void LoadOptions() { Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); //clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.ReprintZRead); //cmdF9.Visible = clsDetails.Read; //lblReprintZReadName.Visible = clsDetails.Read; clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.PLUReportPerOrderSlipPrinter); cmdF10.Visible = clsDetails.Read; lblPrintPLUReportPerOrderSlipPrinterName.Visible = clsDetails.Read; clsAccessRights.CommitAndDispose(); lblZeroRated.Text = !SalesTransactionDetails.isZeroRated ? "Tag as ZeroRated" : "Remove ZeroRated (Current status: ZeroRated)"; }
private void LoadOptions() { //change to ctrL+ALT+F9 Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.PrintZRead); cmdF9.Visible = clsDetails.Read; lblReprintZReadName.Visible = clsDetails.Read; clsDetails = clsAccessRights.Details(mlCashierID, (Int16)AccessTypes.PLUReportPerOrderSlipPrinter); cmdF10.Visible = clsDetails.Read; lblPrintPLUReportPerOrderSlipPrinterName.Visible = clsDetails.Read; clsAccessRights.CommitAndDispose(); }
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.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryMovement, ReportTypes.ProductHistoryMovement)); if (clsAccessRights.Details(UID, (int)AccessTypes.PricesReport).Read) cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryPrice, ReportTypes.ProductHistoryPrice)); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); if (clsAccessRights.Details(UID, (int)AccessTypes.MostSalableItemsReport).Read) cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryMostSaleable, ReportTypes.ProductHistoryMostSaleable)); if (clsAccessRights.Details(UID, (int)AccessTypes.LeastSalableItemsReport).Read) cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryLeastSaleable, ReportTypes.ProductHistoryLeastSaleable)); clsAccessRights.CommitAndDispose(); cboReportType.SelectedIndex = 0; try { if (Common.Decrypt(Request.QueryString["task"].ToString().ToLower(), Session.SessionID) == "producthistory") { cboReportType.SelectedIndex = cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.ProductHistoryMovement)); cboReportType_SelectedIndexChanged(null, null); } } catch {} try { if (Common.Decrypt(Request.QueryString["task"].ToString().ToLower(), Session.SessionID) == "pricehistory") { cboReportType.SelectedIndex = cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.ProductHistoryPrice)); cboReportType_SelectedIndexChanged(null, null); } } catch { } txtStartDate.Text = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd"); txtEndDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); string strProductCode = string.Empty; try { try { if (Request.QueryString["sender"].ToString().ToLower() == "direct" && Request.QueryString["productcode"].ToString() != null) strProductCode = Server.UrlDecode(Request.QueryString["productcode"].ToString()); } catch { strProductCode = Server.UrlDecode(Common.Decrypt(Request.QueryString["productcode"].ToString(), Session.SessionID)); } lblReferrer.ToolTip = strProductCode; } catch { strProductCode = lblReferrer.ToolTip; } txtProductCode.Text = strProductCode; Data.Products clsProduct = new Data.Products(); cboProductCode.DataTextField = "ProductCode"; cboProductCode.DataValueField = "ProductID"; cboProductCode.DataSource = clsProduct.ProductIDandCodeDataTable(SearchKey: txtProductCode.Text, limit: 100); cboProductCode.DataBind(); Branch clsBranch = new Branch(clsProduct.Connection, clsProduct.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; clsProduct.CommitAndDispose(); if (cboProductCode.Items.Count == 0) cboProductCode.Items.Add(new ListItem("No product", "0")); cboProductCode.SelectedIndex = 0; cboProductCode_SelectedIndexChanged(null, null); try { if (strProductCode != string.Empty && cboProductCode.SelectedItem.Value != "0") { if (!string.IsNullOrEmpty(Request.QueryString["reptype"])) GeneratePDF(); else GenerateHTML(); } } catch { } }
private void ManageSecurity() { long UID =long.Parse(Session["UID"].ToString()); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductsListReport); lblSeparator1.Visible = clsDetails.Write; imgProductHistory.Visible = clsDetails.Write; cmdProductHistory.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PricesReport); lblSeparator2.Visible = clsDetails.Write; imgProductPriceHistory.Visible = clsDetails.Write; cmdProductPriceHistory.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ChangePrice); lblSeparator3.Visible = clsDetails.Write; imgChangePrice.Visible = clsDetails.Write; cmdChangePrice.Visible = clsDetails.Write; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.Products); lblSeparator4.Visible = clsDetails.Write; imgEditNow.Visible = clsDetails.Write; cmdEditNow.Visible = clsDetails.Write; clsAccessRights.CommitAndDispose(); }
private void ManageSecurity() { Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.CreditCardIssuance); grpCreditDetails.Visible = clsDetails.Write; clsAccessRights.CommitAndDispose(); }
private void LoadOptions() { Int64 UID = Convert.ToInt64(Session["UID"]); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SummarizedDailySalesWithTFDetailed); clsAccessRights.CommitAndDispose(); cboReportType.Items.Clear(); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION, ReportTypes.REPORT_SELECTION)); cboReportType.Items.Add(new ListItem(ReportTypes.SummarizeDailySales, ReportTypes.SummarizeDailySales)); if (clsDetails.Read) cboReportType.Items.Add(new ListItem(ReportTypes.SalesPerDay, ReportTypes.SalesPerDay)); if (cboReportType.Items.Count == 2) cboReportType.Items.RemoveAt(cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.REPORT_SELECTION))); 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(OnlyIncludeIneSales: true).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 }
private void LoadOptions() { Int64 UID = Convert.ToInt64(Session["UID"]); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySalesWithTFDetailed); clsAccessRights.CommitAndDispose(); cboReportType.Items.Clear(); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION, ReportTypes.REPORT_SELECTION)); cboReportType.Items.Add(new ListItem(ReportTypes.SummarizeDailySales, ReportTypes.SummarizeDailySales)); if (clsDetails.Read) { cboReportType.Items.Add(new ListItem(ReportTypes.SalesPerDay, ReportTypes.SalesPerDay)); } if (cboReportType.Items.Count == 2) { cboReportType.Items.RemoveAt(cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.REPORT_SELECTION))); } 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(OnlyIncludeIneSales: true).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 }
private void ManageSecurity() { Int64 UID = Convert.ToInt64(Session["UID"]); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); bool boShowCommonReports = false; bool boShowRetailPOSReports = false; bool boShowFinancialReports = false; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ProductsListReport); lnkProducts.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkProducts.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowCommonReports) boShowCommonReports = true; //if (clsDetails.Read || clsAccessRights.Details(UID,(int) AccessTypes.PricesReport).Read) lnkProductHistory.Visible = clsDetails.Read; if (!clsDetails.Read) { clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PricesReport); lnkProductHistory.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkProductHistory.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowCommonReports) boShowCommonReports = true; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.InventoryReport); lnkInventory.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkInventory.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowCommonReports) boShowCommonReports = true; // initially hide these links lnkTransaction.Visible = false; lnkDatedReport.Visible = false; lnkTerminalReports.Visible = false; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.SalesTransactionReport); lnkTransaction.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkTransaction.Style.Add("display", "none"); lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkDatedReport.Style.Add("display", "none"); lnkTerminalReports.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkTerminalReports.Style.Add("display", "none"); if (!clsDetails.Read) { // check SummarizedDailySales clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySales); lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkDatedReport.Style.Add("display", "none"); if (!clsDetails.Read) { // check PaidOutDisburseROC clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PaidOutDisburseROC); lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkDatedReport.Style.Add("display", "none"); } } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ManagementReports); lnkManagementReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkManagementReport.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.AnalyticsReports); lnkAnalyticsReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkAnalyticsReport.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySalesWithTF); lnkeSalesReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkeSalesReport.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.StockTransactions); lnkStockTransaction.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkStockTransaction.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.ContactsReport); lnkContacts.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkContacts.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowCommonReports) boShowCommonReports = true; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.CustomerCreditReport); lnkCustomerCredit.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkCustomerCredit.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowFinancialReports) boShowFinancialReports = true; //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.CustomersWithCreditReport); //lnkCustomersWithCreditReport.Visible = clsDetails.Read; //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.MostSalableItemsReport); //lnkMostSalableItems.Visible = clsDetails.Read; //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.LeastSalableItemsReport); //lnkLeastSalableItems.Visible = clsDetails.Read; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.LoginLogoutReport); lnkLoginLogoutReport.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkLoginLogoutReport.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowCommonReports) boShowCommonReports = true; clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.PurchaseAnalysis); lnkPurchaseAnalysis.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkPurchaseAnalysis.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) boShowRetailPOSReports = true; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.AgentCommisionReport); lnkAgentsCommision.Visible = clsDetails.Read; if (!clsDetails.Read) divlnkAgentsCommision.Style.Add("display", "none"); // show label for reporting if (clsDetails.Read && !boShowFinancialReports) boShowFinancialReports = true; clsAccessRights.CommitAndDispose(); if (!boShowCommonReports) { divlblCommonReports.Style.Add("display", "none"); divtblCommonReports.Style.Add("display", "none"); } if (!boShowRetailPOSReports) { divlblRetailPOSReports.Style.Add("display", "none"); divtblRetailPOSReports.Style.Add("display", "none"); } if (!boShowFinancialReports) { divlblFinancialReports.Style.Add("display", "none"); divtblFinancialReports.Style.Add("display", "none"); } }
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); }
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() { 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.ProductHistoryMovement, ReportTypes.ProductHistoryMovement)); if (clsAccessRights.Details(UID, (int)AccessTypes.PricesReport).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryPrice, ReportTypes.ProductHistoryPrice)); } cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); if (clsAccessRights.Details(UID, (int)AccessTypes.MostSalableItemsReport).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryMostSaleable, ReportTypes.ProductHistoryMostSaleable)); } if (clsAccessRights.Details(UID, (int)AccessTypes.LeastSalableItemsReport).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.ProductHistoryLeastSaleable, ReportTypes.ProductHistoryLeastSaleable)); } clsAccessRights.CommitAndDispose(); cboReportType.SelectedIndex = 0; try { if (Common.Decrypt(Request.QueryString["task"].ToString().ToLower(), Session.SessionID) == "producthistory") { cboReportType.SelectedIndex = cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.ProductHistoryMovement)); cboReportType_SelectedIndexChanged(null, null); } } catch {} try { if (Common.Decrypt(Request.QueryString["task"].ToString().ToLower(), Session.SessionID) == "pricehistory") { cboReportType.SelectedIndex = cboReportType.Items.IndexOf(cboReportType.Items.FindByValue(ReportTypes.ProductHistoryPrice)); cboReportType_SelectedIndexChanged(null, null); } } catch { } txtStartDate.Text = DateTime.Now.AddDays(-30).ToString("yyyy-MM-dd"); txtEndDate.Text = DateTime.Now.ToString("yyyy-MM-dd"); string strProductCode = string.Empty; try { try { if (Request.QueryString["sender"].ToString().ToLower() == "direct" && Request.QueryString["productcode"].ToString() != null) { strProductCode = Server.UrlDecode(Request.QueryString["productcode"].ToString()); } } catch { strProductCode = Server.UrlDecode(Common.Decrypt(Request.QueryString["productcode"].ToString(), Session.SessionID)); } lblReferrer.ToolTip = strProductCode; } catch { strProductCode = lblReferrer.ToolTip; } txtProductCode.Text = strProductCode; Data.Products clsProduct = new Data.Products(); cboProductCode.DataTextField = "ProductCode"; cboProductCode.DataValueField = "ProductID"; cboProductCode.DataSource = clsProduct.ProductIDandCodeDataTable(SearchKey: txtProductCode.Text, limit: 100); cboProductCode.DataBind(); Branch clsBranch = new Branch(clsProduct.Connection, clsProduct.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; clsProduct.CommitAndDispose(); if (cboProductCode.Items.Count == 0) { cboProductCode.Items.Add(new ListItem("No product", "0")); } cboProductCode.SelectedIndex = 0; cboProductCode_SelectedIndexChanged(null, null); try { if (strProductCode != string.Empty && cboProductCode.SelectedItem.Value != "0") { if (!string.IsNullOrEmpty(Request.QueryString["reptype"])) { GeneratePDF(); } else { GenerateHTML(); } } } catch { } }
private void MainWnd_KeyDown(object sender, KeyEventArgs e) { try { if (e.KeyData == Keys.F1) { ShowHelp(); } else if (mboLocked && e.KeyData == Keys.F2) { this.PriceInquiry(); } else if (e.KeyData == Keys.Escape) { if (txtBarCode.Text != string.Empty) { txtBarCode.Text = string.Empty; txtBarCode.Focus(); } else { this.Exit(); } } else if (mboLocked) { if (Control.ModifierKeys == Keys.Control && e.KeyCode == Keys.L) LoggedOutCashier(true); else if (e.KeyData == Keys.Enter) this.DoLogin(); } else if (!mboLocked) { // 15Jun2015 : Do not allow to do anything in Closed Transaction if (mclsSalesTransactionDetails.TransactionStatus == TransactionStatus.Closed || mclsSalesTransactionDetails.TransactionStatus == TransactionStatus.ClosedOutOfStock || mclsSalesTransactionDetails.TransactionStatus == TransactionStatus.ClosedWalkIn) { e.SuppressKeyPress = true; if (e.KeyCode != Keys.F7 && e.KeyCode != Keys.Add && e.KeyCode != Keys.Up && e.KeyCode != Keys.Down && e.KeyCode != Keys.Oemplus) { return; } } if (txtBarCode.Text != string.Empty && e.KeyCode != Keys.Enter) return; if (Control.ModifierKeys == Keys.Control) { switch (e.KeyCode) { case Keys.C: grpRLC.Visible = false; break; case Keys.H: DialogResult loginresult = GetWriteAccessAndLogin(mclsSalesTransactionDetails.CashierID, AccessTypes.PrintTransactionHeader); if (loginresult == DialogResult.OK) { PrintReportHeaderSection(true, DateTime.MinValue); MessageBox.Show("Transaction header has been printed.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); } break; case Keys.E: ReleaseItems(); break; case Keys.L: LoggedOutCashier(true); break; case Keys.O: OpenTransactionDrawer(); break; case Keys.P: PrintCheckOutBill(); break; case Keys.R: RefundTransaction(); break; case Keys.S: PrintOrderSlip(false); break; case Keys.T: UpdateIsConsignment(); lblConsignment.Visible = mclsSalesTransactionDetails.isConsignment; break; case Keys.U: PackTransaction(); break; case Keys.Insert: Float(); break; case Keys.F2: ChangeProductCode(); break; case Keys.F3: ChangeItemRemarks(); break; case Keys.F4: setItemAsDemo(); break; case Keys.F5: UpdateContact(); break; case Keys.F6: SelectContact(AceSoft.RetailPlus.Data.ContactGroupCategory.AGENT); break; case Keys.Enter: if (!mboIsInTransaction) { if (MessageBox.Show("Are you sure you want to reload the default options?", "RetailPlus", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes) { Data.SysConfig clsSysConfig = new Data.SysConfig(mConnection, mTransaction); mConnection = clsSysConfig.Connection; mTransaction = clsSysConfig.Transaction; try { mclsSysConfigDetails = clsSysConfig.get_SysConfigDetails(); } catch (Exception ex) { clsEvent.AddErrorEventLn(ex); } clsSysConfig.CommitAndDispose(); this.LoadOptions(); MessageBox.Show("Done!", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); } } break; case Keys.F7: IssueCreditCard(); break; case Keys.F8: RenewCreditCard(); break; case Keys.F9: CreditCardReplacement(CreditCardStatus.Replaced_Lost); break; case Keys.F10: CreditCardReplacement(CreditCardStatus.Replaced_Expired); break; case Keys.F11: CreditCardDeclareAsSuspended(); break; case Keys.F12: CreditCardReactivate(); break; } } else if (Control.ModifierKeys == Keys.Shift) { switch (e.KeyCode) { case Keys.Oemplus: AddItemAttachment(); break; case Keys.F1: ShowMallForwarder(); break; case Keys.F2: ChangePrice(); break; case Keys.F4: ApplyItemDiscountForAllItem(); break; case Keys.F5: ApplyTransDiscount(); break; case Keys.F6: SelectWaiter(); break; case Keys.F10: PaidOut(); break; case Keys.F11: Deposit(); break; case Keys.F12: ReprintTransaction(); break; case Keys.Enter: EnterCreditItemizePayment(); break; case Keys.Delete: InitializeZRead(true); break; } } else if (Control.ModifierKeys == Keys.Alt) { switch (e.KeyCode) { case Keys.F1: string strFileName = Application.ExecutablePath.ToUpper().Replace("RETAILPLUS.EXE","") + "print.prn"; RawPrinterHelper.SendFileToPrinter(mclsTerminalDetails.PrinterName, strFileName, "RetailPlus " + "print.prn"); CutPrinterPaper(mclsTerminalDetails.PrinterName); MessageBox.Show("Done printing 'print.prn'", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); break; case Keys.Enter: VerifyCredit(); break; case Keys.S: /********************** * December 18, 2008 * Added to reprint all items that are already printed * *******************/ PrintOrderSlip(true); break; case Keys.U: UnPackTransaction(); break; case Keys.F2: ChangeAmount(); break; case Keys.F4: e.SuppressKeyPress = true; return; case Keys.F5: ApplyTransCharge(); //ChargeTypes.Percentage break; case Keys.F6: ApplyTransCharge(); //ChargeTypes.FixedValue break; case Keys.F7: IssueRewardCard(); break; case Keys.F8: RenewRewardCard(); break; case Keys.F9: RewardCardReplacement(RewardCardStatus.Replaced_Lost); break; case Keys.F10: RewardCardReplacement(RewardCardStatus.Replaced_Expired); break; case Keys.F11: RewardCardDeclareAsLost(); break; case Keys.F12: RewardCardReactivate(); break; case Keys.Insert: ChangeZeroRated(true); break; case Keys.Delete: ChangeZeroRated(false); break; //case Keys.Enter: // mclsTerminalDetails.TrustFund = 0; // MessageBox.Show("Done!", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Information); // break; } } else if (Control.ModifierKeys == (Keys.Control | Keys.Shift)) { Security.AccessRights clsAccessRights; Security.AccessRightsDetails clsDetails; switch (e.KeyCode) { case Keys.Enter: clsAccessRights = new Security.AccessRights(); clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(mclsSalesTransactionDetails.CashierID, (Int16)AccessTypes.ReprintZRead); clsAccessRights.CommitAndDispose(); if (clsDetails.Read) { UpdateBranchAndTerminalNo(); } break; case Keys.F2: clsAccessRights = new Security.AccessRights(); clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(mclsSalesTransactionDetails.CashierID, (Int16)AccessTypes.Contacts); clsAccessRights.CommitAndDispose(); if (clsDetails.Write) { Data.ContactDetails clsContactDetails; DialogResult addresult = System.Windows.Forms.DialogResult.Cancel; switch (mclsSysConfigDetails.ContactAddWndType) { case ContactAddWndType.ContactAddWnd: case ContactAddWndType.ContactAddNoLTOWnd: ContactAddWnd clsContactAddWnd = new ContactAddWnd(); clsContactAddWnd.Caption = "Quickly add new customer."; clsContactAddWnd.ContactDetails = new Data.ContactDetails(); clsContactAddWnd.TerminalDetails = mclsTerminalDetails; clsContactAddWnd.SysConfigDetails = mclsSysConfigDetails; clsContactAddWnd.ShowDialog(this); addresult = clsContactAddWnd.Result; clsContactDetails = clsContactAddWnd.ContactDetails; clsContactAddWnd.Close(); clsContactAddWnd.Dispose(); break; case ContactAddWndType.ContactAddHCareWnd: ContactAddHCareWnd clsContactAddHCareWnd = new ContactAddHCareWnd(); clsContactAddHCareWnd.Caption = "Quickly add new customer."; clsContactAddHCareWnd.ContactDetails = new Data.ContactDetails(); clsContactAddHCareWnd.TerminalDetails = mclsTerminalDetails; clsContactAddHCareWnd.ShowDialog(this); addresult = clsContactAddHCareWnd.Result; clsContactDetails = clsContactAddHCareWnd.ContactDetails; clsContactAddHCareWnd.Close(); clsContactAddHCareWnd.Dispose(); break; default: ContactAddDetWnd clsContactAddDetWnd = new ContactAddDetWnd(); clsContactAddDetWnd.Caption = "Quickly add new customer."; clsContactAddDetWnd.ContactDetails = new Data.ContactDetails(); clsContactAddDetWnd.TerminalDetails = mclsTerminalDetails; clsContactAddDetWnd.ShowDialog(this); addresult = clsContactAddDetWnd.Result; clsContactDetails = clsContactAddDetWnd.ContactDetails; clsContactAddDetWnd.Close(); clsContactAddDetWnd.Dispose(); break; } if (addresult == DialogResult.OK) LoadContact(Data.ContactGroupCategory.CUSTOMER, clsContactDetails); } break; case Keys.F6: UpdateContact(); break; case Keys.F9: // needs the counter so that it will only show if CTRL+SHIFT+F9 is hit twice if (miReprintZReadCounter >= 1) { clsAccessRights = new Security.AccessRights(); clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(mclsSalesTransactionDetails.CashierID, (Int16)AccessTypes.ReprintZRead); clsAccessRights.CommitAndDispose(); if (clsDetails.Read) { ReprintZRead(); } miReprintZReadCounter = 0; } else { miReprintZReadCounter += 1; } break; } } else { switch (e.KeyData) { case Keys.Add: case Keys.Oemplus: AddItemAttachment(); break; case Keys.Up: MoveItemUp(); break; case Keys.Down: MoveItemDown(); break; case Keys.Escape: this.Exit(); break; case Keys.F1: ShowHelp(); break; case Keys.F2: ChangeQuantity(); break; case Keys.F3: ReturnItem(); break; case Keys.F4: ApplyItemDiscount(); break; case Keys.F5: ApplyTransDiscount(); break; case Keys.F6: SelectContact(AceSoft.RetailPlus.Data.ContactGroupCategory.CUSTOMER); break; case Keys.F7: if (!mboIsInTransaction) { ResumeClosedTransaction(); } else { SuspendTransaction(); } break; case Keys.F8: ResumeTransaction(); break; case Keys.F9: VoidTransaction(); break; case Keys.F10: Disburse(); break; case Keys.F11: WithHold(); break; case Keys.F12: ShowPrintWindow(); break; case Keys.Enter: if (!string.IsNullOrEmpty(txtBarCode.Text.Trim())) if (txtBarCode.Text.Contains(Constants.SWIPE_REWARD_CARD)) { clsEvent.AddEventLn("[" + lblCashier.Text + "] Selecting customer.", true); LoadContact(Data.ContactGroupCategory.CUSTOMER, new Data.ContactDetails()); } else { if (txtBarCode.Text.Contains("*") && txtBarCode.Text.Split('*')[0].Contains("-")) MessageBox.Show("Sorry you cannot enter a negative quantity when selling an item.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); else ReadBarCode(); } else if (lblCustomer.Text.Trim().ToUpper() == Constants.C_RETAILPLUS_ORDER_SLIP_CUSTOMER) CloseTransactionAsOrderSlip(); else CloseTransaction(); break; case Keys.Back: if (string.IsNullOrEmpty(txtBarCode.Text.Trim())) VoidItem(); break; case Keys.Insert: { if (mclsTerminalDetails.CashCountBeforeReport) { if (!mboIsCashCountInitialized) CashCount(); else MessageBox.Show("Sorry, cash count has been already initialized for the day. You can only initialize cash count once a day.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Stop); } else { CashCount(); } break; } case Keys.Delete: InitializeZRead(false); break; case Keys.PageDown: SelectProduct(false); break; case Keys.Right: SelectProduct(false); // 13May2013 LEAceron: by right, price should be visible. break; case Keys.PageUp: SelectProduct(true); break; case Keys.Left: PriceInquiry(); break; } } } } catch (Exception ex) { InsertErrorLogToFile(ex, "ERROR!!! Processing event."); } }
private void ManageSecurity() { Int64 UID = Convert.ToInt64(Session["UID"]); Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); bool boShowCommonReports = false; bool boShowRetailPOSReports = false; bool boShowFinancialReports = false; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ProductsListReport); lnkProducts.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkProducts.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowCommonReports) { boShowCommonReports = true; } //if (clsDetails.Read || clsAccessRights.Details(UID,(int) AccessTypes.PricesReport).Read) lnkProductHistory.Visible = clsDetails.Read; if (!clsDetails.Read) { clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PricesReport); lnkProductHistory.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkProductHistory.Style.Add("display", "none"); } } // show label for reporting if (clsDetails.Read && !boShowCommonReports) { boShowCommonReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.InventoryReport); lnkInventory.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkInventory.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowCommonReports) { boShowCommonReports = true; } // initially hide these links lnkTransaction.Visible = false; lnkDatedReport.Visible = false; lnkTerminalReports.Visible = false; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SalesTransactionReport); lnkTransaction.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkTransaction.Style.Add("display", "none"); } lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkDatedReport.Style.Add("display", "none"); } lnkTerminalReports.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkTerminalReports.Style.Add("display", "none"); } if (!clsDetails.Read) { // check SummarizedDailySales clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySales); lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkDatedReport.Style.Add("display", "none"); } if (!clsDetails.Read) { // check PaidOutDisburseROC clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PaidOutDisburseROC); lnkDatedReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkDatedReport.Style.Add("display", "none"); } } } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ManagementReports); lnkManagementReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkManagementReport.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.AnalyticsReports); lnkAnalyticsReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkAnalyticsReport.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySalesWithTF); lnkeSalesReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkeSalesReport.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.StockTransactions); lnkStockTransaction.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkStockTransaction.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.ContactsReport); lnkContacts.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkContacts.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowCommonReports) { boShowCommonReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.CustomerCreditReport); lnkCustomerCredit.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkCustomerCredit.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowFinancialReports) { boShowFinancialReports = true; } //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.CustomersWithCreditReport); //lnkCustomersWithCreditReport.Visible = clsDetails.Read; //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.MostSalableItemsReport); //lnkMostSalableItems.Visible = clsDetails.Read; //clsDetails = clsAccessRights.Details(UID,(int) AccessTypes.LeastSalableItemsReport); //lnkLeastSalableItems.Visible = clsDetails.Read; clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.LoginLogoutReport); lnkLoginLogoutReport.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkLoginLogoutReport.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowCommonReports) { boShowCommonReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.PurchaseAnalysis); lnkPurchaseAnalysis.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkPurchaseAnalysis.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowRetailPOSReports) { boShowRetailPOSReports = true; } clsDetails = clsAccessRights.Details(UID, (int)AccessTypes.AgentCommisionReport); lnkAgentsCommision.Visible = clsDetails.Read; if (!clsDetails.Read) { divlnkAgentsCommision.Style.Add("display", "none"); } // show label for reporting if (clsDetails.Read && !boShowFinancialReports) { boShowFinancialReports = true; } clsAccessRights.CommitAndDispose(); if (!boShowCommonReports) { divlblCommonReports.Style.Add("display", "none"); divtblCommonReports.Style.Add("display", "none"); } if (!boShowRetailPOSReports) { divlblRetailPOSReports.Style.Add("display", "none"); divtblRetailPOSReports.Style.Add("display", "none"); } if (!boShowFinancialReports) { divlblFinancialReports.Style.Add("display", "none"); divtblFinancialReports.Style.Add("display", "none"); } }
private void ItemAttachmentWnd_Load(object sender, System.EventArgs e) { try { this.BackgroundImage = new Bitmap(Application.StartupPath + "/images/Background.jpg"); } catch{} try { this.imgIcon.Image = new Bitmap(Application.StartupPath + "/images/Credits.jpg"); } catch{} try { this.cmdCancel.Image = new Bitmap(Application.StartupPath + "/images/blank_medium_dark_red.jpg"); } catch { } try { this.cmdEnter.Image = new Bitmap(Application.StartupPath + "/images/blank_medium_dark_green.jpg"); } catch { } lblHeader.Text = SalesTransactionItemDetails.ProductCode; Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.TransactionItemAttachmentDelete); mboDeleteTransactionItemAttachment = clsDetails.Write; clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.TransactionItemAttachmentViewDeleted); mboViewDeletedTransactionItemAttachment = clsDetails.Write; clsAccessRights.CommitAndDispose(); LoadOptions(); LoadData(); }
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)); if (clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySales).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.SummarizeDailySales, ReportTypes.SummarizeDailySales)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesPerDay, ReportTypes.SalesPerDay)); } //if (clsAccessRights.Details(UID, (int)AccessTypes.SummarizedDailySalesWithTF).Read) //{ // cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); // cboReportType.Items.Add(new ListItem(ReportTypes.SummarizeDailySalesWithTF, ReportTypes.SummarizeDailySalesWithTF)); // cboReportType.Items.Add(new ListItem(ReportTypes.SalesPerDayWithTF, ReportTypes.SalesPerDayWithTF)); //} if (clsAccessRights.Details(UID, (int)AccessTypes.SalesTransactionReport).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesPerHour, ReportTypes.SalesPerHour)); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactions, ReportTypes.SalesTransactions)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCustomer, ReportTypes.SalesTransactionPerCustomer)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCustomerPerGroup, ReportTypes.SalesTransactionPerCustomerPerGroup)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCustomerPerGroupSummarized, ReportTypes.SalesTransactionPerCustomerPerGroupSummarized)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCustomerWithCheque, ReportTypes.SalesTransactionPerCustomerWithCheque)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCustomerPerItem, ReportTypes.SalesTransactionPerCustomerPerItem)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCashier, ReportTypes.SalesTransactionPerCashier)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerCashierPerCustomer, ReportTypes.SalesTransactionPerCashierPerCustomer)); cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerTerminal, ReportTypes.SalesTransactionPerTerminal)); if (clsAccessRights.Details(UID, (int)AccessTypes.SalesTransactionPerItem).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerItem, ReportTypes.SalesTransactionPerItem)); } if (clsAccessRights.Details(UID, (int)AccessTypes.SalesTransactionPerItemWoutPurchaseDetails).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.SalesTransactionPerItemWoutPurchaseDetails, ReportTypes.SalesTransactionPerItemWoutPurchaseDetails)); } cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.CashSalesDaily, ReportTypes.CashSalesDaily)); cboReportType.Items.Add(new ListItem(ReportTypes.CashSalesMonthly, ReportTypes.CashSalesMonthly)); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.ChequePaymentList, ReportTypes.ChequePaymentList)); cboReportType.Items.Add(new ListItem(ReportTypes.ChequeSalesDaily, ReportTypes.ChequeSalesDaily)); cboReportType.Items.Add(new ListItem(ReportTypes.ChequeSalesMonthly, ReportTypes.ChequeSalesMonthly)); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.CreditCardSalesDaily, ReportTypes.CreditCardSalesDaily)); cboReportType.Items.Add(new ListItem(ReportTypes.CreditCardSalesMonthly, ReportTypes.CreditCardSalesMonthly)); cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.DailySalesTransaction, ReportTypes.DailySalesTransaction)); cboReportType.Items.Add(new ListItem(ReportTypes.WeeklySalesTransaction, ReportTypes.WeeklySalesTransaction)); cboReportType.Items.Add(new ListItem(ReportTypes.MonthlySalesTransaction, ReportTypes.MonthlySalesTransaction)); } if (clsAccessRights.Details(UID, (int)AccessTypes.PaidOutDisburseROC).Read) { cboReportType.Items.Add(new ListItem(ReportTypes.REPORT_SELECTION_SEPARATOR, ReportTypes.REPORT_SELECTION_SEPARATOR)); cboReportType.Items.Add(new ListItem(ReportTypes.PaidOut, ReportTypes.PaidOut)); cboReportType.Items.Add(new ListItem(ReportTypes.Disburse, ReportTypes.Disburse)); cboReportType.Items.Add(new ListItem(ReportTypes.RecieveOnAccount, ReportTypes.RecieveOnAccount)); } cboReportType.SelectedIndex = 0; clsAccessRights.CommitAndDispose(); 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())); txtStartValidityDate.Text = Common.ToShortDateString(DateTime.Now); txtEndValidityDate.Text = Common.ToShortDateString(DateTime.Now.AddDays(30)); 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; ContactGroups clsContactGroups = new ContactGroups(clsCustomer.Connection, clsCustomer.Transaction); cboContactGroupName.DataTextField = "ContactGroupName"; cboContactGroupName.DataValueField = "ContactGroupID"; cboContactGroupName.DataSource = clsContactGroups.ListAsDataTable(ContactGroupCategory.CUSTOMER, txtContactGroupName.Text); cboContactGroupName.DataBind(); if (string.IsNullOrEmpty(txtContactName.Text)) cboContactGroupName.Items.Insert(0, new ListItem(Constants.ALL, Constants.ZERO_STRING)); else cboContactGroupName.Items.Insert(0, new ListItem(Constants.ALL + " LIKE " + txtContactGroupName.Text, Constants.ZERO_STRING)); cboContactGroupName.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 }
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 CreditVerificationWnd_Load(object sender, System.EventArgs e) { this.lblHeader.Text = !string.IsNullOrEmpty(mstCaption) ? mstCaption : CompanyDetails.CompanyCode + " Credit Verification"; Security.AccessRights clsAccessRights = new Security.AccessRights(); Security.AccessRightsDetails clsDetails = new Security.AccessRightsDetails(); clsDetails = clsAccessRights.Details(CashierID, (Int16)AccessTypes.CreditAmountDueAdjustment); lblF7Press.Visible = clsDetails.Write; lblF7.Visible = clsDetails.Write; lblF7Desc.Visible = clsDetails.Write; lblF8Press.Visible = clsDetails.Write; lblF8.Visible = clsDetails.Write; lblF8Desc.Visible = clsDetails.Write; mboCreditAmountDueAdjustment = clsDetails.Write; clsAccessRights.CommitAndDispose(); LoadOptions(); }