示例#1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string   a    = ClassReports.NameNew(textBox1.Text.Trim());
         int      b    = Convert.ToInt32(textBox2.Text.Trim());
         DateTime date = Convert.ToDateTime(maskedTextBox1.Text.Trim());
         string   c    = comboBox1.Text.Trim();
         double   d    = Convert.ToDouble(textBox3.Text.Trim());
         if (d > 0)
         {
             ClassManager m = new ClassManager();
             m.Stock(a, b, date, c, d);
             MessageBox.Show("Новая поставка добавлена");
         }
         else
         {
             MessageBox.Show("Отрицательные значения не погут быть в поле 'сумма'");
         }
     }
     catch
     {
         MessageBox.Show("Проверьте правильность введенной даты");
     }
 }
        }//заполнение формы для редачки

        public void EditFinal(employee emp, ComboBox comboBox, TextBox t1, TextBox t2, TextBox t3, MaskedTextBox m, TextBox t4, TextBox t5)
        {
            restEntities db    = new restEntities();
            var          query = (from i in db.position
                                  where i.id_post == comboBox.SelectedIndex + 1
                                  select i.id_post).ToList();

            var log    = db.users.SingleOrDefault(r => r.id_user == emp.id_user);
            var result = db.employee.SingleOrDefault(n => n.id_empl == emp.id_empl);

            result.surname_emp = ClassReports.NameNew(t1.Text.ToString());
            result.name_emp    = ClassReports.NameNew(t2.Text.ToString());
            if (t3.Text != "")
            {
                result.lastname_emp = ClassReports.NameNew(t3.Text.ToString());
            } //отчество
            else
            {
                result.lastname_emp = t3.Text.ToString();
            }
            result.id_post  = Convert.ToInt32(query[0]);
            result.date_emp = Convert.ToDateTime(m.Text);
            log.login_user  = t4.Text.ToString();
            log.pass_user   = t5.Text.ToString();

            db.SaveChanges();
        }//сохранение обновленных значений
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string       s = ClassReports.NameNew(textBox1.Text.Trim());
         string       n = ClassReports.NameNew(textBox2.Text.Trim());
         string       l = ClassReports.NameNew(textBox3.Text.Trim());
         ClassManager m = new ClassManager();
         m.Drop(s, n, l);
     }
     catch {
         MessageBox.Show("Проверьте правильность заполняемых данных");
     }
 }
示例#4
0
 private void button1_Click(object sender, EventArgs e)
 {
     // ClassReports r = new ClassReports();
     try
     {
         string       s    = ClassReports.NameNew(textBox1.Text.Trim());
         string       n    = ClassReports.NameNew(textBox2.Text.Trim());
         string       l    = ClassReports.NameNew(textBox3.Text.Trim());
         DateTime     date = Convert.ToDateTime(maskedTextBox1.Text);
         string       log  = textBox5.Text.Trim();
         string       pass = textBox7.Text.Trim();
         int          i    = comboBox1.SelectedIndex;
         ClassManager d    = new ClassManager();
         d.AddJ(s, n, l, date, i, log, pass);
     }
     catch
     {
         MessageBox.Show("Проверьте правильность заполняемых данных");
     }
 }
示例#5
0
        private void button2_Click(object sender, EventArgs e)
        {
            ClassReports repost = new ClassReports();

            repost.AdminRep();
        } //кнопка закрыть смену