Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 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;
     }
 }