private void edit_mostrarDatos_lote()
      {
          try
          {
              string errores = "";
              string rpta    = "";

              ConsultaSql = ConsultaSql + "   EXEC MONEDAEQUIVALENTE '" + idpresupuesto + "'";
              ConsultaSql = ConsultaSql + "   EXEC ACTUALIZA_MONEDA_PRTLOTE '" + idpresupuesto + "'";

              rpta = NFunciones.ExecuteSQL(ConsultaSql);

              if (!rpta.Equals("Ok"))
              {
                  errores = "Se produjo un error consulte con soporte";
                  Console.Write(errores);
              }
              ConsultaSql = "";
              tbgeneral   = NFunciones.TABLADATOS("EXEC sp_FiltroPresupuesto_Lote '" + idpresupuesto + "','" + Convert.ToString(cbo_cultivo.EditValue).Trim() + "','" + Convert.ToString(cbo_variedad.EditValue).Trim() + "','" + Convert.ToString(cbo_estructura.EditValue).Trim() + "','" + Convert.ToString(cbo_item.EditValue).Trim() + "','" + Convert.ToString(cbo_fundo.EditValue).Trim() + "','" + Convert.ToString(cbo_actisub.EditValue).Trim() + "','" + Convert.ToString(cbo_labor.EditValue).Trim() + "','" + Convert.ToString(cbo_moneda.EditValue).Trim() + "','" + Convert.ToString(cbo_lote.EditValue).Trim() + "'");
              modo        = "S";
          }
          catch (Exception ex)
          {
              MensajeError("Ocurrio un error, Consulte con Soporte" + "\n" + ex.Message);
              modo = "S";
          }
      }
Esempio n. 2
0
        void Insertando()
        {
            //VARIABLES A SUBIR
            //cabecera
            string   iidcobrarpagardoc, idempresa, iddocumento, serie, numero, idclieprov, razonsocial, estado, tipo, idmoneda;
            DateTime fecha;
            //detalle
            string idempresa_det, idcobrarpagar_det, item, idproducto_det, descripcion_det, idunidad_det;
            double cantidad_det, porc_imp, imp, precio_unit, preciototal, tc;
            string error       = "";
            int    correlativo = 0;

            foreach (DataRow row in dtlote.Rows)
            {
                correlativo = correlativo + 1;
                string id = "V" + DateTime.Now.Date.Day.ToString() + DateTime.Now.Date.Month.ToString() + DateTime.Now.Date.Year.ToString() + DateTime.Now.Hour.ToString() +
                            DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString() + VariablesGenerales.Empresa + Convert.ToString(correlativo);
                string rpta = NFunciones.ExecuteSQL("EXEC INSERT_VENTAS '" + id + "','" + VariablesGenerales.Empresa + "','" + row[1].ToString() + "','" + row[2].ToString() + "','" + row[3].ToString() + "','" + row[4].ToString() + "','" + row[5].ToString() + "','" + row[6].ToString() + "','" + row[7].ToString() + "','" + row[9].ToString() + "','" + row[10].ToString() + "','" + row[12].ToString() + "'");
                if (!rpta.Equals("Ok"))
                {
                    error = "Error de registro :" + row[1].ToString() + " " + row[2].ToString() + "-" + row[3].ToString() + "\n";
                }
            }
            if (!string.IsNullOrEmpty(error))
            {
                MessageBox.Show("Tiene los siguientes errores :" + error);
            }
            else
            {
                MessageBox.Show("Importado Correctamente");
            }
        }
Esempio n. 3
0
        private void monoFlat_Button1_Click(object sender, EventArgs e)
        {
            //removeCombinedFlags(cbo_select_fundo.Properties);

            valores = "";

            for (int i = 0; i < cbo_select_fundo.Properties.Items.Count; i++)
            {
                if (cbo_select_fundo.Properties.Items[i].CheckState == CheckState.Checked)
                {
                    valores = valores + cbo_select_fundo.Properties.Items[i].Value.ToString() + ".";
                }
            }

            valores = valores.TrimEnd('.');
            //MessageBox.Show(valores);


            idpresupuesto = Convert.ToString(cbo_presu.EditValue);
            idmoneda      = Convert.ToString(cbo_mon.EditValue);
            idcultivo     = Convert.ToString(cbo_cult.EditValue);


            dtresultado           = NFunciones.TABLADATOS(" EXEC SP_REPORTE_PYG'" + idpresupuesto + "','" + idmoneda + "','" + valores + "','" + idcultivo + "'");
            pvt_datos2.DataSource = dtresultado;
        }
