Example #1
0
 public IssuesUserControl(HomeUserControl home, int issueCode) : this(home)
 {
     foreach (ListViewItem item in issuesListView.Items)
     {
         item.Selected = item.Name == issueCode.ToString();
     }
 }
Example #2
0
 public ClientsUserControl(HomeUserControl home, int clientCode) : this(home)
 {
     foreach (ListViewItem item in clientListView.Items)
     {
         item.Selected = item.Name == clientCode.ToString();
     }
 }
Example #3
0
 public StocksUserControl(HomeUserControl home, int code) : this(home)
 {
     foreach (ListViewItem item in productListView.Items)
     {
         item.Selected = item.Name == code.ToString();
     }
 }
Example #4
0
        public MapUserControl(HomeUserControl home)
        {
            InitializeComponent();
            LoginTools.CheckConnection();
            HomeUserControl = home;
            _db             = new DataBase();

            _cursorAction = CursorAction.Default;
            _moving       = false;
            _offsetMoving = new Point();

            FillListsControlsDromDb();

            LoadLocationsFromDb();

            if (!_db.App.Any(m => m.Fond_Image != null))
            {
                _mode = MapMode.LoadImage;
            }
            else
            {
                MemoryStream ms        = new MemoryStream(_db.App.FirstOrDefault().Fond_Image);
                var          imageJpeg = Image.FromStream(ms);
                _image = new Bitmap(imageJpeg);
                ms.Close();
                pictureBox.Image = _image;
                _mode            = MapMode.Normal;
            }
            ChangeMode(_mode);
        }
Example #5
0
 public EmployeesUserControl(HomeUserControl home, int employeeCode) : this(home)
 {
     foreach (ListViewItem item in employeesListView.Items)
     {
         item.Selected = item.Name == employeeCode.ToString();
     }
 }
Example #6
0
        public StatsUserControl(HomeUserControl homeUserControl) : base(homeUserControl)
        {
            InitializeComponent();
            appBarTitle.Text = Resources.stats_management;

            UpdateListViews();
            HandleResize();
            yearPicker.MinDate = DateTime.Now.AddYears(-10);
            yearPicker.MaxDate = DateTime.Now.Date;
            yearPicker.Enabled = true;
        }
Example #7
0
        public ProvidersUserControl(HomeUserControl homeUserControl) : base(homeUserControl)
        {
            InitializeComponent();
            appBarTitle.Text = Resources.provider_management;

            providerListView.View = View.Details;
            providerListView.Columns.Add("Nom du fournisseur", -2);
            providerListView.Columns.Add("Adresse mail du fournisseur", -2);

            UpdateProvidersListView();
            HandleResize();
            InitPermissions();
        }
Example #8
0
        public ClientsUserControl(HomeUserControl home) : base(home)
        {
            InitializeComponent();
            appBarTitle.Text = Resources.clients_management;

            clientListView.View = View.Details;
            clientListView.Columns.Add("Nom");
            clientListView.Columns.Add("Prénom");
            clientListView.Columns.Add("Email");

            UpdateClientListView();
            HandleResize();
            InitPermissions();
        }
Example #9
0
 public ManagementUserControl(HomeUserControl homeUserControl)
 {
     InitializeComponent();
     HomeUserControl = homeUserControl;
     Db         = new DataBase();
     UserRights = Db.Personne.First(
         a => a.Code_Personne == LoginTools.Employee.Personne.Code_Personne).Droit.ToList();
     if (LoginTools.Employee != null)
     {
         userNameButton.Text = Resources.hello_user
                               + LoginTools.Employee.Personne.Prenom_Personne
                               + Resources.one_space + LoginTools.Employee.Personne.Nom_Personne;
     }
 }
Example #10
0
 private void MostAskedLocationsListView_DoubleClick(object sender, EventArgs e)
 {
     if (mostAskedlocationsListView.SelectedItems.Count > 0)
     {
         if (UserRights.Any(d => d.Libelle_Droit == "readMap"))
         {
             int code = int.Parse(mostAskedlocationsListView.SelectedItems[0].Name);
             HomeUserControl.StartLocationsFromStats(code);
         }
         else
         {
             MessageBox.Show(Resources.denied_access);
         }
     }
 }
