Exemplo n.º 1
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     try
     {
         //ClienteActual.ID_PRODUCTO = Convert.ToInt16(dgMaterialEntergado.Rows[dgMaterialEntergado.CurrentCell.RowIndex].Cells[0].Value.ToString());
         ContratoActual.CODIGO_CONTRATO      = "0";
         ContratoActual.ID_AUTOR             = "";
         ContratoActual.TITULO_OBRA          = "";
         ContratoActual.ID_PRODUCTO          = 0;
         ContratoActual.NRO_EJEMPLARES_CONT  = 0;
         ContratoActual.NRO_IMPRESIONES      = 0;
         ContratoActual.VALOR_CONTRATO       = 0;
         ContratoActual.ID_MONEDA            = "";
         ContratoActual.FECHA_ENTREGA_TEXTOS = System.DateTime.Now;
         ContratoActual.OBSERVACION          = "";
         ContratoActual.FIRMA_TEXTOS         = "";
         ContratoActual.PAGO_ADELANTADO      = "";
         ContratoActual.FECHA_PAGO           = System.DateTime.Now;
         ContratoActual.VALOR_PAGO           = 0;
         Form childForm = new frmEditContratos();
         //childForm.MdiParent = this;
         childForm.ShowDialog();
         if (ContratoActual.ACTION == "OK")
         {
             maestro.CODIGO_CONTRATO      = ContratoActual.CODIGO_CONTRATO;
             maestro.ID_AUTOR             = ContratoActual.ID_AUTOR;
             maestro.TITULO_OBRA          = ContratoActual.TITULO_OBRA;
             maestro.ID_PRODUCTO          = ContratoActual.ID_PRODUCTO;
             maestro.NRO_EJEMPLARES_CONT  = ContratoActual.NRO_EJEMPLARES_CONT;
             maestro.NRO_IMPRESIONES      = ContratoActual.NRO_IMPRESIONES;
             maestro.VALOR_CONTRATO       = ContratoActual.VALOR_CONTRATO;
             maestro.ID_MONEDA            = ContratoActual.ID_MONEDA;
             maestro.FECHA_ENTREGA_TEXTOS = ContratoActual.FECHA_ENTREGA_TEXTOS;
             maestro.OBSERVACION          = ContratoActual.OBSERVACION;
             maestro.FIRMA_TEXTOS         = ContratoActual.FIRMA_TEXTOS;
             maestro.PAGO_ADELANTADO      = ContratoActual.PAGO_ADELANTADO;
             maestro.FECHA_PAGO           = ContratoActual.FECHA_PAGO;
             maestro.VALOR_PAGO           = ContratoActual.VALOR_PAGO;
             maestro.ERRORES = "";
             maestro.CrearContratos(maestro);
             MessageBox.Show(@"Se a creado un nuevo registro! ");
             MuestraDatos();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     try
     {
         //ClienteActual.ID_PRODUCTO = Convert.ToInt16(dgMaterialEntergado.Rows[dgMaterialEntergado.CurrentCell.RowIndex].Cells[0].Value.ToString());
         ContratoActual.CODIGO_CONTRATO     = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[0].Value.ToString();
         ContratoActual.TITULO_OBRA         = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[1].Value.ToString();
         ContratoActual.ID_PRODUCTO         = 0;
         ContratoActual.NRO_EJEMPLARES_CONT = int.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[2].Value.ToString());
         ContratoActual.NRO_IMPRESIONES     = int.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[3].Value.ToString());
         ContratoActual.VALOR_CONTRATO      = float.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[4].Value.ToString());
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[5].Value.ToString() == "SOL")
         {
             ContratoActual.ID_MONEDA = "S";
         }
         else
         {
             ContratoActual.ID_MONEDA = "D";
         }
         ContratoActual.FECHA_ENTREGA_TEXTOS = DateTime.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[6].Value.ToString());
         ContratoActual.OBSERVACION          = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[7].Value.ToString();
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[8].Value.ToString() == "SI")
         {
             ContratoActual.FIRMA_TEXTOS = "1";
         }
         else
         {
             ContratoActual.FIRMA_TEXTOS = "0";
         }
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[9].Value.ToString() == "SI")
         {
             ContratoActual.PAGO_ADELANTADO = "1";
         }
         else
         {
             ContratoActual.PAGO_ADELANTADO = "0";
         }
         ContratoActual.FECHA_PAGO = DateTime.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[10].Value.ToString());
         ContratoActual.VALOR_PAGO = float.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[11].Value.ToString());
         Form childForm = new frmEditContratos();
         //childForm.MdiParent = this;
         childForm.ShowDialog();
         if (ContratoActual.ACTION == "OK")
         {
             maestro.CODIGO_CONTRATO      = ContratoActual.CODIGO_CONTRATO;
             maestro.ID_AUTOR             = ContratoActual.ID_AUTOR;
             maestro.TITULO_OBRA          = ContratoActual.TITULO_OBRA;
             maestro.ID_PRODUCTO          = ContratoActual.ID_PRODUCTO;
             maestro.NRO_EJEMPLARES_CONT  = ContratoActual.NRO_EJEMPLARES_CONT;
             maestro.NRO_IMPRESIONES      = ContratoActual.NRO_IMPRESIONES;
             maestro.VALOR_CONTRATO       = ContratoActual.VALOR_CONTRATO;
             maestro.ID_MONEDA            = ContratoActual.ID_MONEDA;
             maestro.FECHA_ENTREGA_TEXTOS = ContratoActual.FECHA_ENTREGA_TEXTOS;
             maestro.OBSERVACION          = ContratoActual.OBSERVACION;
             maestro.FIRMA_TEXTOS         = ContratoActual.FIRMA_TEXTOS;
             maestro.PAGO_ADELANTADO      = ContratoActual.PAGO_ADELANTADO;
             maestro.FECHA_PAGO           = ContratoActual.FECHA_PAGO;
             maestro.VALOR_PAGO           = ContratoActual.VALOR_PAGO;
             maestro.ERRORES = "";
             maestro.UpdateContratos(maestro);
             MessageBox.Show(@"Se a modificado el registro seleccionado!");
             MiDataSet.Tables.Remove(Maestro);
             MiDataSet.Tables.Remove(Detalle);
             Maestro.Clear();
             Detalle.Clear();
             MuestraDatos();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void toolStripButton2_Click(object sender, EventArgs e)
 {
     try
     {
         //ClienteActual.ID_PRODUCTO = Convert.ToInt16(dgMaterialEntergado.Rows[dgMaterialEntergado.CurrentCell.RowIndex].Cells[0].Value.ToString());
         ContratoActual.CODIGO_CONTRATO = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[0].Value.ToString();
         ContratoActual.TITULO_OBRA = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[1].Value.ToString();
         ContratoActual.ID_PRODUCTO = 0;
         ContratoActual.NRO_EJEMPLARES_CONT = int.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[2].Value.ToString());
         ContratoActual.NRO_IMPRESIONES = int.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[3].Value.ToString());
         ContratoActual.VALOR_CONTRATO = float.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[4].Value.ToString());
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[5].Value.ToString() == "SOL")
         {
             ContratoActual.ID_MONEDA = "S";
         }
         else
         {
             ContratoActual.ID_MONEDA = "D";      
         }
         ContratoActual.FECHA_ENTREGA_TEXTOS = DateTime.Parse( dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[6].Value.ToString());
         ContratoActual.OBSERVACION = dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[7].Value.ToString();
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[8].Value.ToString() == "SI")
         {
             ContratoActual.FIRMA_TEXTOS = "1";
         }
         else
         {
             ContratoActual.FIRMA_TEXTOS = "0";
         }
         if (dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[9].Value.ToString() == "SI")
         {
             ContratoActual.PAGO_ADELANTADO = "1";
         }
         else
         {
             ContratoActual.PAGO_ADELANTADO = "0";
         }
         ContratoActual.FECHA_PAGO = DateTime.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[10].Value.ToString());
         ContratoActual.VALOR_PAGO = float.Parse(dg_Contratos.Rows[dg_Contratos.CurrentCell.RowIndex].Cells[11].Value.ToString());
         Form childForm = new frmEditContratos();
         //childForm.MdiParent = this;
         childForm.ShowDialog();
         if (ContratoActual.ACTION == "OK")
         {
             maestro.CODIGO_CONTRATO = ContratoActual.CODIGO_CONTRATO;
             maestro.ID_AUTOR = ContratoActual.ID_AUTOR;
             maestro.TITULO_OBRA = ContratoActual.TITULO_OBRA;
             maestro.ID_PRODUCTO = ContratoActual.ID_PRODUCTO;
             maestro.NRO_EJEMPLARES_CONT = ContratoActual.NRO_EJEMPLARES_CONT;
             maestro.NRO_IMPRESIONES = ContratoActual.NRO_IMPRESIONES;
             maestro.VALOR_CONTRATO = ContratoActual.VALOR_CONTRATO;
             maestro.ID_MONEDA = ContratoActual.ID_MONEDA;
             maestro.FECHA_ENTREGA_TEXTOS = ContratoActual.FECHA_ENTREGA_TEXTOS;
             maestro.OBSERVACION = ContratoActual.OBSERVACION;
             maestro.FIRMA_TEXTOS = ContratoActual.FIRMA_TEXTOS;
             maestro.PAGO_ADELANTADO = ContratoActual.PAGO_ADELANTADO;
             maestro.FECHA_PAGO = ContratoActual.FECHA_PAGO;
             maestro.VALOR_PAGO = ContratoActual.VALOR_PAGO;
             maestro.ERRORES = "";
             maestro.UpdateContratos(maestro);
             MessageBox.Show(@"Se a modificado el registro seleccionado!");
             MiDataSet.Tables.Remove(Maestro);
             MiDataSet.Tables.Remove(Detalle);
             Maestro.Clear();
             Detalle.Clear();
             MuestraDatos();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
           try
            {
                //ClienteActual.ID_PRODUCTO = Convert.ToInt16(dgMaterialEntergado.Rows[dgMaterialEntergado.CurrentCell.RowIndex].Cells[0].Value.ToString());
                ContratoActual.CODIGO_CONTRATO = "0";
                ContratoActual.ID_AUTOR = "";
                ContratoActual.TITULO_OBRA = "";
                ContratoActual.ID_PRODUCTO = 0;
                ContratoActual.NRO_EJEMPLARES_CONT = 0;
                ContratoActual.NRO_IMPRESIONES = 0;
                ContratoActual.VALOR_CONTRATO = 0;
                ContratoActual.ID_MONEDA = "";
                ContratoActual.FECHA_ENTREGA_TEXTOS = System.DateTime.Now;
                ContratoActual.OBSERVACION = "";
                ContratoActual.FIRMA_TEXTOS = "";
                ContratoActual.PAGO_ADELANTADO = "";
                ContratoActual.FECHA_PAGO = System.DateTime.Now;
                ContratoActual.VALOR_PAGO = 0;
                Form childForm = new frmEditContratos();
                //childForm.MdiParent = this;
                childForm.ShowDialog();
                if (ContratoActual.ACTION == "OK")
                {
                    maestro.CODIGO_CONTRATO = ContratoActual.CODIGO_CONTRATO;
                    maestro.ID_AUTOR = ContratoActual.ID_AUTOR;
                    maestro.TITULO_OBRA = ContratoActual.TITULO_OBRA;
                    maestro.ID_PRODUCTO = ContratoActual.ID_PRODUCTO;
                    maestro.NRO_EJEMPLARES_CONT = ContratoActual.NRO_EJEMPLARES_CONT;
                    maestro.NRO_IMPRESIONES = ContratoActual.NRO_IMPRESIONES;
                    maestro.VALOR_CONTRATO = ContratoActual.VALOR_CONTRATO;
                    maestro.ID_MONEDA = ContratoActual.ID_MONEDA;
                    maestro.FECHA_ENTREGA_TEXTOS = ContratoActual.FECHA_ENTREGA_TEXTOS;
                    maestro.OBSERVACION = ContratoActual.OBSERVACION;
                    maestro.FIRMA_TEXTOS = ContratoActual.FIRMA_TEXTOS;
                    maestro.PAGO_ADELANTADO = ContratoActual.PAGO_ADELANTADO;
                    maestro.FECHA_PAGO = ContratoActual.FECHA_PAGO;
                    maestro.VALOR_PAGO = ContratoActual.VALOR_PAGO;
                    maestro.ERRORES = "";
                    maestro.CrearContratos(maestro);
                    MessageBox.Show(@"Se a creado un nuevo registro! ");
                    MuestraDatos();
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message );
            }
        }