Пример #1
0
        public StockDetail(BoveloUser user, StockInfo stockInfo)
        {
            this.user      = user;
            this.stockInfo = stockInfo;

            InitializeComponent();
            string nameText  = this.stockInfo.name.First().ToString().ToUpper() + this.stockInfo.name.Substring(1);
            string colorText = "";

            if (this.stockInfo.color != "/")
            {
                colorText = this.stockInfo.color.First().ToString().ToUpper() + this.stockInfo.color.Substring(1);
            }
            string sizeText = "";

            if (this.stockInfo.size != "/")
            {
                sizeText = this.stockInfo.size.First().ToString().ToUpper() + this.stockInfo.size.Substring(1);
            }
            labelNameColorSize.Text = nameText + " " + colorText + " " + sizeText;
            labelStockNumber.Text   = this.stockInfo.stock.ToString();
            labelMinimumNumber.Text = this.stockInfo.minimum.ToString();
            labelBuyNumber.Text     = this.stockInfo.needed.ToString();

            labelOrderNumber.Text   = this.stockInfo.ordered.ToString();
            labelBalanceNumber.Text = this.stockInfo.balance.ToString();
        }
Пример #2
0
 public PlanningPopUp(BoveloUser user, Task task)
 {
     this.user = user;
     this.task = task;
     userTable = DBConnection.selectAllUser();
     InitializeComponent();
 }
Пример #3
0
 public OrderPage(AvailableBicycle bicycle, BoveloUser user, Client client)
 {
     this.bicycle = bicycle;
     this.user    = user;
     this.client  = client;
     InitializeComponent();
 }
Пример #4
0
 public Catalog(BoveloUser user, Client client)
 {
     this.user = user;
     if (client != null)
     {
         this.client = client;
     }
     availableBikeList = DBConnection.SelectAvailableBikes();
     InitializeComponent();
 }
Пример #5
0
        public static void CreateHeader(BoveloBaseForm form, Bitmap image, BoveloUser user)
        {
            CreateHeader(form, image);
            Label LabelUserName = new Label();

            LabelUserName.Location = new Point(650, 20);
            LabelUserName.AutoSize = true;
            LabelUserName.Text     = "Logged in as " + user.firstname + " " + user.lastname;
            form.Controls.Add(LabelUserName);
        }
Пример #6
0
        public static void CreateHeader(BoveloBaseForm form, Bitmap image, BoveloUser user, Client client)
        {
            CreateHeader(form, image, user);
            Label LabelClientName = new Label();

            LabelClientName.Location = new Point(650, 50);
            LabelClientName.AutoSize = true;
            if (client != null)
            {
                LabelClientName.Text   = "Client :" + client.name + " " + client.address;
                LabelClientName.Click += new EventHandler(ButtonToCart_Click);
            }
            else
            {
                LabelClientName.Text   = "No client logged, click here to select one.";
                LabelClientName.Click += new EventHandler(ButtonClient_Click);
            }
            form.Controls.Add(LabelClientName);
        }
Пример #7
0
        //Select statement
        public BoveloUser SelectUser(int id, string password)
        {
            string     query = "SELECT * FROM AppUser WHERE id ='" + id + "' AND password ='******'";
            BoveloUser user;

            //Open connection
            if (this.OpenConnection() == true)
            {
                //Create Command
                MySqlCommand cmd = new MySqlCommand(query, connection);
                //Create a data reader and Execute the command
                MySqlDataReader dataReader = cmd.ExecuteReader();

                if (dataReader.HasRows)
                {
                    dataReader.Read();
                    string firstname   = (string)dataReader["firstname"];
                    string lastname    = (string)dataReader["userName"];
                    int    accessLevel = (int)dataReader["jobTitle"];

                    user = new BoveloUser(id, password, firstname, lastname, accessLevel);
                    dataReader.Close();
                    this.CloseConnection();
                    return(user);
                }
                else
                {
                    MessageBox.Show("Good Connection");
                    dataReader.Close();
                    this.CloseConnection();
                    return(null);
                }
            }
            else
            {
                MessageBox.Show("No connection to database");
                return(null);
            }
        }
 public OrdersOverviewPage(BoveloUser user)
 {
     this.user      = user;
     orderDataTable = DBConnection.selectAllOrders();
     InitializeComponent();
 }
Пример #9
0
 public Planning(BoveloUser user)
 {
     this.user     = user;
     taskDataTable = DBConnection.SelectAllTasks();
     InitializeComponent();
 }
Пример #10
0
 public EditStock(BoveloUser user, StockInfo stockInfo)
 {
     this.user      = user;
     this.stockInfo = stockInfo;
     InitializeComponent();
 }
 public StockDetailAddOrder(BoveloUser user, StockInfo stockInfo)
 {
     this.user      = user;
     this.stockInfo = stockInfo;
     InitializeComponent();
 }
Пример #12
0
 public Stock(BoveloUser user)
 {
     this.user      = user;
     stockDataTable = DBConnection.selectAllAssemblyParts();
     InitializeComponent();
 }
Пример #13
0
 public MenusSelectionPage(BoveloUser user)
 {
     this.user = user;
     InitializeComponent();
 }
Пример #14
0
 public Cart(BoveloUser user, Client client)
 {
     this.user   = user;
     this.client = client;
     InitializeComponent();
 }
Пример #15
0
 public Newclient(BoveloUser user)
 {
     this.user = user;
     InitializeComponent();
 }
 public ClientIdentification(BoveloUser user, Client client)
 {
     this.user   = user;
     this.client = client;
     InitializeComponent();
 }