Example #11
0
 private void BestClientsListView_DoubleClick(object sender, EventArgs e)
 {
     if (bestClientsListView.SelectedItems.Count > 0)
     {
         if (UserRights.Any(d => d.Libelle_Droit == "readClients"))
         {
             int code = int.Parse(bestClientsListView.SelectedItems[0].Name);
             code = Db.Client.First(i => i.Code_Personne == code).Code_Personne;
             HomeUserControl.StartClientsFromStats(code);
         }
         else
         {
             MessageBox.Show(Resources.denied_access);
         }
     }
 }
Example #12
0
 private void MostAskedProductsListView_DoubleClick(object sender, EventArgs e)
 {
     if (mostAskedProductsListView.SelectedItems.Count > 0)
     {
         if (UserRights.Any(d => d.Libelle_Droit == "readStocks"))
         {
             var code = int.Parse(mostAskedProductsListView.SelectedItems[0].Name);
             code = Db.Produit.First(i => i.Code_Produit == code).Code_Produit;
             HomeUserControl.StartProductsFromStats(code);
         }
         else
         {
             MessageBox.Show(Resources.denied_access);
         }
     }
 }
Example #13
0
        public IssuesUserControl(HomeUserControl home) : base(home)
        {
            InitializeComponent();
            appBarTitle.Text = Resources.issues_management;

            issuesListView.View = View.Details;
            issuesListView.Columns.Add("Etat");
            issuesListView.Columns.Add("Type d'incident");
            issuesListView.Columns.Add("Description");
            issuesListView.Columns.Add("Date");

            var imageList = new ImageList();

            imageList.Images.Add("pending", Resources.ic_issue_pending);
            imageList.Images.Add("done", Resources.ic_issue_done);
            imageList.ImageSize           = new System.Drawing.Size(20, 20);
            issuesListView.SmallImageList = imageList;

            UpdateIssuesListView();
            HandleResize();
            InitPermissions();
        }
Example #14
0
        public StocksUserControl(HomeUserControl home) : base(home)
        {
            InitializeComponent();
            appBarTitle.Text = Resources.product_management;
            appBarTitle.Text = Resources.product_management;

            productListView.View = View.Details;
            productListView.Columns.Add("Etat");
            productListView.Columns.Add("Produit");
            productListView.Columns.Add("Quantité");

            var imageList = new ImageList();

            imageList.Images.Add("low", Resources.ic_stock_low);
            imageList.Images.Add("empty", Resources.ic_stock_empty);
            imageList.ImageSize            = new Size(20, 20);
            productListView.SmallImageList = imageList;

            UpdateProductListView();
            HandleResize();
            InitPermissions();
        }
Example #15
0
 private void MostCommonIssuesListView_DoubleClick(object sender, EventArgs e)
 {
     if (mostCommonIssueslistView.SelectedItems.Count > 0)
     {
         if (UserRights.Any(d => d.Libelle_Droit == "readIssues"))
         {
             if (mostCommonIssueslistView.SelectedItems[0].SubItems[2].Text != 0.ToString())
             {
                 int codeType = int.Parse(mostCommonIssueslistView.SelectedItems[0].Name);
                 int code     = Db.Incident.First(i => i.Code_Type == codeType).Code_Incident;
                 HomeUserControl.StartIssuesFromStats(code);
             }
             else
             {
                 MessageBox.Show(Resources.no_issue_corresponding);
             }
         }
         else
         {
             MessageBox.Show(Resources.denied_access);
         }
     }
 }
Example #16
0
 private void UserNameButton_Click(object sender, EventArgs e)
 {
     HomeUserControl.StartEmployeesFromTitleBar(this);
 }
Example #17
0
 private void BackArrow_Click(object sender, EventArgs e)
 {
     HomeUserControl.InitPermissions();
     HomeUserControl.Window.WindowPanel.Controls.Add(HomeUserControl);
     HomeUserControl.Window.WindowPanel.Controls.Remove(this);
 }
Example #18
0
 public MapUserControl(HomeUserControl home, int locationCode) : this(home)
 {
     SelectFromStats(locationCode);
 }