Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (name.Text != "" && lastname.Text != "")
            {
                Connection c = new Connection();

                c.execute("insert into person (name,lastname,address1,email1,phone1,kind,created_at) value(\"" + name.Text + "\",\"" + lastname.Text + "\",\"" + address.Text + "\",\"" + email.Text + "\",\"" + phone.Text + "\"," + kind + ",NOW() )");
                MessageBox.Show("Contacto agregado exitosamente!");
                name.Text = lastname.Text = address.Text = email.Text = phone.Text = "";
            }
        }
Ejemplo n.º 2
0
 private void button2_Click(object sender, EventArgs e)
 {
     Connection c = new Connection();
     if (provider.SelectedIndex != -1)
     {
         c.execute("insert into sell (person_id,operation_type_id,created_at) value (" + provs[provider.SelectedIndex].id + ",1,NOW())");
     }
     else
     {
         c.execute("insert into sell (operation_type_id,created_at) value (1,NOW())");
     }
     long sell_id = c.insert_id;
     List<SellObj> sell = SellObj.re;
     for (int i = 0; i < sell.Count; i++)
     {
         c.execute("insert into operation (product_id,q,sell_id,operation_type_id,created_at) value (" + sell[i].product_id + "," + sell[i].q + "," + sell_id + ",1,NOW())");
     }
     data.Rows.Clear();
     SellObj.sell.Clear();
     MessageBox.Show("Abastecimiento Aplicado Exitosamente");
     //            Dispose();
 }
Ejemplo n.º 3
0
 private void procesarToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Connection c = new Connection();
     if (client_.SelectedIndex != -1)
     {
         c.execute("insert into sell (person_id,created_at) value (" + lp[client_.SelectedIndex].id + ",NOW())");
     }
     else
     {
         c.execute("insert into sell (created_at) value (NOW())");
     }
     long sell_id = c.insert_id;
     List<SellObj> sell = SellObj.sell;
     for (int i = 0; i < sell.Count; i++)
     {
         c.execute("insert into operation (product_id,q,sell_id,operation_type_id,created_at) value (" + sell[i].product_id + "," + sell[i].q + "," + sell_id + ",2,NOW())");
     }
     data.Rows.Clear();
     SellObj.sell.Clear();
     MessageBox.Show("Venta Aplicada Exitosamente");
     Dispose();
 }
Ejemplo n.º 4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (name.Text != "" && lastname.Text != "")
            {

                Connection c = new Connection();

                c.execute("insert into person (name,lastname,address1,email1,phone1,kind,created_at) value(\"" + name.Text + "\",\"" + lastname.Text + "\",\"" + address.Text + "\",\"" + email.Text + "\",\"" + phone.Text + "\","+kind+",NOW() )");
                MessageBox.Show("Contacto agregado exitosamente!");
                name.Text = lastname.Text = address.Text = email.Text = phone.Text = "";

            }
        }
Ejemplo n.º 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (name.Text != "" && price_in.Text != "" && price_out.Text != "")
     {
         Connection c = new Connection();
         c.execute("insert into product (name,price_in,price_out,unit) value(\"" + name.Text + "\",\"" + price_in.Text + "\",\"" + price_out.Text + "\",\"" + unit.Text + "\")");
         MessageBox.Show("Producto agregado exitosamente!");
         name.Text = price_in.Text = price_out.Text = unit.Text = "";
     }
     else
     {
         MessageBox.Show("Campos requeridos: Nombre, precio entrada, precio salida");
     }
 }
Ejemplo n.º 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (product.Text != "" && q.Text != "") {
                //MessageBox.Show(""+ids[product.SelectedIndex]);
                Connection c = new Connection();
                c.execute("insert into operation(product_id,q,operation_type_id,created_at) value (" + ids[product.SelectedIndex] + ","+q.Text+",1,NOW())");
                q.Text = "";
                MessageBox.Show("Alta en inventario exitosa!");

            }
            else {
                MessageBox.Show("Campos Requeridos: Producto, Cantidad");
            }
        }
Ejemplo n.º 7
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (name.Text != "" && price_in.Text != "" && price_out.Text != "")
            {
                Connection c = new Connection();
                c.execute("insert into product (name,price_in,price_out,unit) value(\""+name.Text+"\",\""+price_in.Text+"\",\""+price_out.Text+"\",\""+unit.Text+"\")");
                MessageBox.Show("Producto agregado exitosamente!");
                name.Text = price_in.Text = price_out.Text = unit.Text = "";

            }
            else {
                MessageBox.Show("Campos requeridos: Nombre, precio entrada, precio salida");
            }
        }
Ejemplo n.º 8
0
        private void procesarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Connection c = new Connection();

            if (client_.SelectedIndex != -1)
            {
                c.execute("insert into sell (person_id,created_at) value (" + lp[client_.SelectedIndex].id + ",NOW())");
            }
            else
            {
                c.execute("insert into sell (created_at) value (NOW())");
            }
            long           sell_id = c.insert_id;
            List <SellObj> sell    = SellObj.sell;

            for (int i = 0; i < sell.Count; i++)
            {
                c.execute("insert into operation (product_id,q,sell_id,operation_type_id,created_at) value (" + sell[i].product_id + "," + sell[i].q + "," + sell_id + ",2,NOW())");
            }
            data.Rows.Clear();
            SellObj.sell.Clear();
            MessageBox.Show("Venta Aplicada Exitosamente");
            Dispose();
        }
Ejemplo n.º 9
0
        private void button2_Click(object sender, EventArgs e)
        {
            Connection c = new Connection();

            if (provider.SelectedIndex != -1)
            {
                c.execute("insert into sell (person_id,operation_type_id,created_at) value (" + provs[provider.SelectedIndex].id + ",1,NOW())");
            }
            else
            {
                c.execute("insert into sell (operation_type_id,created_at) value (1,NOW())");
            }
            long           sell_id = c.insert_id;
            List <SellObj> sell    = SellObj.re;

            for (int i = 0; i < sell.Count; i++)
            {
                c.execute("insert into operation (product_id,q,sell_id,operation_type_id,created_at) value (" + sell[i].product_id + "," + sell[i].q + "," + sell_id + ",1,NOW())");
            }
            data.Rows.Clear();
            SellObj.sell.Clear();
            MessageBox.Show("Abastecimiento Aplicado Exitosamente");
//            Dispose();
        }
Ejemplo n.º 10
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (product.Text != "" && q.Text != "")
     {
         //MessageBox.Show(""+ids[product.SelectedIndex]);
         Connection c = new Connection();
         c.execute("insert into operation(product_id,q,operation_type_id,created_at) value (" + ids[product.SelectedIndex] + "," + q.Text + ",1,NOW())");
         q.Text = "";
         MessageBox.Show("Alta en inventario exitosa!");
     }
     else
     {
         MessageBox.Show("Campos Requeridos: Producto, Cantidad");
     }
 }