private void Vnesi_Hrana_Load(object sender, EventArgs e) { this.Width = 1000; this.Height = 900; this.Text = "Внеси продавница"; this.BackColor = Color.FromArgb(255, 66, 66); this.ControlBox = false; Label lbnaslov = new Label(); LabelZ lbnaslov1 = new LabelZ(300, 20, 300, 18, "Внеси во продавница", lbnaslov); lbnaslov.Font = new Font("Roboto", 18, FontStyle.Underline); Controls.Add(lbnaslov); RadioButtonZ rb = new RadioButtonZ(30, 70, 150, 40, "Класа", 12, rbklasa); rbklasa.Click += new EventHandler(this.faktiviraj); Controls.Add(rbklasa); RadioButtonZ rb1 = new RadioButtonZ(30, 120, 150, 40, "Подкласа", 12, rbpodklasa); rbpodklasa.Click += new EventHandler(this.faktiviraj); Controls.Add(rbpodklasa); RadioButtonZ rb2 = new RadioButtonZ(30, 170, 150, 40, "Нов Артикал", 12, rbartikal); rbartikal.Click += new EventHandler(this.faktiviraj); Controls.Add(rbartikal); //ButtonZ bt = new ButtonZ(80, 220, "OK", btvnesi); //btvnesi.Click += new EventHandler(this.faktiviraj); //Controls.Add(btvnesi); gbklasa.Width = 300; gbklasa.Height = 300; gbklasa.ForeColor = Color.White; gbklasa.BackColor = Color.FromArgb(255, 66, 66); gbklasa.Text = "Класа"; gbklasa.Location = new Point(350, 70); gbklasa.Enabled = false; Controls.Add(gbklasa); Label lbklasa_ime = new Label(); LabelZ lbklasa = new LabelZ(70, 30, 180, 14, "Име на класата", lbklasa_ime); gbklasa.Controls.Add(lbklasa_ime); TextBoxZ vnesi_klasa = new TextBoxZ(50, 70, tbvnesi_klasa); gbklasa.Controls.Add(tbvnesi_klasa); ButtonZ btvnesiklasa = new ButtonZ(100, 100, "OK", btvnesi_klasa); btvnesi_klasa.Click += new EventHandler(this.fvnesi); gbklasa.Controls.Add(btvnesi_klasa); gbpodklasa.Width = 300; gbpodklasa.Height = 300; gbpodklasa.ForeColor = Color.White; gbpodklasa.BackColor = Color.FromArgb(255, 66, 66); gbpodklasa.Text = "Подкласа"; gbpodklasa.Location = new Point(660, 70); gbpodklasa.Enabled = false; Controls.Add(gbpodklasa); // Label lbizbor = new Label(); // LabelZ lbizbor_klasa = new LabelZ(20, 20, 180, 14, "Изберете класа", lbizbor); //gbpodklasa.Controls.Add(lbizbor); // ComboBoxZ cbizbor = new ComboBoxZ(20, 60, 100, 40, cbizbor_klasa); //gbpodklasa.Controls.Add(cbizbor_klasa); Label lbime_podklasa = new Label(); LabelZ lbime_klasa = new LabelZ(70, 30, 180, 14, "Име на подкласа", lbime_podklasa); gbpodklasa.Controls.Add(lbime_podklasa); TextBoxZ ime_podklasa = new TextBoxZ(50, 70, tbime_podklasa); gbpodklasa.Controls.Add(tbime_podklasa); ButtonZ vnesi_podklasa = new ButtonZ(100, 100, "OK", btvnesi_podklasa); btvnesi_podklasa.Click += new EventHandler(this.fvnesi); gbpodklasa.Controls.Add(btvnesi_podklasa); gbartikal.Width = 300; gbartikal.Height = 400; gbartikal.ForeColor = Color.White; gbartikal.BackColor = Color.FromArgb(255, 66, 66); gbartikal.Text = "Нов Артикал"; gbartikal.Location = new Point(500, 380); gbartikal.Enabled = false; Controls.Add(gbartikal); Label lbpodklasa = new Label(); LabelZ lbpod_klasa = new LabelZ(30, 30, 180, 10, "Изберете подкласа", lbpodklasa); gbartikal.Controls.Add(lbpodklasa); ComboBoxZ cbizborpodklasa = new ComboBoxZ(30, 60, 150, 40, cbizbor_podklasa); gbartikal.Controls.Add(cbizbor_podklasa); Label lbime_artikal = new Label(); LabelZ lb_ime_artikal = new LabelZ(30, 90, 110, 10, "Внесете име", lbime_artikal); gbartikal.Controls.Add(lbime_artikal); TextBoxZ tb_ime_artikal = new TextBoxZ(30, 120, tbime_artikal); gbartikal.Controls.Add(tbime_artikal); Label lb_cena_artikal = new Label(); LabelZ lbcena_artikal = new LabelZ(30, 150, 150, 10, "Внесете Цена", lb_cena_artikal); gbartikal.Controls.Add(lb_cena_artikal); TextBoxZ tb_cena_artikal = new TextBoxZ(30, 180, tbcena_artikal); gbartikal.Controls.Add(tbcena_artikal); Label lb_gramaza_artikal = new Label(); LabelZ lbgramaza_artikal = new LabelZ(30, 210, 180, 10, "Внесете грамажа", lb_gramaza_artikal); gbartikal.Controls.Add(lb_gramaza_artikal); TextBoxZ tb_gramaza_artikal = new TextBoxZ(30, 240, tbgramaza_artikal); gbartikal.Controls.Add(tbgramaza_artikal); Label lb_kolicina_artikal = new Label(); LabelZ lbkolicina_artikal = new LabelZ(30, 280, 180, 10, "Внесете количина", lb_kolicina_artikal); gbartikal.Controls.Add(lb_kolicina_artikal); TextBoxZ tb_kolicina_artikal = new TextBoxZ(30, 310, tbkolicina_artikal); gbartikal.Controls.Add(tbkolicina_artikal); ButtonZ btartikalvnesi = new ButtonZ(80, 350, "OK", bt_vnesiartikal); bt_vnesiartikal.Click += new EventHandler(this.fvnesi); gbartikal.Controls.Add(bt_vnesiartikal); ButtonZ btizlez = new ButtonZ(80, 260, "Излез", bt_izlez); bt_izlez.Click += new EventHandler(this.fizlez); Controls.Add(bt_izlez); /* conn.Open(); * SqlCommand command = conn.CreateCommand(); * command.CommandType = CommandType.Text; * command.CommandText = "select Ime from Klasa"; * command.ExecuteNonQuery(); * DataTable table = new DataTable(); * SqlDataAdapter dataAdapter = new SqlDataAdapter(command); * dataAdapter.Fill(table); * foreach (DataRow dr in table.Rows) * { * cbizbor_klasa.Items.Add(dr["Ime"].ToString()); * } * conn.Close(); */ conn.Open(); SqlCommand command = conn.CreateCommand(); SqlDataAdapter dataAdapter = new SqlDataAdapter(command); SqlCommand cmd = conn.CreateCommand(); command.CommandType = CommandType.Text; command.CommandText = "select id_podklasa,Ime from Podklasa where id_klasa = '1' "; command.ExecuteNonQuery(); DataTable tb = new DataTable(); SqlDataAdapter dataAda = new SqlDataAdapter(cmd); dataAdapter.Fill(tb); foreach (DataRow dr in tb.Rows) { cbizbor_podklasa.Items.Add(dr["Ime"].ToString()); } conn.Close(); }
private void Izveshtaj_Load(object sender, EventArgs e) { this.Width = 640; this.Height = 350; this.Text = "Извештај"; this.BackColor = Color.FromArgb(244, 66, 66); this.ControlBox = false; RadioButtonZ rbvraboten = new RadioButtonZ(20, 50, 150, 40, "Вработен", 10, rbVraboten); rbVraboten.Click += new EventHandler(this.fprikazi); Controls.Add(rbVraboten); RadioButtonZ rbklient = new RadioButtonZ(20, 100, 150, 40, "Клиент", 10, rbKlient); rbKlient.Click += new EventHandler(this.fprikazi); Controls.Add(rbKlient); RadioButtonZ rbartikal = new RadioButtonZ(20, 150, 150, 40, "Артикал", 10, rbArtikal); rbArtikal.Click += new EventHandler(this.fprikazi); Controls.Add(rbArtikal); PictureBox logo = new PictureBox(); logo.Width = 300; logo.Height = 150; logo.SizeMode = PictureBoxSizeMode.StretchImage; logo.Location = new Point(300, 50); logo.ImageLocation = "C:\\Users\\Mihajlo\\Desktop\\Proekt\\logo.png"; Controls.Add(logo); ButtonZ btizlez = new ButtonZ(20, 200, "Излез", bt); bt.Click += new EventHandler(this.fizlez); Controls.Add(bt); /*ComboBoxZ cb_prikazi = new ComboBoxZ(20, 50, 150, 40, cbprikazi); * cbprikazi.Items.Add("Vraboten"); * cbprikazi.Items.Add("Klient"); * cbprikazi.Items.Add("Artikal"); * cbprikazi.Click += new EventHandler(this.fprikazi); * Controls.Add(cbprikazi); * * dgvVraboten.Visible = false; * } * public void fprikazi(object sender, EventArgs e) * { * if (cbprikazi.SelectedIndex == 1) * { * dgvVraboten.Visible = true; * * dgvVraboten.Width = 555; * dgvVraboten.Height = 140; * dgvVraboten.Location = new Point(200, 20); * dgvVraboten.ReadOnly = true; * dgvVraboten.DataSource = bindingSource; * * conn.Open(); * dataAdapter = new SqlDataAdapter("select id_vraboten AS РеденБрој, ime AS Име, prezime AS Презиме,telefon AS Телефон, EMBG AS ЕМБГ,mail AS Емаил from Vraboten", conn); * SqlCommandBuilder cmd = new SqlCommandBuilder(dataAdapter); * DataTable table1 = new DataTable(); * table1.Locale = System.Globalization.CultureInfo.InvariantCulture; * dataAdapter.Fill(table1); * dgvVraboten.DataSource = table1; * Controls.Add(dgvVraboten); * conn.Close(); * } * }*/ }
private void Izmeni_Klient_Load(object sender, EventArgs e) { this.Width = 1200; this.Height = 500; this.BackColor = Color.FromArgb(255, 66, 66); this.Text = "Измени клиент"; this.ControlBox = false; Label lbn = new Label(); LabelZ lbnaslove = new LabelZ(100, 20, 280, 14, "Измени Клиент", lbn); lbn.Font = new Font("Roboto", 14, FontStyle.Underline); Controls.Add(lbn); dgvKlient.Width = 650; dgvKlient.Height = 200; dgvKlient.Location = new Point(450, 70); dgvKlient.BackgroundColor = Color.FromArgb(255, 66, 66); dgvKlient.DataSource = bindingSource; conn.Open(); dataAdapter = new SqlDataAdapter("select id_klient AS РеденБрој, Ime AS Име, Prezime AS Презиме,Telefon AS Телефон, EMBG AS ЕМБГ,Mail AS Емаил from Klient", conn); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter); DataTable table = new DataTable(); table.Locale = System.Globalization.CultureInfo.InvariantCulture; dataAdapter.Fill(table); dgvKlient.DataSource = table; Controls.Add(dgvKlient); conn.Close(); /* Label lb1 = new Label(); * LabelZ lbIme = new LabelZ(20,70,180,12,"Изменете Име",lb1); * Controls.Add(lb1); * * TextBoxZ tbIme = new TextBoxZ(210,70,tb1); * Controls.Add(tb1); */ Label lb2 = new Label(); LabelZ lbPrezime = new LabelZ(20, 120, 180, 12, "Изменете Презиме", lb2); Controls.Add(lb2); TextBoxZ tbPrezime = new TextBoxZ(210, 120, tb2); tb2.Enabled = false; Controls.Add(tb2); RadioButtonZ rb1 = new RadioButtonZ(420, 110, 15, 15, "", 10, rbPrezime); rbPrezime.Click += new EventHandler(this.fizmeni); Controls.Add(rbPrezime); Label lb3 = new Label(); LabelZ lbTelefon = new LabelZ(20, 170, 180, 12, "Изменете Телефон", lb3); Controls.Add(lb3); TextBoxZ tbTelefon = new TextBoxZ(210, 170, tb3); tb3.Enabled = false; Controls.Add(tb3); RadioButtonZ rb2 = new RadioButtonZ(420, 160, 15, 15, "", 10, rbTelefon); rbTelefon.Click += new EventHandler(this.fizmeni); Controls.Add(rbTelefon); /* Label lb4 = new Label(); * LabelZ lbembg = new LabelZ(20,220,180,12,"Изменете ЕМБГ",lb4); * Controls.Add(lb4); * * TextBoxZ tbembg = new TextBoxZ(210,220,tb4); * Controls.Add(tb4); */ Label lb5 = new Label(); LabelZ lbemail = new LabelZ(20, 220, 180, 12, "Изменете Е-маил", lb5); Controls.Add(lb5); TextBoxZ tbe_email = new TextBoxZ(210, 220, tb5); tb5.Enabled = false; Controls.Add(tb5); RadioButtonZ rb3 = new RadioButtonZ(420, 210, 15, 15, "", 10, rbmail); rbmail.Click += new EventHandler(this.fizmeni); Controls.Add(rbmail); ButtonZ btIzmeni = new ButtonZ(170, 320, "Измени", bt); bt.Font = new Font("Roboto", 10, FontStyle.Regular); bt.Click += new EventHandler(this.fizmeniBAza); Controls.Add(bt); ButtonZ btizlez = new ButtonZ(280, 320, "Излез", bt1); bt1.Font = new Font("Roboto", 10, FontStyle.Regular); bt1.Click += new EventHandler(this.fizlez); Controls.Add(bt1); Label lb1 = new Label(); LabelZ lb_broj = new LabelZ(420, 320, 250, 10, "Внесете реден број:", lb1); Controls.Add(lb1); TextBoxZ tb_broj = new TextBoxZ(420, 360, tb1); Controls.Add(tb1); }
private void Izmeni_Vraboten_Load(object sender, EventArgs e) { this.Width = 1300; this.Height = 500; this.BackColor = Color.FromArgb(255, 66, 66); this.Text = "Измени вработен"; this.ControlBox = false; Label lbn = new Label(); LabelZ lbnaslove = new LabelZ(100, 20, 280, 14, "Изменување на Вработен", lbn); lbn.Font = new Font("Roboto", 14, FontStyle.Underline); Controls.Add(lbn); dgvVraboten.Width = 800; dgvVraboten.Height = 200; dgvVraboten.Location = new Point(450, 70); dgvVraboten.DataSource = bindingSource; conn.Open(); dataAdapter = new SqlDataAdapter("select id_vraboten AS РеденБрој, korisnicko_ime AS КорисничкоИме, ime AS Име, prezime AS Презиме,lozinka AS Лозинка,telefon AS Телефон, EMBG AS ЕМБГ,mail AS Емаил from Vraboten", conn); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(dataAdapter); DataTable table = new DataTable(); table.Locale = System.Globalization.CultureInfo.InvariantCulture; dataAdapter.Fill(table); dgvVraboten.DataSource = table; Controls.Add(dgvVraboten); conn.Close(); Label lb = new Label(); LabelZ lbkorisnicko_ime = new LabelZ(20, 70, 180, 12, "Измени Корисничко име", lb); Controls.Add(lb); TextBoxZ tbkorisnicko_ime = new TextBoxZ(210, 70, tb); tb.Enabled = false; Controls.Add(tb); RadioButtonZ rb1 = new RadioButtonZ(420, 60, 15, 15, "", 10, rbkor_ime); rbkor_ime.Click += new EventHandler(this.fizbor); Controls.Add(rbkor_ime); /* Label lb1 = new Label(); * LabelZ lbIme = new LabelZ(20, 120, 180, 12, "Измени Име", lb1); * Controls.Add(lb1); * * TextBoxZ tbIme = new TextBoxZ(210, 120, tb1); * Controls.Add(tb1); */ Label lb2 = new Label(); LabelZ lbPrezime = new LabelZ(20, 120, 180, 12, "Измени Презиме", lb2); Controls.Add(lb2); TextBoxZ tbPrezime = new TextBoxZ(210, 120, tb2); tb2.Enabled = false; Controls.Add(tb2); RadioButtonZ rb2 = new RadioButtonZ(420, 110, 15, 15, "", 10, rbprezime); rbprezime.Click += new EventHandler(this.fizbor); Controls.Add(rbprezime); Label lb3 = new Label(); LabelZ lbLozinka = new LabelZ(20, 170, 180, 12, "Измени Лозинка", lb3); Controls.Add(lb3); TextBoxZ tbLozinka = new TextBoxZ(210, 170, tb3); tb3.Enabled = false; Controls.Add(tb3); RadioButtonZ rb3 = new RadioButtonZ(420, 160, 15, 15, "", 10, rblozinka); rblozinka.Click += new EventHandler(this.fizbor); Controls.Add(rblozinka); Label lb4 = new Label(); LabelZ lbTelefon = new LabelZ(20, 220, 180, 12, "Измени Телефон", lb4); Controls.Add(lb4); TextBoxZ tbTelefon = new TextBoxZ(210, 220, tb4); tb4.Enabled = false; Controls.Add(tb4); RadioButtonZ rb4 = new RadioButtonZ(420, 210, 15, 15, "", 10, rbtelefon); rbtelefon.Click += new EventHandler(this.fizbor); Controls.Add(rbtelefon); /* Label lb5 = new Label(); * LabelZ lbembg = new LabelZ(20, 320, 180, 12, "Измени ЕМБГ", lb5); * Controls.Add(lb5); * * TextBoxZ tbembg = new TextBoxZ(210, 320, tb5); * Controls.Add(tb5); */ Label lb6 = new Label(); LabelZ lbemail = new LabelZ(20, 270, 180, 12, "Измени Е-маил", lb6); Controls.Add(lb6); TextBoxZ tbe_email = new TextBoxZ(210, 270, tb6); tb6.Enabled = false; Controls.Add(tb6); RadioButtonZ rb5 = new RadioButtonZ(420, 260, 15, 15, "", 10, rbemail); rbemail.Click += new EventHandler(this.fizbor); Controls.Add(rbemail); Label lb7 = new Label(); LabelZ lbizbor = new LabelZ(500, 320, 180, 10, "Внесете ред. број", lb7); Controls.Add(lb7); TextBoxZ tbizbor = new TextBoxZ(500, 350, tb1); Controls.Add(tb1); ButtonZ btIzmeni = new ButtonZ(100, 320, "Измени", bt); bt.Click += new EventHandler(this.fizmeni); Controls.Add(bt); ButtonZ btIzlez = new ButtonZ(250, 320, "Излез", bt_izlez); bt_izlez.Click += new EventHandler(this.fizlez); Controls.Add(bt_izlez); }