コード例 #1
0
        private void CargaDatos()
        {
            try
            {
                DataSet        ds             = new DataSet();
                GestionMetasBE GestionMetasBE = new GestionMetasBE()
                {
                    OPCION  = 1,
                    USUARIO = General.General.GetUsuario,
                    Annio   = txtAnnio.Text,
                    Mes     = cboMes.SelectedValue.ToString()
                };

                ds = new GestionMetasBL().ProcesarGestionMetas(GestionMetasBE);
                dgvGestionMetas.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        public DataSet ProcesarGestionMetas(GestionMetasBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("GestionMetas_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "Annio", DbType.String, BE.Annio);
                db.AddInParameter(cmd, "Mes", DbType.String, BE.Mes);
                db.AddInParameter(cmd, "GestorId", DbType.String, BE.GestorId);
                db.AddInParameter(cmd, "Monto", DbType.Decimal, BE.Monto);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
コード例 #3
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            try
            {
                GestionMetasBE oEntity = new GestionMetasBE();
                foreach (DataGridViewRow row in dgvGestionMetas.Rows)
                {
                    oEntity.OPCION   = 2;
                    oEntity.USUARIO  = General.General.GetUsuario;
                    oEntity.Annio    = row.Cells["Annio"].Value.ToString();
                    oEntity.Mes      = row.Cells["Mes"].Value.ToString();
                    oEntity.GestorId = row.Cells["GestorId"].Value.ToString();
                    oEntity.Monto    = string.IsNullOrEmpty(row.Cells["Monto"].Value.ToString())? 0 : Convert.ToDecimal(row.Cells["Monto"].Value);
                    new GestionMetasBL().ProcesarGestionMetas(oEntity);
                }

                MessageBox.Show("Se proceso correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
 public DataSet ProcesarGestionMetas(GestionMetasBE BE)
 {
     return(GestionMetasDA.ProcesarGestionMetas(BE));
 }