Esempio n. 1
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. 2
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;
        }
      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. 4
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";
     });
 }
        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. 7
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. 8
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. 9
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. 10
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. 11
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";
        }
 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. 13
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);
        }
Esempio n. 14
0
        private void MostrarPorFundo()
        {
            _dtresultado = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ_TOTALES'" +
                                                 _idpresupuesto + "','" +
                                                 _moneda + "'");

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

            _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. 16
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";
     }
 }
Esempio n. 17
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. 18
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. 19
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";
        }
Esempio n. 20
0
        void actualizardatos()
        {
            if (TC > 0)
            {
                string rptat2 = NFunciones.ExecuteSQL("UPDATE P_PARAMETROS SET VALOR='" + Convert.ToDecimal(txt_tipocambio.Text) + "' WHERE IDVARIABLE='001' ");


                if (rptat2.Equals("Ok"))
                {
                    toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[0]);
                }
                else
                {
                    toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[1]);
                }
            }
            if (!idpresupuesto.Equals(""))
            {
                try
                {
                    DataTable tbractualiza, tbractualiza1, tbractualiza2 = new DataTable();

                    string rpta, rpta1, rpta2;
                    tbractualiza = NFunciones.TABLADATOS("EXEC ACTUALIZA_MONEDA_PRTLOTE'" + idpresupuesto + "'");
                    rpta         = tbractualiza.Rows[0]["RESULTADO"].ToString();

                    tbractualiza1 = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ_DOL'" + idpresupuesto + "','02'");
                    tbractualiza2 = NFunciones.TABLADATOS("EXEC SP_PROCESAR_PXQ_SOL'" + idpresupuesto + "','01'");
                    MessageBox.Show(rpta + "   " + Convert.ToString(tbractualiza1.Rows.Count) + "   " + Convert.ToString(tbractualiza2.Rows.Count));
                    if (rpta.Equals("Ok") /*&& tbractualiza1.Rows.Count>0 && tbractualiza2.Rows.Count > 0*/)
                    {
                        //MessageBox.Show("Correctamente actualizado");
                        toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[2]);
                    }
                    else
                    {
                        toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[3]);
                    }
                    // MessageBox.Show(rpta);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    // toastNotificationsManager1.Notifications[4].Body2 = EX.Message;
                    toastNotificationsManager1.ShowNotification(toastNotificationsManager1.Notifications[3]);
                }
            }

            actualizar = "S";
        }
