private void contenedor_Load(object sender, EventArgs e) { Conexion.DSN = "prueba2"; MdiClient Chld; inv_ini = null; // rep_movs = null; np = null; cat = null; fm = null; mar = null; rstck = null; bod = null; fl = null; gr = null; dm = null; dbp = null; fmu = null; mem = null; mov = null; devc = null; doc = null; exbod = null; fac = null; kar = null; his = null; crearu = null; app = null; edi = null; camb = null; modap = null; desh = null; asper = null; edper = null; elper = null; repcom = null; foreach (Control crtl in this.Controls) { try { Chld = (MdiClient)crtl; Chld.BackColor = this.BackColor; } catch (InvalidCastException exe) { } } if (inv_ini == null) { inv_ini = new FormInventarioInicio(); inv_ini.MdiParent = this; inv_ini.FormClosed += new FormClosedEventHandler(FormInventarioInicio_FormCLosed); inv_ini.Show(); } }
private void dgw_movimientos_DoubleClick_1(object sender, EventArgs e) { FormDocumento f = new FormDocumento(); f.MdiParent = this.MdiParent; SistemaInventarioDatos sd = new SistemaInventarioDatos(); DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); DataTable dt_doc = new DataTable(); DataRow row; DataRow row2; string doc = dgw_movimientos.CurrentRow.Cells[7].Value.ToString(); string[] doc_separado = doc.Split('-'); string no = doc_separado[0].Trim(); string serie = doc_separado[1].Trim(); DateTime fe = Convert.ToDateTime(dgw_movimientos.CurrentRow.Cells[1].Value); string fecha = fe.ToString("dd-MM-yyyy"); string tipo_doc = dgw_movimientos.CurrentRow.Cells[8].Value.ToString().Trim(); string prov; string cliente; f.lbl_fecha.Text = fecha; f.lbl_no.Text = no; f.lbl_serie.Text = serie; f.lbl_tipo.Text = tipo_doc; //------------------ string transaccion = dgw_movimientos.CurrentRow.Cells[5].Value.ToString(); if (transaccion == "Compra") { try { dt = sd.ObtenerProvClieCom(no, "-", tipo_doc); row = dt.Rows[0]; string id_prov = row[0].ToString(); dt2 = sd.Prov(id_prov); row2 = dt2.Rows[0]; string nombre_prov = row2[0].ToString(); f.label7.Visible = true; f.lbl_prov.Visible = true; f.lbl_prov.Text = nombre_prov; //------------------------------ dt_doc = sd.ObtenerDetalleDocInv(no, "-", tipo_doc); f.dgw_det.DataSource = dt_doc; } catch { } } else if (transaccion == "Devolucion sobre compra") { try { dt = sd.ObtenerProvClieCom(no, "-", tipo_doc); row = dt.Rows[0]; string id_prov = row[0].ToString(); dt2 = sd.Prov(id_prov); row2 = dt2.Rows[0]; string nombre_prov = row2[0].ToString(); f.label7.Visible = true; f.lbl_prov.Visible = true; f.lbl_prov.Text = nombre_prov; //------------------------------ dt_doc = sd.ObtenerDetalleDocInv(no, "-", tipo_doc); f.dgw_det.DataSource = dt_doc; } catch { } } else if (transaccion == "Venta") { try { //dt = sd.ObtenerProvClieCom(no, "-", tipo_doc); //row = dt.Rows[0]; //string id_prov = row[0].ToString(); //dt2 = sd.Prov(id_prov); //row2 = dt2.Rows[0]; //string nombre_prov = row2[0].ToString(); //f.label7.Visible = true; //f.lbl_prov.Visible = true; //f.lbl_prov.Text = nombre_prov; //------------------------------ dt_doc = sd.ObtenerDetalleDocInv(no, serie, tipo_doc); f.dgw_det.DataSource = dt_doc; } catch { } } else if (transaccion == "Devolucion sobre venta") { } //--- f.Show(); }