Esempio n. 4
0
        private void Frm_UpdateTipoCambio_Load(object sender, EventArgs e)
        {
            DataTable DTVALOR = new DataTable();

            DTVALOR = NFunciones.TABLADATOS("SELECT VALOR FROM P_PARAMETROS where IDVARIABLE='001'");
            try
            {
                txt_tipocambio.Text = DTVALOR.Rows[0]["VALOR"].ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            ListarPresupuestos();

            if (chk_presupuesto.Checked)
            {
                cbo_presupuesto.Enabled = true;
            }
            else
            {
                cbo_presupuesto.Enabled = false;
            }
            if (chk_TC.Checked)
            {
                txt_tipocambio.ReadOnly = false;
            }
            else
            {
                txt_tipocambio.ReadOnly = true;
            }
        }
Esempio n. 5
0
        private void btn_eliminar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!this.txt_codigo.Text.Equals(""))
            {
                string rpta = "";
                try
                {
                    DialogResult Opcion;
                    Opcion = MessageBox.Show("Realmente Desea Eliminar este registro", "Presupuesto", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                    if (Opcion == DialogResult.OK)
                    {
                        rpta = NFunciones.ExecuteSQL(" DELETE P_FUNDO WHERE IDFUNDO='" + txt_codigo.Text + "'");
                        if (rpta.Equals("Ok"))
                        {
                            this.MensajeOk("Eliminado Correctamente");
                            this.Limpiar();
                        }
                        else
                        {
                            this.MensajeError(rpta);
                        }
                    }
                }
                catch (Exception ex)
                {
                    this.MensajeError(ex.Message + ex.StackTrace);
                }

                this.llenargrilla();
            }
        }
