Esempio n. 1
0
        //private string WR()
        //{
        //    DateTime curr_data = DateTime.Now;
        //    string q = "";
        //    if (dateTimePicker2.Value.Date <= curr_data) { q = @"UPDATE orderr SET ready = '" + "Не выполнено" + @"' WHERE expiration_date<=CURDATE();"; }
        //    else q = @"UPDATE orderr SET readyy = '"+"Выполнено"+ @"' WHERE expiration_date>=CURDATE();";
        //    return q;
        //}

        private void button1_Click(object sender, EventArgs e)
        {
            double        OC     = 0;
            string        readyy = "Не выполнено";
            ClassDataBase db     = new ClassDataBase();
            string        qq     = @"insert into clientt(s_cl, n_cl, p_cl) values ('" + clF.Text + @"','" + clN.Text + @"','" + clP.Text + @"')";

            db.ExecuteNonQuery("ALD_V2.db", qq, 0);
            string qq2 = @"select id_cl, s_cl, n_cl, p_cl from clientt order by id_cl desc limit 1;";

            db.Execute <Client>("ALD_V2.db", qq2, ref listClient);
            string qqq = @"insert into orderr(id_cl, footage, date_of_conclusion, expiration_date, order_cost, readyy) values (" + listClient[0].Id_cl + @"," + ordSq.Text + @",'" + dateTimePicker1.Text + @"','" + dateTimePicker2.Text + @"'," + OC + @",'" + readyy + @"');";

            db.ExecuteNonQuery("ALD_V2.db", qqq, 0);
            listOrder.Clear();
            string qqq2 = @"select id_order, id_cl, footage, date_of_conclusion, expiration_date, order_cost, readyy from orderr order by id_cl desc limit 1;";

            db.Execute <Order>("ALD_V2.db", qqq2, ref listOrder);
            string qqq3 = @"insert into order_empl(id_order,id_empl) values ('" + listOrder[0].Id_order + @"','" + GetIDE(cbEmpl.Text.Trim()) + @"')";

            db.ExecuteNonQuery("ALD_V2.db", qqq3, 0);
            OrdersProjects newForm = new OrdersProjects();

            newForm.Show();
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ClassDataBase db = new ClassDataBase();
            double        TC = 0;
            string        ll = @"select id_order, id_cl, footage, date_of_conclusion, expiration_date, order_cost, readyy from orderr order by id_order desc limit 1;";

            db.Execute <Order>("ALD_V2.db", ll, ref listOrder);
            string ll2 = @"select id_proj, cat_proj, name_proj, cost_of_work, min_square, work_time from projects where cat_proj = '" + cbCatProj.Text + @"' and name_proj='" + cbNameProj.Text + @"'";

            db.Execute <Projects>("ALD_V2.db", ll2, ref listProj);
            //string lll = @"insert into order_proj(id_order, id_proj) values (" + listOrder[0].Id_order + @"," + listProj[0].Id_proj + @")";
            string s = @"INSERT INTO order_proj (id_order, id_proj) VALUES (" + "(select id_order from orderr order by 1  desc limit 1)" + @"," + GetIDP(cbNameProj.Text) + @")";

            //db.Execute<Order>("ALD_V2.db", s, ref listOrder);
            db.ExecuteNonQuery("ALD_V2.db", s, 0);
            string z = @"select o.id_order, c.s_cl , c.n_cl , c.p_cl , o.footage, o.date_of_conclusion, o.expiration_date, o.order_cost,  p.id_proj,  p.cat_proj, p.name_proj, p.cost_of_work, p.min_square, p.work_time, o.readyy from projects p natural join orderr o natural join clientt c;";

            db.Execute <OrderProj>("ALD_V2.db", z, ref listOrderProj);
            for (int i = 0; i < listProj.Count; i++)
            {
                if (listProj[i].Cat_proj == cbCatProj.Text && listProj[i].Name_proj == cbNameProj.Text)
                {
                    TC = TC + listProj[i].Cost_of_work;
                }
            }
            s = @"UPDATE orderr SET order_cost = order_cost +'" + TC + @"' WHERE id_order = '" + listOrder[0].Id_order + @"'";
            db.ExecuteNonQuery("ALD_V2.db", s, 0);
            s = @"UPDATE Materials SET order_cost = order_cost +'" + TC + @"' WHERE id_order = '" + listOrder[0].Id_order + @"'";
            db.ExecuteNonQuery("ALD_V2.db", s, 0);
            Close();
        }
Esempio n. 3
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            ClassDataBase db = new ClassDataBase();

            string q = @"insert into employee(s_empl, n_empl, p_empl, exper) values ('" + tbSE.Text + @"','" + tbNE.Text + @"','" + tbPE.Text + @"','" + tbEE.Text + @"')";

            db.ExecuteNonQuery("ALD_V2.db", q, 0);
        }
Esempio n. 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            ClassDataBase db = new ClassDataBase();

            string qq = @"insert into materials(name_m, category_m, unit_of_measurement_m, quatnity_m, cost_m) values ('" + NameM.Text + @"','" + CatM.Text + @"','" + UnitMeasurementM.Text + @"','" + Quantity.Text + @"','" + Cost.Text + @"')";

            db.ExecuteNonQuery("ALD_V2.db", qq, 0);
        }
Esempio n. 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (tbNameP.Text == "" || tbCatP.Text == "" || tbMinS.Text == "" || tbTimeWork.Text == "" || tbCostWork.Text == "")
            {
                MessageBox.Show("Одно из полей не заполнено"); return;
            }

            ClassDataBase db = new ClassDataBase();

            string qq = @"insert into projects(name_proj, cat_proj, min_square, work_time, cost_of_work) values ('" + tbNameP.Text + @"','" + tbCatP.Text + @"','" + tbMinS.Text + @"','" + tbTimeWork.Text + @"','" + tbCostWork.Text + @"')";

            db.ExecuteNonQuery("ALD_V2.db", qq, 0);
            string ll = @"select id_proj, cat_proj, name_proj, cost_of_work, min_square, work_time from projects order by id_proj desc limit 1;";

            db1.Execute <Projects>("ALD_V2.db", ll, ref listProj1);
        }