Esempio n. 21
0
        private void btn_activar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string estado;

            if (vista_registros.GetFocusedRowCellValue(COL_IDESTADO).ToString().Equals("1"))
            {
                estado = "ANULAR";
            }
            else
            {
                estado = "ACTIVAR";
            }

            DialogResult resultado;

            resultado = MessageBox.Show("Desea " + estado + " el registro ?", "Advertencia", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (resultado == DialogResult.Yes)
            {
                string respuesta;
                if (vista_registros.GetFocusedRowCellValue(COL_IDESTADO).ToString().Equals("1"))
                {
                    respuesta = NFunciones.ExecuteSQL("UPDATE P_PARAMETROS_ESPECIFICOS SET IDESTADO='0' WHERE ID='" + vista_registros.GetFocusedRowCellValue(COL_ID).ToString() + "' ");
                }
                else
                {
                    DataTable TB_VERIFICACION = NFunciones.TABLADATOS("SELECT * FROM P_PARAMETROS_ESPECIFICOS WHERE IDVARIEABLE='" + vista_registros.GetFocusedRowCellValue(COL_IDVARIABLE).ToString() + "' AND IDPRESUPUESTO='" + vista_registros.GetFocusedRowCellValue(COL_IDPRESUPUESTO).ToString() + "' AND IDESTADO='1'");
                    if (TB_VERIFICACION.Rows.Count > 0)
                    {
                        MessageBox.Show("NO se Puede Activar , Ya existe un registro para esta Variable y Presupuesto", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                    else
                    {
                        respuesta = NFunciones.ExecuteSQL("UPDATE P_PARAMETROS_ESPECIFICOS SET IDESTADO='1' WHERE ID='" + vista_registros.GetFocusedRowCellValue(COL_ID).ToString() + "' ");
                    }
                }

                if (respuesta.Equals("Ok"))
                {
                    MessageBox.Show("Se Actualizo Correctamente ", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    MessageBox.Show("No se Pudo Actualizar!! ", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                LlegarGrilla();
            }
        }
Esempio n. 22
0
        private static string Validarxvariedad(string idempresa, string idpresupuesto, string idcultivo, string IdVariedad, string idetapa, string idestructura, string idtipocosto, string iditemcosto, string idactividadsubgru, string idlaborproducto, string idunidad, int con_igv, string periodo, string semana, decimal cantidad, decimal costo, string idmoneda, int dias_pago, string idobjetivo, string idsubitemcosto, string idfundo, string IDITEMCOSTO_USER, string IDCULTIVO_USER)
        {
            string valor;

            valor = "";
            DataTable dtvalidar = new DataTable();

            dtvalidar = NFunciones.TABLADATOS("EXEC SP_VALIDAR_DPRESUPUESTO_VARIEDAD'" + idempresa + "','" + idpresupuesto + "','" + idcultivo + "','" + IdVariedad + "','" + idetapa + "','" + idestructura + "','" + idtipocosto + "','" + iditemcosto + "','" + idactividadsubgru + "','" + idlaborproducto + "','" + idunidad + "','" + con_igv + "','" + periodo + "','" + semana + "','" + cantidad + "','" + costo + "','" + idmoneda + "','" + dias_pago + "','" + idobjetivo + "','" + idsubitemcosto + "','" + idfundo + "','" + IDITEMCOSTO_USER + "','" + IDCULTIVO_USER + "'");
            if (dtvalidar.Rows.Count > 0)
            {
                valor = dtvalidar.Rows[0]["ERRORES"].ToString();
            }
            else
            {
                valor = "ERROR DE CONEXION";
            }
            return(valor);
        }
        void descargardata()
        {
            try
            {
                DTRESULT = NFunciones.TABLADATOS("SELECT * FROM P_PROCESADO_DPRESUPUESTO_RG WHERE IDPRESUPUESTO='" + IDPRESUPUESTO + "'");
                DataSet ds = new DataSet();

                //ds.Tables.Add(DTRESULT);
                //Console.WriteLine("dataset completo");

                //string RUTA = "c:\\DATA\\xxxxx.xlsx";
                //Console.WriteLine("funcion excel");
                //FuncionesExtras obj = new FuncionesExtras();
                //obj.ExportDataSetToExcel(ds, RUTA);
            }
            catch (Exception EX)
            {
                MessageBox.Show("Se produjo un error : " + EX, "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            ESTADO = "S";
        }
      private void vista_datos_ShownEditor(object sender, EventArgs e)
      {
          ColumnView view = (ColumnView)sender;

          if (view.FocusedColumn.FieldName == "idsubitemcosto")
          {
              LookUpEdit editor    = (LookUpEdit)view.ActiveEditor;
              string     tipocosto = Convert.ToString(view.GetFocusedRowCellValue("IdItemCosto"));
              editor.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IdSubItemCosto  ID,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION  FROM P_SUB_ICOSTO WHERE IdItemCosto='" + tipocosto + "'");
              editor.Properties.ValueMember   = "ID";
              editor.Properties.DisplayMember = "DESCRIPCION";
          }
          if (view.FocusedColumn.FieldName == "IdLaborProducto")
          {
              LookUpEdit editor    = (LookUpEdit)view.ActiveEditor;
              string     actividad = Convert.ToString(view.GetFocusedRowCellValue("IdActividadSubGru"));
              editor.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDLABORPROD ID,RTRIM(LTRIM(DESCRIPCION)) DESCRIPCION  FROM P_LABORPRODUCT WHERE IDACTIVIDAD='" + actividad + "' ORDER BY IDLABORPROD ASC");
              editor.Properties.ValueMember   = "ID";
              editor.Properties.DisplayMember = "DESCRIPCION";
          }
      }
Esempio n. 25
0
        private void btn_nuevo_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.Limpiar();
            DataTable dtid = new DataTable();

            try
            {
                dtid          = NFunciones.TABLADATOS("EXEC SP_IDFUNDO''");
                this.IsNuevo  = true;
                this.IsEditar = false;
                this.Botones();
                this.HabilitarTexbox(true);
                this.txt_descripcion.Focus();
                txt_codigo.Text = dtid.Rows[0]["ID"].ToString();
            }
            catch (Exception ex)
            {
                MensajeError("Ocurrio un error " + "\n" + ex.Message);
                return;
            }
        }
Esempio n. 26
0
 void LlegarGrilla()
 {
     dtg_datos.DataSource = NFunciones.TABLADATOS("SELECT IDVARIABLE,DESCRIPCION,VALOR,SP_ASIGNADO FROM P_PARAMETROS ORDER BY IDVARIABLE ASC");
 }
Esempio n. 27
0
 private void ListarPresupuestos()
 {
     cbo_presupuesto.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDPRESUPUESTO,DESCRIPCION PRESUPUESTO FROM P_PRESUPUESTO WHERE ES_GF='0'");
     cbo_presupuesto.Properties.ValueMember   = "IDPRESUPUESTO";
     cbo_presupuesto.Properties.DisplayMember = "PRESUPUESTO";
 }
Esempio n. 28
0
 void LlenarCombo()
 {
     cbo_empresa.Properties.DataSource    = NFunciones.TABLADATOS("SELECT IDEMPRESA ID , DESCRIPCION FROM P_EMPRESA");
     cbo_empresa.Properties.ValueMember   = "ID";
     cbo_empresa.Properties.DisplayMember = "DESCRIPCION";
 }
Esempio n. 29
0
 void llenargrilla()
 {
     dtg_datos.DataSource = NFunciones.TABLADATOS("SELECT F.IDFUNDO ID, F.DESCRIPCION,E.IDEMPRESA,E.DESCRIPCION EMPRESA FROM P_FUNDO F INNER JOIN P_EMPRESA E ON E.IDEMPRESA=F.IDEMPRESA ORDER BY F.IDFUNDO ASC");
 }
Esempio n. 30
0
        private void btn_guardar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (this.cbo_empresa.Text == "[Seleccionar..]")
                {
                    MensajeError("Falta Seleccionar Empresa");
                    return;
                }

                string rpta = "";
                if (this.txt_codigo.Text == string.Empty)
                {
                    MensajeError("Falta Ingresar Codigo");
                    return;
                }
                if (this.txt_descripcion.Text == string.Empty)
                {
                    MensajeError("Falta Ingresar Descripción");
                    return;
                }

                string    codigo;
                DataTable dtid = new DataTable();


                if (this.IsNuevo)
                {
                    dtid            = NFunciones.TABLADATOS("EXEC SP_IDFUNDO''");
                    codigo          = dtid.Rows[0]["ID"].ToString();
                    txt_codigo.Text = codigo;
                    rpta            = NFunciones.ExecuteSQL("INSERT INTO P_FUNDO(IDEMPRESA,IDFUNDO,DESCRIPCION)VALUES('" + Convert.ToString(cbo_empresa.EditValue) + "','" + txt_codigo.Text + "','" + txt_descripcion.Text + "')");
                }
                else
                {
                    rpta = NFunciones.ExecuteSQL("UPDATE P_FUNDO SET IDEMPRESA='" + Convert.ToString(cbo_empresa.EditValue) + "',DESCRIPCION='" + txt_descripcion.Text + "' WHERE IDFUNDO='" + 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);
            }
        }