Esempio n. 6
0
        private void btn_eliminar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DataTable validar = NFunciones.TABLASQL("select * from tb_dcobrarpagardoc d inner join tb_productos p on p.idproducto=d.idproducto and p.idempresa=d.idempresa where p.idempresa='" + VariablesGenerales.Empresa + "' and p.idgrupopro='" + txt_codigo.Text + "'");

            if (validar.Rows.Count > 0)
            {
                MessageBox.Show("No se Puede Eliminar Ya que esta registrado en productos con movimiento !", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            else
            {
                DialogResult respuesta = MessageBox.Show("Esta Seguro de eliminar el registro ?", "Confimación", MessageBoxButtons.OK, MessageBoxIcon.Question);

                if (respuesta == DialogResult.OK)
                {
                    string delete = NFunciones.ExecuteSQL("delete tb_grupopro where idempresa='" + VariablesGenerales.Empresa + "' and idgrupopro='" + txt_codigo.Text + "'");
                    if (delete.Equals("Ok"))
                    {
                        MessageBox.Show("Registro Eliminado!", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        LlegarGrilla();
                        limpiartxt();
                    }
                    else
                    {
                        MessageBox.Show("No se puedo realizar la Operacion  !", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
            }
        }
Esempio n. 7
0
 private void btn_cancelar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (_opcion.Equals("N"))
     {
         limpiartxt();
         txt_id.Text = "";
         LlegarGrilla();
     }
     else
     {
         DataTable tb_cabecera = NFunciones.TABLASQL("select * from tb_cobrarpagardoc where idempresa='" + VariablesGenerales.Empresa + "' and idcobrarpagardoc='" + _id + "'");
         if (tb_cabecera.Rows.Count > 0)
         {
             txt_id.Text                  = tb_cabecera.Rows[0]["idcobrarpagardoc"].ToString();
             cbo_clieprov.EditValue       = tb_cabecera.Rows[0]["idclieprov"].ToString();
             dtp_fechadoc.EditValue       = tb_cabecera.Rows[0]["fecha"].ToString();
             dtp_fechaoperacion.EditValue = tb_cabecera.Rows[0]["fechaoperacion"].ToString();
             cbo_documento.EditValue      = tb_cabecera.Rows[0]["iddocumento"].ToString();
             txt_serie.Text               = tb_cabecera.Rows[0]["serie"].ToString();
             txt_numero.Text              = tb_cabecera.Rows[0]["numero"].ToString();
             txt_operacion.Text           = tb_cabecera.Rows[0]["tipo"].ToString();
             cbo_moneda.EditValue         = tb_cabecera.Rows[0]["idmoneda"].ToString();
             txt_tc.Text                  = tb_cabecera.Rows[0]["TC"].ToString();
             LlegarGrilla();
         }
     }
     botones(true);
     LlegarGrilla();
     activartxt(false);
     _opcion = "";
 }
Esempio n. 8
0
        private void btn_eliminar_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                DialogResult rpta = MessageBox.Show("Desea Eliminar este registro ?", "Alerta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (rpta == DialogResult.Yes)
                {
                    DataTable tb_op = new DataTable();

                    tb_op = NFunciones.TABLASQL("select * from tb_docreferencia where idempresa='" + VariablesGenerales.Empresa + "' and idorigen='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'");

                    if (tb_op.Rows.Count > 0)
                    {
                        MessageBox.Show("No se Puede Eliminar el Documento esta Referenciado a otro Documento ", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    else
                    {
                        string eliminarcabecera = NFunciones.ExecuteSQL("DELETE tb_cobrarpagardoc WHERE IDEMPRESA='" + VariablesGenerales.Empresa + "' AND idcobrarpagardoc='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'");
                        string detalle          = NFunciones.ExecuteSQL("DELETE tb_dcobrarpagardoc WHERE IDEMPRESA='" + VariablesGenerales.Empresa + "' AND idcobrarpagardoc='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'");
                        string mov = NFunciones.ExecuteSQL("DELETE tb_movcobrarpagardoc_drakback WHERE IDEMPRESA='" + VariablesGenerales.Empresa + "' AND idcobrarpagardoc='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "' AND IDTRANSACCION='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'");
                        LlegarGrilla();
                        MessageBox.Show("Se Elimino Correctamente", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch
            {
                MessageBox.Show("Elija un registro ", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
        private void btn_eliminar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                DialogResult rpta = MessageBox.Show("Desea Eliminar este registro ?", "Alerta", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (rpta == DialogResult.Yes)
                {
                    DataTable tbdua    = NFunciones.TABLASQL("SELECT * FROM TB_DUA WHERE IDDUA='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "' AND IDEMPRESA='" + VariablesGenerales.Empresa + "'");
                    string    cabecera = NFunciones.ExecuteSQL("delete tb_dua where iddua='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'and idempresa='" + VariablesGenerales.Empresa + "'");

                    string referencia = NFunciones.ExecuteSQL("delete tb_docreferencia where idempresa='" + VariablesGenerales.Empresa + "' and iddestino='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "'");
                    // insertar exportacion
                    string exportacion = NFunciones.ExecuteSQL("update tb_dcobrarpagardoc set idref='NULL' where idcobrarpagardoc='" + tbdua.Rows[0]["idcobrarpagardoc"].ToString() + "'");
                    //insertar insumos
                    string deleteinsumos = NFunciones.ExecuteSQL("delete tb_movcobrarpagardoc_drakback where idtransaccion='" + Convert.ToString(vista_datos.GetFocusedRowCellValue(COL_ID)) + "' and idempresa='" + VariablesGenerales.Empresa + "'");
                    VariablesGenerales.refduas = "S";
                    MessageBox.Show("Dua eliminada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch
            {
                MessageBox.Show("Elija un registro ", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
Esempio n. 10
0
        private void btn_editar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            //DataTable tb_table = new DataTable();
            //tb_table = NFunciones.TABLASQL("select * from tb_docreferencia where idempresa='" + VariablesGenerales.Empresa + "' and idorigen='" + txt_id.Text + "'");
            //if (tb_table.Rows.Count > 0)
            //{
            //    botones(true);
            //    activartxt(false);
            //    _opcion = "";
            //    MessageBox.Show("Este Registro Esta relacionado con otros Registro, No se puede realizar la operación !");
            //    return;
            //}
            //else
            //{
            //    botones(false);
            //    activartxt(true);
            //    _opcion = "E";
            //}


            if (_idoperacion.Equals("C"))
            {
                DataTable tb_table = new DataTable();
                tb_table = NFunciones.TABLASQL("select * from tb_movcobrarpagardoc_drakback where idcobrarpagardoc='" + txt_id.Text + "' AND NOT idtransaccion='" + txt_id.Text + "' AND idempresa='" + VariablesGenerales.Empresa + "'");
                if (tb_table.Rows.Count > 0)
                {
                    botones(true);
                    activartxt(false);
                    _opcion = "";
                    MessageBox.Show("Este Registro Esta relacionado con otros Registro, No se puede realizar la operación !");
                    return;
                }
                else
                {
                    botones(false);
                    activartxt(true);
                    _opcion = "E";
                }
            }
            if (_idoperacion.Equals("V"))
            {
                DataTable tb_table = new DataTable();
                tb_table = NFunciones.TABLASQL("select * from tb_docreferencia where idempresa='" + VariablesGenerales.Empresa + "' and idorigen='" + txt_id.Text + "'");
                if (tb_table.Rows.Count > 0)
                {
                    botones(true);
                    activartxt(false);
                    _opcion = "";
                    MessageBox.Show("Este Registro Esta relacionado con otros Registro, No se puede realizar la operación !");
                    return;
                }
                else
                {
                    botones(false);
                    activartxt(true);
                    _opcion = "E";
                }
            }
        }
Esempio n. 11
0
        private void btn_guardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                string rpta = "";
                if (this.txt_codigo.Text == string.Empty)
                {
                    MensajeError("Falta Ingresar Codigo");
                    return;
                }
                if (this.txt_descripcion.Text == string.Empty)
                {
                    MensajeError("Falta Ingresar Nombre de Responsable");
                    return;
                }

                string    codigo;
                DataTable dtid = new DataTable();

                if (this.IsNuevo)
                {
                    dtid            = NFunciones.TABLADATOS("EXEC SP_IDRESPONSABLE''");
                    codigo          = dtid.Rows[0]["ID"].ToString();
                    txt_codigo.Text = codigo;

                    rpta = NFunciones.ExecuteSQL("INSERT INTO P_RESPONSABLES(IdResponsable,Nombre,ESTADO) values('" + codigo + "','" + txt_descripcion.Text + "','AC')");
                }
                else
                {
                    rpta = NFunciones.ExecuteSQL("UPDATE P_RESPONSABLES set NOMBRE='" + txt_descripcion.Text + "' WHERE IDRESPONSABLE='" + txt_codigo.Text + "'");
                }

                if (rpta.Equals("Ok"))
                {
                    if (this.IsNuevo)
                    {
                        this.MensajeOk("Se Inserto los Datos Correctamente");
                    }
                    else
                    {
                        this.MensajeOk("Se Actualizo los Datos Correctamente");
                    }
                }
                else
                {
                    this.MensajeError(rpta);
                }

                this.IsNuevo  = false;
                this.IsEditar = false;
                this.Botones();
                this.HabilitarTexbox(false);
                this.LlenarGrilla();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + ex.StackTrace);
            }
        }
 private void Listarmoneda()
 {
     Invoke((Action) delegate
     {
         cbo_moneda.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDMONEDA,RTRIM(LTRIM(NOMBRE_CORTO))+ '- '+DESCRIPCION MONEDA FROM P_MONEDAS ORDER BY IDMONEDA ASC");
         cbo_moneda.Properties.ValueMember   = "IDMONEDA";
         cbo_moneda.Properties.DisplayMember = "MONEDA";
     });
 }
Esempio n. 13
0
        private void btn_guardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txt_codigo.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Codigo !");
                return;
            }
            if (txt_descripcion.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Descripcion  !");
                return;
            }
            //if (txt_valor.Text.Equals(""))
            //{
            //    MessageBox.Show("Debe Ingresar Valor  !");
            //    return;
            //}
            //if (txt_sp.Text.Equals(""))
            //{
            //    MessageBox.Show("Debe Ingresar SP Asignado  !");
            //    return;
            //}


            if (_modo.Equals("N"))
            {
                DataTable tb_table = new DataTable();
                tb_table = NFunciones.TABLADATOS("SELECT * FROM P_PARAMETROS WHERE IDVARIABLE='" + txt_codigo.Text + "'");
                if (tb_table.Rows.Count > 0)
                {
                    MessageBox.Show("Ya existe el codigo ingresado debe colocar uno que nuevo !");
                    return;
                }


                string rpta = NFunciones.ExecuteSQL("INSERT INTO P_PARAMETROS (IDEMPRESA,IDVARIABLE,DESCRIPCION,VALOR,SP_ASIGNADO)VALUES('001','" + txt_codigo.Text + "','" + txt_descripcion.Text + "','" + txt_valor.Text + "','" + txt_sp.Text + "')");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    MessageBox.Show("Guardado Correctamente");
                }
            }
            if (_modo.Equals("E"))
            {
                string rpta = NFunciones.ExecuteSQL("UPDATE P_PARAMETROS SET DESCRIPCION='" + txt_descripcion.Text + "',VALOR='" + txt_valor.Text + "', SP_ASIGNADO='" + txt_sp.Text + "' WHERE IDVARIABLE='" + txt_codigo.Text + "'");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    MessageBox.Show("Actualizado Correctamente");
                }
            }
            _modo = "";
        }
Esempio n. 14
0
        void procesar()
        {
            DataTable _dtresultado;

            _dtresultado = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ '" + _idpresupuesto + "'");
            string rpta = NFunciones.ExecuteSQL("EXEC SP_CALCULAR_PYG'" + _idpresupuesto + "'");

            estado = "S";
        }
Esempio n. 15
0
 private void Frm_Ventas_Load(object sender, EventArgs e)
 {
     if (tipo.Equals("N"))
     {
         DataTable tb_empresa = NFunciones.TABLASQL("SELECT * FROM TB_EMPRESA WHERE IDEMPRESA='" + VariablesGenerales.Empresa + "'");
         txt_tc.Text                  = tb_empresa.Rows[0]["TC"].ToString();
         txt_regimen.Text             = tb_empresa.Rows[0]["regimen"].ToString();
         txt_aduanas.Text             = tb_empresa.Rows[0]["codigo_aduanas"].ToString();
         txt_porc_drawback.Text       = tb_empresa.Rows[0]["porc_drawback"].ToString();
         dtp_fechaoperacion.EditValue = DateTime.Now.ToShortDateString();
         llenarExportacion();
         crearid();
         botones(true);
     }
     if (tipo.Equals("E"))
     {
     }
     if (tipo.Equals("V"))
     {
         try
         {
             txt_tc.Enabled             = false;
             txt_dua.Enabled            = false;
             dtp_fechaoperacion.Enabled = false;
             DataTable tb_cabecera = NFunciones.TABLASQL("SELECT * FROM tb_dua WHERE idempresa='" + VariablesGenerales.Empresa + "' AND iddua='" + id + "'");
             if (tb_cabecera.Rows.Count > 0)
             {
                 botones(false);
                 txt_tc.Text                  = tb_cabecera.Rows[0]["TC"].ToString();
                 txt_regimen.Text             = tb_cabecera.Rows[0]["regimen"].ToString();
                 txt_aduanas.Text             = tb_cabecera.Rows[0]["codigo_aduanas"].ToString();
                 txt_porc_drawback.Text       = tb_cabecera.Rows[0]["porc_drawback"].ToString();
                 dtp_fechaoperacion.EditValue = tb_cabecera.Rows[0]["fecha"].ToString();
                 txt_dua.Text                 = tb_cabecera.Rows[0]["ndua"].ToString();
                 txt_ncajas.Text              = tb_cabecera.Rows[0]["ncajas"].ToString();
                 txt_importetotal.Text        = tb_cabecera.Rows[0]["importetotal"].ToString();
                 string idrefexportacion = tb_cabecera.Rows[0]["idcobrarpagardoc"].ToString();
                 // agregar detalleexpoertacion
                 dtg_exportaciones.DataSource = NFunciones.TABLASQL("SELECT c.idcobrarpagardoc ID,d.idproducto IDPRODUCTO,d.descripcion PRODUCTO,d.cantidad CANTIDAD,d.idunidad UNIDAD FROM tb_cobrarpagardoc c inner join tb_dcobrarpagardoc d on c.idcobrarpagardoc=d.idcobrarpagardoc and c.idempresa=d.idempresa WHERE c.idempresa='" + VariablesGenerales.Empresa + "' AND c.idcobrarpagardoc='" + idrefexportacion + "'");
                 //agregar detalle insumos
                 Program.detalleinsumos = NFunciones.TABLASQL("select m.idcobrarpagardoc ID,C.iddocumento+' '+C.serie+' - '+C.numero DOCUMENTO,C.idclieprov IDPROVEEDOR,C.razonsocial PROVEEDOR, m.idproducto IDPRODUCTO,m.descripcion PRODUCTO,m.idunidad UNIDAD,m.CANTIDAD from tb_movcobrarpagardoc_drakback m  INNER JOIN tb_cobrarpagardoc c on c.idcobrarpagardoc=m.idcobrarpagardoc and c.idempresa=m.idempresa where M.idtransaccion='" + id + "' and M.idempresa='" + VariablesGenerales.Empresa + "'");
                 dtg_insumos.DataSource = Program.detalleinsumos;
             }
             else
             {
                 MessageBox.Show("Ocurrio un problema , no se pudio cargar la información!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                 this.Close();
             }
         }
         catch
         {
             MessageBox.Show("Ocurrio un problema , no se pudio cargar la información!", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
             this.Close();
         }
     }
 }
        private void btn_guardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (txt_codigo.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Codigo de Empresa !");
                return;
            }
            if (txt_razonsocial.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Razon Social !");
                return;
            }
            //if (txt_ruc.Text.Equals(""))
            //{
            //    MessageBox.Show("Debe Ingresar Ruc!");
            //    return;
            //}
            if (cbo_tipo.Text.Equals("[Seleccionar]"))
            {
                MessageBox.Show("Debe Ingresar Tipo Empresa !");
                return;
            }


            if (_modo.Equals("N"))
            {
                DataTable tb_table = new DataTable();
                tb_table = NFunciones.TABLASQL("select idclieprov from tb_clieprov where idclieprov='" + txt_codigo.Text + "' and idempresa='" + VariablesGenerales.Empresa + "'");
                if (tb_table.Rows.Count > 0)
                {
                    MessageBox.Show("Ya existe el codigo ingresado debe colocar uno que nuevo !");
                    return;
                }


                string rpta = NFunciones.ExecuteSQL("insert into tb_clieprov(idempresa,idclieprov,razonsocial,ruc,tipoclieprov,estado) values('" + VariablesGenerales.Empresa + "','" + txt_codigo.Text.ToUpper() + "','" + txt_razonsocial.Text.ToUpper() + "','" + txt_ruc.Text.ToUpper() + "','" + cbo_tipo.EditValue.ToString() + "','1')");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    MessageBox.Show("Guardado Correctamente");
                }
            }
            if (_modo.Equals("E"))
            {
                string rpta = NFunciones.ExecuteSQL("update tb_clieprov set razonsocial='" + txt_razonsocial.Text.ToUpper() + "',ruc='" + txt_ruc.Text.ToUpper() + "',tipoclieprov='" + cbo_tipo.EditValue.ToString() + "' where idempresa='" + VariablesGenerales.Empresa + "' and idclieprov='" + txt_codigo.Text.ToUpper() + "'");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    MessageBox.Show("Actualizado Correctamente");
                }
            }
        }
Esempio n. 17
0
        private void ProcesarConsultar()
        {
            string rpta = NFunciones.ExecuteSQL("EXEC SP_CALCULAR_PYG_DOL'" + idpresupuesto + "','" + idmoneda + "'");

            dtresultado =
                NFunciones.TABLADATOS(" EXEC SP_REPORTE_PYG'" + idpresupuesto + "','" +
                                      idmoneda + "','" + idfundo +
                                      "','" + idcultivo + "'");
            mostrar = "S";
        }
Esempio n. 18
0
        private void ListarFundo()
        {
            cbo_fun.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDFUNDO ID ,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION FROM P_FUNDO ORDER BY IDFUNDO ASC ");
            cbo_fun.Properties.ValueMember   = "ID";
            cbo_fun.Properties.DisplayMember = "DESCRIPCION";

            cbo_select_fundo.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDFUNDO ID ,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION FROM P_FUNDO ORDER BY IDFUNDO ASC ");
            cbo_select_fundo.Properties.ValueMember   = "ID";
            cbo_select_fundo.Properties.DisplayMember = "DESCRIPCION";
        }
Esempio n. 19
0
        private void ListarCultivo()
        {
            cbo_cult.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDCULTIVO ID,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION  FROM P_CULTIVOS ORDER BY IDCULTIVO ASC");
            cbo_cult.Properties.ValueMember   = "ID";
            cbo_cult.Properties.DisplayMember = "DESCRIPCION";

            cbo_select_cult.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDCULTIVO ID,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION  FROM P_CULTIVOS ORDER BY IDCULTIVO ASC");
            cbo_select_cult.Properties.ValueMember   = "ID";
            cbo_select_cult.Properties.DisplayMember = "DESCRIPCION";
        }
Esempio n. 20
0
        void cargarpresupuesto()
        {
            cbo_presupuesto.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDPRESUPUESTO ID,DESCRIPCION PRESUPUESTO FROM P_PRESUPUESTO ORDER BY IDPRESUPUESTO ASC");
            cbo_presupuesto.Properties.ValueMember   = "ID";
            cbo_presupuesto.Properties.DisplayMember = "PRESUPUESTO";


            cbo_presupuesto_gf.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDPRESUPUESTO ID,DESCRIPCION PRESUPUESTO FROM P_PRESUPUESTO ORDER BY IDPRESUPUESTO ASC");
            cbo_presupuesto_gf.Properties.ValueMember   = "ID";
            cbo_presupuesto_gf.Properties.DisplayMember = "PRESUPUESTO";
        }
Esempio n. 21
0
        private void btn_guardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (cbo_grupo.Text.Equals("[Seleccionar]"))
            {
                MessageBox.Show("Debe seleccionar Grupo !");
                return;
            }
            if (txt_codigo.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Codigo !");
                return;
            }
            if (txt_razonsocial.Text.Equals(""))
            {
                MessageBox.Show("Debe Ingresar Descripcion de Grupo !");
                return;
            }



            if (_modo.Equals("N"))
            {
                DataTable tb_table = new DataTable();
                tb_table = NFunciones.TABLASQL("SELECT * FROM tb_subgrupo WHERE idempresa='" + VariablesGenerales.Empresa + "' AND idgrupopro='" + txt_codigo.Text + "'");
                if (tb_table.Rows.Count > 0)
                {
                    MessageBox.Show("Ya existe el codigo ingresado debe colocar uno que nuevo !");
                    return;
                }


                string rpta = NFunciones.ExecuteSQL("insert into tb_subgrupo(idempresa,idsubgrupopro,idgrupopro,descripcion,estado) values('" + VariablesGenerales.Empresa + "','" + txt_codigo.Text + "','" + cbo_grupo.EditValue.ToString() + "','" + txt_razonsocial.Text + "','1')");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    _modo = "";
                    MessageBox.Show("Guardado Correctamente");
                }
            }
            if (_modo.Equals("E"))
            {
                string rpta = NFunciones.ExecuteSQL("update tb_subgrupo set descripcion='" + txt_razonsocial.Text + "' where idempresa='" + VariablesGenerales.Empresa + "' and idgrupopro='" + cbo_grupo.EditValue.ToString() + "'");
                if (rpta.Equals("Ok"))
                {
                    LlegarGrilla();
                    botones(true);
                    activartxt(false);
                    _modo = "";
                    MessageBox.Show("Actualizado Correctamente");
                }
            }
        }
Esempio n. 22
0
        public static string AutorizarIngreso(string usuario, string password)
        {
            string autorizarIngresoReturn = string.Empty;

            DataTable TB_USER = NFunciones.TABLADATOS("select * from tb_usuario where usuario='" + usuario + "' and clave='" + password + "'");

            if (TB_USER.Rows.Count == 1)
            {
                autorizarIngresoReturn = "Ok";
            }
            return(autorizarIngresoReturn);
        }
 void data()
 {
     if (tipo.Equals("V"))
     {
         tbresult = NFunciones.TABLADATOS("SELECT * FROM P_DPRESUPUESTO_RG WHERE IDPRESUPUESTO='" + idpresupuesto + "'");
     }
     if (tipo.Equals("L"))
     {
         tbresult = NFunciones.TABLADATOS("SELECT * FROM P_DPRESUPUESTO_LOTE WHERE IDPRESUPUESTO='" + idpresupuesto + "'");
     }
     dtg_datos.DataSource = tbresult;
 }
Esempio n. 24
0
 void procesando()
 {
     try
     {
         tbresumen = NFunciones.TABLADATOS("EXEC SP_GENERAR_RPTXLOTE'" + Convert.ToString(cbo_presupuesto.EditValue) + "'");
         PROCESADO = "S";
     }
     catch (Exception ex)
     {
         errores   = ex.Message;
         PROCESADO = "S";
     }
 }
Esempio n. 25
0
        private void MostrarDatos()
        {
            //_dtresultado = NFunciones.TABLADATOS("SELECT COUNT(*)AS NREGISTROS FROM P_RPT_PXQ WHERE IDPRESUPUESTO='"+_idpresupuesto+"'");
            _dtresultado = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ '" + _idpresupuesto + "','" + _moneda + "'");
            //MessageBox.Show(Convert.ToString(cbo_moneda.EditValue));

            Invoke((Action) delegate
            {
                pvt_datos2.DataSource = _dtresultado;
            });

            _mostrar = "S";
        }
Esempio n. 26
0
        private void MostrarPorFundo()
        {
            _dtresultado = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ_TOTALES'" +
                                                 _idpresupuesto + "','" +
                                                 _moneda + "'");

            Invoke((Action) delegate
            {
                pvt_datos2.DataSource = _dtresultado;
            });

            _mostrar = "S";
        }
Esempio n. 27
0
 void llenarGrilla()
 {
     try
     {
         TB_PERSONAL = NFunciones.TABLADATOSNISIRA("exec sp_executesql N'exec PERSONAL_NISRA_RG @P1 , @P2 , @P3 ',N'@P1 varchar(3),@P2 varchar(13),@P3 float','001','ADMINISTRADOR',0");
         Program.llenargrillapersonal = "S";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Alerta !!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     Program.llenargrillapersonal = "S";
 }
Esempio n. 28
0
        private void Consultar()
        {
            DataTable tbregistros = new DataTable();

            tbregistros = NFunciones.TABLADATOS("SELECT COUNT(*)NREGISTROS FROM P_RPT_PYG WHERE IDPRESUPUESTO='" + idpresupuesto + "'");

            if (Convert.ToInt32(tbregistros.Rows[0]["NREGISTROS"]) == 0)
            {
                string rpta = NFunciones.ExecuteSQL("EXEC SP_CALCULAR_PYG_DOL'" + idpresupuesto + "','" + idmoneda + "'");
            }
            dtresultado = NFunciones.TABLADATOS(" EXEC SP_REPORTE_PYG'" + idpresupuesto + "','" + idmoneda + "','" + valores + "','" + cultivos + "'");
            mostrar     = "S";
        }
 private void mostrarDatos_lote()
 {
     try
     {
         tbgeneral = NFunciones.TABLADATOS("EXEC sp_FiltroPresupuesto_Lote '" + idpresupuesto + "','" + Convert.ToString(cbo_cultivo.EditValue).Trim() + "','" + Convert.ToString(cbo_variedad.EditValue).Trim() + "','" + Convert.ToString(cbo_estructura.EditValue).Trim() + "','" + Convert.ToString(cbo_item.EditValue).Trim() + "','" + Convert.ToString(cbo_fundo.EditValue).Trim() + "','" + Convert.ToString(cbo_actisub.EditValue).Trim() + "','" + Convert.ToString(cbo_labor.EditValue).Trim() + "','" + Convert.ToString(cbo_moneda.EditValue).Trim() + "','" + Convert.ToString(cbo_lote.EditValue).Trim() + "','" + Convert.ToString(cbo_subitemcosto.EditValue).Trim() + "','" + Convert.ToString(cbo_tipocosto.EditValue).Trim() + "'");
         modo      = "S";
     }
     catch (Exception ex)
     {
         MensajeError("Ocurrio un error, Consulte con Soporte" + "\n" + ex.Message);
         modo = "S";
     }
 }
Esempio n. 30
0
 void CargarDatos()
 {
     if (_idmonedad.Equals("02"))
     {
         dtresultado = NFunciones.TABLADATOS("EXEC SP_MOSTRARDETALLEPXQ_DOL '" + _idpresupuestod + "','" + _iditemd + "','" + _idmonedad + "'");
         _estado     = "S";
     }
     if (_idmonedad.Equals("01"))
     {
         dtresultado = NFunciones.TABLADATOS("EXEC SP_MOSTRARDETALLEPXQ_SOL '" + _idpresupuestod + "','" + _iditemd + "','" + _idmonedad + "'");
         _estado     = "S";
     }
 }