private void OrdersListForm_Load(object sender, EventArgs e) { UsingDB usingDB = new UsingDB(); List <OrderModel> orders = usingDB.GetOrders("FromAeDB"); dataGridView1.DataSource = orders; }
public void AdminsStickers_Load(object sender, EventArgs e) { UsingDB usingDB = new UsingDB(); List <StickerModel> stickers = usingDB.GetStickers("FromAeDB"); dataGridView1.DataSource = stickers; dataGridView1.Columns["Id"].Visible = false; }
private void txbx_reg_btn_Click(object sender, EventArgs e) { // adding user information to database from registration form // UsingDB usingDB = new UsingDB(); usingDB.ConnectDB("FromAeDB"); string values = $"'{txbx_reg_name.Text}','{txbx_reg_surname.Text}','{txbx_reg_email.Text}','{txbx_reg_password.Text}'"; usingDB.InsertToDB("Users", values); usingDB.DisposeSeans(); MessageBox.Show("Qeydiyyatınız uğurla yekulnaşdı" + "\n" + "Zəhmət olmasa sistemə daxil olun."); }
private void EditStickerForm_Load(object sender, EventArgs e) { // writing data to text boxes for edit // usingDB = new UsingDB(); List <StickerModel> stickers = usingDB.GetStickerDataEdit("FromAeDB"); txbx_name.Text = stickers[0].Product_Name.ToString(); txbx_price.Text = stickers[0].Product_Price.ToString(); txbx_model.Text = stickers[0].Model.ToString(); txbx_color.Text = stickers[0].Color.ToString(); txbx_sizes.Text = stickers[0].Size.ToString(); txbx_cards_count.Text = stickers[0].Cards_Count.ToString(); txbx_inner_storage.Text = stickers[0].Inner_Storage.ToString(); txbx_ram.Text = stickers[0].Ram.ToString(); txbx_back_camera.Text = stickers[0].Back_Camera.ToString(); txbx_front_camera.Text = stickers[0].Front_Camera.ToString(); txbx_battery_volume.Text = stickers[0].Battery_Volume.ToString(); }
private void button1_Click(object sender, EventArgs e) { // save edited data and send it to database // usingDB = new UsingDB(); usingDB.ConnectDB("FromAeDB"); usingDB.InsertEditProData(txbx_name.Text, txbx_price.Text); usingDB.InsertEditSpeData(txbx_model.Text, txbx_color.Text, txbx_sizes.Text, txbx_cards_count.Text, txbx_inner_storage.Text, txbx_ram.Text, txbx_back_camera.Text, txbx_front_camera.Text, txbx_battery_volume.Text); usingDB.DisposeSeans(); MessageBox.Show("Məlumat yadda saxlanıldı"); AdminsStickers adminsStickers = new AdminsStickers(); adminsStickers.Visible = false; adminsStickers.Show(); //adminsStickers.AdminsStickers_Load(sender, e); this.Visible = false; }
private void ProductDetails_Load(object sender, EventArgs e) { UsingDB usingDB = new UsingDB(); // getting form user name and surname // lbl_form_user.Text = Form_User.Name + " " + Form_User.Surname; // getting chosed product all data when ream more button cliced // int productID = GetID.Id; string procedure = $"GetProductDetails {productID}"; List <ProductSpecification> chosedProduct = usingDB.GetProductDetails("FromAeDB", procedure); usingDB.DisposeSeans(); // gets stickers photo directory // string directory = Directory.GetCurrentDirectory(); DirectoryInfo drInfo = new DirectoryInfo(directory); string folderDirectory = drInfo.Parent.Parent.Parent.FullName + "/images/"; // fill all product data to order control // OrderProductControl order = new OrderProductControl(); order.product_photo.ImageLocation = folderDirectory + chosedProduct[0].Product_Photo; order.lbl_pro_name.Text = chosedProduct[0].Product_Name.ToString(); order.lbl_pro_price.Text = chosedProduct[0].Product_Price.ToString(); order.lbl_model.Text = chosedProduct[0].Model.ToString(); order.lbl_color.Text = chosedProduct[0].Color.ToString(); order.lbl_size.Text = chosedProduct[0].Size.ToString(); order.lbl_card_count.Text = chosedProduct[0].Cards_Count.ToString(); order.lbl_inner_storage.Text = chosedProduct[0].Inner_Storage.ToString(); order.lbl_ram.Text = chosedProduct[0].Ram.ToString(); order.lbl_front_camera.Text = chosedProduct[0].Front_Camera.ToString(); order.lbl_back_camera.Text = chosedProduct[0].Back_Camera.ToString(); order.lbl_battery_volume.Text = chosedProduct[0].Battery_Volume.ToString(); order.Location = new Point(5, 25); productBox.Controls.Add(order); }
private void txbx_log_btn_Click(object sender, EventArgs e) { // checking user details for login // UsingDB usingDB = new UsingDB(); List <UserModel> users = usingDB.GetUser("FromAeDB"); usingDB.DisposeSeans(); bool check = false; foreach (var user in users) { if (user.Email == txbx_log_email.Text && user.Password == txbx_log_password.Text) { check = true; Form_User.UserId = Convert.ToInt32(user.UserId); Form_User.Name = user.Name; Form_User.Surname = user.Surname; break; } else { check = false; } } ; if (check == true) { MessageBox.Show("Sistemə daxil oldunuz."); ProductDetails pro_details = new ProductDetails(); pro_details.Show(); this.Visible = false; } else { MessageBox.Show("Email yaxud şifrə yanlışdır."); } }