public static void SetSalesDataSet(string currentUser, MetroForm tempForm) { ResetSalesData(); SelectedForm = tempForm; CurrentUser = currentUser; if (Accounts.IsAdmin(CurrentUser) || currentUser == "") { CurrentAdmin = CurrentUser; AdminSales(); return; } SalesView = SelectedForm.GetControl <DataGridViewX>("SalesView"); SalesView.AllowUserToDeleteRows = true; SalesCalendar = SelectedForm.GetControl <MonthCalendarAdv>("SalesCalendar"); SalesCalendar.SelectionStart = DateTime.Now; SalesCalendar.SelectionEnd = DateTime.Now; SalesCalendar.MarkedDates = null; SalesCalendar.UpdateMarkedDates(); InitializeSalesData(); SelectedForm.GetControl <LabelX>("TotalTeamSales").Text = $"Total Team Sales: {SalesDataSet.GetAllSales()}"; InitializeEvents(); }
public static void ResetSalesData() { SalesDataSet = null; TempDataSet = null; if (SalesCalendar != null) { SalesCalendar.MarkedDates = null; SalesCalendar.UpdateMarkedDates(); SalesCalendar.MouseClick -= SalesDelete; SalesCalendar.DateSelected -= DateSelect; } SalesCalendar = null; CurrentUser = ""; NotSaved = false; TotalSalesGridRow = null; CurrentTable = null; if (SalesView != null) { SalesView.ResetDataGridView(); SalesView = null; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); Syncfusion.Windows.Forms.MetroColorTable metroColorTable1 = new Syncfusion.Windows.Forms.MetroColorTable(); this.htmluiControl1 = new Syncfusion.Windows.Forms.HTMLUI.HTMLUIControl(); this.fontListBox1 = new Syncfusion.Windows.Forms.Tools.FontListBox(); this.dataGrid1 = new System.Windows.Forms.DataGrid(); this.monthCalendar1 = new Syncfusion.Windows.Forms.Tools.MonthCalendarAdv(); this.calculatorControl1 = new Syncfusion.Windows.Forms.Tools.CalculatorControl(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.button2 = new Syncfusion.Windows.Forms.ButtonAdv(); this.button1 = new Syncfusion.Windows.Forms.ButtonAdv(); this.mainFrameBarManager1 = new Syncfusion.Windows.Forms.Tools.XPMenus.MainFrameBarManager(this); this.bar1 = new Syncfusion.Windows.Forms.Tools.XPMenus.Bar(this.mainFrameBarManager1, "menu"); this.parentBarItem1 = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem(); this.barItem1 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.parentBarItem2 = new Syncfusion.Windows.Forms.Tools.XPMenus.ParentBarItem(); this.barItem2 = new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem(); this.gradientPanel1 = new Syncfusion.Windows.Forms.Tools.GradientPanel(); ((System.ComponentModel.ISupportInitialize)(this.htmluiControl1)).BeginInit(); this.htmluiControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.monthCalendar1)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.mainFrameBarManager1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).BeginInit(); this.gradientPanel1.SuspendLayout(); this.SuspendLayout(); // // htmluiControl1 // this.htmluiControl1.AutoScroll = true; this.htmluiControl1.AutoScrollMinSize = new System.Drawing.Size(603, 301); this.htmluiControl1.BackColor = System.Drawing.Color.White; this.htmluiControl1.Controls.Add(this.fontListBox1); this.htmluiControl1.Controls.Add(this.dataGrid1); this.htmluiControl1.Controls.Add(this.monthCalendar1); this.htmluiControl1.DefaultFormat.BackgroundColor = System.Drawing.SystemColors.Control; this.htmluiControl1.DefaultFormat.ForeColor = System.Drawing.SystemColors.ControlText; this.htmluiControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.htmluiControl1.ForeColor = System.Drawing.Color.Black; this.htmluiControl1.Location = new System.Drawing.Point(0, 0); this.htmluiControl1.Name = "htmluiControl1"; this.htmluiControl1.ShowTitle = false; this.htmluiControl1.Size = new System.Drawing.Size(637, 316); this.htmluiControl1.TabIndex = 0; this.htmluiControl1.Text = resources.GetString("htmluiControl1.Text"); this.htmluiControl1.PreRenderDocument += new Syncfusion.Windows.Forms.HTMLUI.PreRenderDocumentEventHandler(this.htmluiControl1_PreRenderDocument); this.htmluiControl1.LoadFinished += new System.EventHandler(this.htmluiControl1_LoadFinished); // // fontListBox1 // this.fontListBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.fontListBox1.ItemHeight = 15; this.fontListBox1.Location = new System.Drawing.Point(248, 80); this.fontListBox1.MetroColor = System.Drawing.Color.Empty; this.fontListBox1.Name = "fontListBox1"; metroColorTable1.ArrowChecked = System.Drawing.Color.Black; metroColorTable1.ArrowNormal = System.Drawing.Color.White; metroColorTable1.ArrowNormal = System.Drawing.Color.Gray; metroColorTable1.ArrowPushed = System.Drawing.Color.Black; metroColorTable1.ScrollerBackground = System.Drawing.Color.White; metroColorTable1.ThumbChecked = System.Drawing.Color.Black; metroColorTable1.ThumbNormal = System.Drawing.Color.White; metroColorTable1.ThumbNormal = System.Drawing.Color.Gray; metroColorTable1.ThumbPushed = System.Drawing.Color.Black; this.fontListBox1.ScrollMetroColorTable = metroColorTable1; this.fontListBox1.Size = new System.Drawing.Size(120, 92); this.fontListBox1.TabIndex = 4; this.fontListBox1.VisualStyle = Syncfusion.Windows.Forms.Tools.FontListBox.FontListBoxStyle.Metro; // // dataGrid1 // this.dataGrid1.AccessibleName = "DataGrid"; this.dataGrid1.AccessibleRole = System.Windows.Forms.AccessibleRole.Table; this.dataGrid1.DataMember = ""; this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText; this.dataGrid1.Location = new System.Drawing.Point(8, 176); this.dataGrid1.Name = "dataGrid1"; this.dataGrid1.Size = new System.Drawing.Size(204, 144); this.dataGrid1.TabIndex = 2; this.toolTip1.SetToolTip(this.dataGrid1, "This is a DataGrid control inside HTMLUI"); // // monthCalendar1 // this.monthCalendar1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(209)))), ((int)(((byte)(211)))), ((int)(((byte)(212))))); this.monthCalendar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.monthCalendar1.BottomHeight = 25; this.monthCalendar1.Culture = new System.Globalization.CultureInfo(""); this.monthCalendar1.DayNamesColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); this.monthCalendar1.DayNamesFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.monthCalendar1.DaysFont = new System.Drawing.Font("Verdana", 8F); this.monthCalendar1.DaysHeaderInterior = new Syncfusion.Drawing.BrushInfo(System.Drawing.SystemColors.Window); this.monthCalendar1.GridLines = Syncfusion.Windows.Forms.Grid.GridBorderStyle.None; this.monthCalendar1.HeaderHeight = 34; this.monthCalendar1.HeaderStartColor = System.Drawing.Color.White; this.monthCalendar1.HighlightColor = System.Drawing.Color.Black; this.monthCalendar1.Iso8601CalenderFormat = false; this.monthCalendar1.Location = new System.Drawing.Point(56, 8); this.monthCalendar1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); this.monthCalendar1.Name = "monthCalendar1"; this.monthCalendar1.ScrollButtonSize = new System.Drawing.Size(24, 24); this.monthCalendar1.SelectedDates = new System.DateTime[] { new System.DateTime(2013, 12, 9, 0, 0, 0, 0), new System.DateTime(2013, 12, 9, 0, 0, 0, 0) }; this.monthCalendar1.Size = new System.Drawing.Size(213, 183); this.monthCalendar1.Style = Syncfusion.Windows.Forms.VisualStyle.Metro; this.monthCalendar1.TabIndex = 1; this.monthCalendar1.WeekFont = new System.Drawing.Font("Verdana", 8F); this.monthCalendar1.WeekInterior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, System.Drawing.Color.PeachPuff, System.Drawing.Color.AntiqueWhite); // // // this.monthCalendar1.NoneButton.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.monthCalendar1.NoneButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); this.monthCalendar1.NoneButton.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.monthCalendar1.NoneButton.ForeColor = System.Drawing.Color.White; this.monthCalendar1.NoneButton.IsBackStageButton = false; this.monthCalendar1.NoneButton.Location = new System.Drawing.Point(141, 0); this.monthCalendar1.NoneButton.Size = new System.Drawing.Size(72, 25); this.monthCalendar1.NoneButton.Text = "None"; this.monthCalendar1.NoneButton.UseVisualStyle = true; // // // this.monthCalendar1.TodayButton.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.monthCalendar1.TodayButton.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(22)))), ((int)(((byte)(165)))), ((int)(((byte)(220))))); this.monthCalendar1.TodayButton.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.monthCalendar1.TodayButton.ForeColor = System.Drawing.Color.White; this.monthCalendar1.TodayButton.IsBackStageButton = false; this.monthCalendar1.TodayButton.Location = new System.Drawing.Point(0, 0); this.monthCalendar1.TodayButton.Size = new System.Drawing.Size(141, 25); this.monthCalendar1.TodayButton.Text = "Today"; this.monthCalendar1.TodayButton.UseVisualStyle = true; // // calculatorControl1 // this.calculatorControl1.AccessibleDescription = "Calculator control"; this.calculatorControl1.AccessibleName = "Calculator Control"; this.calculatorControl1.BorderStyle = System.Windows.Forms.Border3DStyle.Flat; this.calculatorControl1.ButtonStyle = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.calculatorControl1.Culture = new System.Globalization.CultureInfo("en-US"); this.calculatorControl1.DoubleValue = 0; this.calculatorControl1.ForeColor = System.Drawing.SystemColors.ControlText; this.calculatorControl1.Location = new System.Drawing.Point(208, 0); this.calculatorControl1.MetroColor = System.Drawing.SystemColors.Control; this.calculatorControl1.Name = "calculatorControl1"; this.calculatorControl1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.calculatorControl1.Size = new System.Drawing.Size(250, 300); this.calculatorControl1.TabIndex = 3; this.calculatorControl1.Text = "calculatorControl1"; this.calculatorControl1.UseVisualStyle = true; // // imageList1 // this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit; this.imageList1.ImageSize = new System.Drawing.Size(16, 16); this.imageList1.TransparentColor = System.Drawing.Color.Transparent; // // panel1 // this.panel1.BackColor = System.Drawing.Color.White; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel1.Controls.Add(this.button2); this.panel1.Controls.Add(this.button1); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(10, 42); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(639, 48); this.panel1.TabIndex = 1; // // button2 // this.button2.Anchor = System.Windows.Forms.AnchorStyles.None; this.button2.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218))))); this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button2.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button2.ForeColor = System.Drawing.Color.White; this.button2.IsBackStageButton = false; this.button2.Location = new System.Drawing.Point(378, 6); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(138, 30); this.button2.TabIndex = 1; this.button2.Text = "Load Custom Page2"; this.button2.UseVisualStyle = true; this.button2.UseVisualStyleBackColor = false; this.button2.Click += new System.EventHandler(this.button2_Click); // // button1 // this.button1.Anchor = System.Windows.Forms.AnchorStyles.None; this.button1.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro; this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218))))); this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.button1.Font = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.button1.ForeColor = System.Drawing.Color.White; this.button1.IsBackStageButton = false; this.button1.Location = new System.Drawing.Point(114, 6); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(152, 31); this.button1.TabIndex = 0; this.button1.Text = "Load Custom Page1"; this.button1.UseVisualStyle = true; this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // // mainFrameBarManager1 // #if !NETCORE this.mainFrameBarManager1.BarPositionInfo = ((System.IO.MemoryStream)(resources.GetObject("mainFrameBarManager1.BarPositionInfo"))); #endif this.mainFrameBarManager1.Bars.Add(this.bar1); this.mainFrameBarManager1.Categories.Add("File"); this.mainFrameBarManager1.Categories.Add("View"); this.mainFrameBarManager1.CurrentBaseFormType = "Syncfusion.Windows.Forms.MetroForm"; this.mainFrameBarManager1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.mainFrameBarManager1.Form = this; this.mainFrameBarManager1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.parentBarItem1, this.barItem1, this.parentBarItem2, this.barItem2 }); this.mainFrameBarManager1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(110)))), ((int)(((byte)(218))))); this.mainFrameBarManager1.ResetCustomization = false; this.mainFrameBarManager1.Style = Syncfusion.Windows.Forms.VisualStyle.Metro; // // bar1 // this.bar1.BarName = "menu"; this.bar1.Caption = "Menu"; this.bar1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.parentBarItem1, this.parentBarItem2 }); this.bar1.Manager = this.mainFrameBarManager1; // // parentBarItem1 // this.parentBarItem1.BarName = "parentBarItem1"; this.parentBarItem1.CategoryIndex = 0; this.parentBarItem1.ID = "File"; this.parentBarItem1.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.barItem1 }); this.parentBarItem1.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(110)))), ((int)(((byte)(218))))); this.parentBarItem1.ShowToolTipInPopUp = false; this.parentBarItem1.SizeToFit = true; this.parentBarItem1.Text = "File"; // // barItem1 // this.barItem1.BarName = "barItem1"; this.barItem1.CategoryIndex = 0; this.barItem1.ID = "Exit"; this.barItem1.ShowToolTipInPopUp = false; this.barItem1.SizeToFit = true; this.barItem1.Text = "Exit"; this.barItem1.Click += new System.EventHandler(this.menuItem3_Click); // // parentBarItem2 // this.parentBarItem2.BarName = "parentBarItem2"; this.parentBarItem2.CategoryIndex = 1; this.parentBarItem2.ID = "View"; this.parentBarItem2.Items.AddRange(new Syncfusion.Windows.Forms.Tools.XPMenus.BarItem[] { this.barItem2 }); this.parentBarItem2.MetroColor = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(110)))), ((int)(((byte)(218))))); this.parentBarItem2.ShowToolTipInPopUp = false; this.parentBarItem2.SizeToFit = true; this.parentBarItem2.Text = "View"; // // barItem2 // this.barItem2.BarName = "barItem2"; this.barItem2.CategoryIndex = 1; this.barItem2.ID = "HTML"; this.barItem2.ShowToolTipInPopUp = false; this.barItem2.SizeToFit = true; this.barItem2.Text = "HTML"; this.barItem2.Click += new System.EventHandler(this.menuItem5_Click); // // gradientPanel1 // this.gradientPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.gradientPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.gradientPanel1.Controls.Add(this.htmluiControl1); this.gradientPanel1.Location = new System.Drawing.Point(10, 93); this.gradientPanel1.Name = "gradientPanel1"; this.gradientPanel1.Size = new System.Drawing.Size(639, 318); this.gradientPanel1.TabIndex = 4; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackColor = System.Drawing.Color.White; this.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226))))); this.ClientSize = new System.Drawing.Size(659, 415); this.Controls.Add(this.gradientPanel1); this.Controls.Add(this.panel1); this.DropShadow = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimumSize = new System.Drawing.Size(671, 451); this.Name = "Form1"; this.Padding = new System.Windows.Forms.Padding(10); this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Custom Controls"; this.Load += new System.EventHandler(this.Form1_Load); ((System.ComponentModel.ISupportInitialize)(this.htmluiControl1)).EndInit(); this.htmluiControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.monthCalendar1)).EndInit(); this.panel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.mainFrameBarManager1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).EndInit(); this.gradientPanel1.ResumeLayout(false); this.ResumeLayout(false); }