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(); }
public PlanningPopUp(BoveloUser user, Task task) { this.user = user; this.task = task; userTable = DBConnection.selectAllUser(); InitializeComponent(); }
public OrderPage(AvailableBicycle bicycle, BoveloUser user, Client client) { this.bicycle = bicycle; this.user = user; this.client = client; InitializeComponent(); }
public Catalog(BoveloUser user, Client client) { this.user = user; if (client != null) { this.client = client; } availableBikeList = DBConnection.SelectAvailableBikes(); InitializeComponent(); }
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); }
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); }
//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(); }
public Planning(BoveloUser user) { this.user = user; taskDataTable = DBConnection.SelectAllTasks(); InitializeComponent(); }
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(); }
public Stock(BoveloUser user) { this.user = user; stockDataTable = DBConnection.selectAllAssemblyParts(); InitializeComponent(); }
public MenusSelectionPage(BoveloUser user) { this.user = user; InitializeComponent(); }
public Cart(BoveloUser user, Client client) { this.user = user; this.client = client; InitializeComponent(); }
public Newclient(BoveloUser user) { this.user = user; InitializeComponent(); }
public ClientIdentification(BoveloUser user, Client client) { this.user = user; this.client = client; InitializeComponent(); }