コード例 #1
0
        private void button14_Click(object sender, EventArgs e)
        {
            CrearPedido c = new CrearPedido();

            c.ShowDialog();
            refrescarEncargos();
        }
コード例 #2
0
        private void encargo_Click(object sender, EventArgs e)
        {
            CrearPedido t = new CrearPedido(this);

            t.idUser.Text = this.iduser.Text;
            t.Show();
        }
コード例 #3
0
        private void gridEncargos_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == gridEncargos.Columns[0].Index)//EDITAR
            {
                int?id = GetIdEncargo();
                if (id != null)
                {
                    CrearPedido oFrmTabla = new CrearPedido(id);
                    oFrmTabla.tipox = gridEncargos.CurrentRow.Cells[3].Value.ToString();//TODO FIX THIS --WORKS
                    //oFrmTabla.clientex = gridEncargos.CurrentRow.Cells[6].Value.ToString();
                    oFrmTabla.finalizarBtn.Visible = true;
                    //MessageBox.Show(oFrmTabla.clientex + " "+ oFrmTabla.tipox); ***FOR TESTING
                    oFrmTabla.ShowDialog();
                    refrescar();
                }
            }
            if (e.ColumnIndex == gridEncargos.Columns[1].Index)//ELIMINAR
            {
                int?         id           = GetIdEncargo();
                DialogResult dialogResult = MessageBox.Show("Desea borrar " + id.ToString(), "Advertencia", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    using (SSSMEntities db = new SSSMEntities())
                    {
                        Encargo oTabla = db.Encargo.Find(id);
                        db.Encargo.Remove(oTabla);

                        //LOG START
                        Logs oTabla2 = new Logs();
                        oTabla2.Usuario     = Properties.Settings.Default.UserName.ToString();
                        oTabla2.Descripcion = "Eliminar Encargo " + oTabla.Observacion + " " + oTabla.FechaEntrada.ToString();
                        oTabla2.Elemento    = "Encargo";
                        var date = db.Database.SqlQuery <DateTime>("select getDate()");
                        oTabla2.Fecha = date.AsEnumerable().First();
                        db.Logs.Add(oTabla2);
                        //LOG END

                        db.SaveChanges();
                    }
                }
            }

            refrescarEncargos();
        }
コード例 #4
0
 private void button6_Click(object sender, EventArgs e)
 {
     CrearPedido x = new CrearPedido();
 }