Beispiel #1
0
 public GastosComunes getGastosComunes(Int32 id_tipogasto)
 {
     try
     {
         using (SqlConnection sqlConn = new SqlConnection(this.strConn))
         {
             sqlConn.Open();
             SqlCommand cmd = new SqlCommand(strConn, sqlConn);
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "sp_r_GastosComunesDes";
             cmd.Parameters.AddWithValue("@id_tipogasto", id_tipogasto);
             SqlDataReader reader         = cmd.ExecuteReader();
             GastosComunes mGastosComunes = new GastosComunes();
             if (reader.Read())
             {
                 mGastosComunes.Id_tipogasto   = Convert.ToInt32(reader["id_tipogasto"].ToString());
                 mGastosComunes.Descripcion    = reader["descripcion"].ToString();
                 mGastosComunes.Valor          = Convert.ToInt32(reader["valor"].ToString());
                 mGastosComunes.Cargo_contable = Convert.ToBoolean(reader["cargo_contable"].ToString());
                 mGastosComunes.Cuenta_grupo   = reader["plan_de_cuenta"].ToString().Trim();
             }
             return(mGastosComunes);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #2
0
        public GastosComunes getGastos_Cero(Int32 id_solicitud)
        {
            try
            {
                using (SqlConnection sqlConn = new SqlConnection(this.strConn))
                {
                    sqlConn.Open();
                    SqlCommand cmd = new SqlCommand(strConn, sqlConn);
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;
                    cmd.CommandText = "sp_r_Gastos_Cero";
                    cmd.Parameters.AddWithValue("@id_solicitud", id_solicitud);

                    SqlDataReader reader         = cmd.ExecuteReader();
                    GastosComunes mGastosComunes = new GastosComunes();
                    if (reader.Read())
                    {
                        mGastosComunes.Comprobar = Convert.ToBoolean(reader["comprobante"].ToString());
                    }

                    return(mGastosComunes);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #3
0
 public GastosComunes getGastoComunbyId_solandId_gasto(Int32 id_solicitud, Int32 id_tipogasto)
 {
     try
     {
         using (SqlConnection sqlConn = new SqlConnection(this.strConn))
         {
             sqlConn.Open();
             SqlCommand cmd = new SqlCommand(strConn, sqlConn);
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "sp_r_GastoComunebyid_solandId_tipogasto";
             cmd.Parameters.AddWithValue("@id_tipogasto", id_tipogasto);
             cmd.Parameters.AddWithValue("@id_solicitud", id_solicitud);
             SqlDataReader reader         = cmd.ExecuteReader();
             GastosComunes mGastosComunes = new GastosComunes();
             if (reader.Read())
             {
                 mGastosComunes.Id_tipogasto = Convert.ToInt32(reader["id_tipogasto"].ToString());
                 mGastosComunes.Descripcion  = reader["descripcion"].ToString();
                 mGastosComunes.Valor        = Convert.ToInt32(reader["monto"].ToString());
                 mGastosComunes.Id_familia   = Convert.ToInt32(reader["id_familia"].ToString());
             }
             return(mGastosComunes);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
        private void combotipogasto()
        {
            if (this.dl_cliente.SelectedValue == "0")
            {
                return;
            }
            if (this.dl_producto.SelectedValue == "0")
            {
                return;
            }
            GastosComunes mGastosComunes = new GastosComunes();

            mGastosComunes.Id_tipogasto = 0;
            mGastosComunes.Descripcion  = "Seleccionar";
            List <GastosComunes> lGastosComunes = new GastosComunesBC().getallGastosComunes(Convert.ToInt32(this.dl_familia.SelectedValue));

            lGastosComunes.Add(mGastosComunes);
        }
Beispiel #5
0
        protected void gr_dato_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                EstadoTipoOperacion mestado = new EstadoTipoOperacion();
                mestado.Codigo_estado = 0;
                mestado.Descripcion   = "Seleccionar";

                List <EstadoTipoOperacion> lestado = new EstadotipooperacionBC().getEstadoByFamilia(id_fam);

                lestado.Add(mestado);


                DropDownList dl2 = (DropDownList)e.Row.FindControl("dl_estado");

                dl2.DataSource     = lestado;
                dl2.DataValueField = "codigo_estado";
                dl2.DataTextField  = "descripcion";
                dl2.DataBind();
                //dl2.SelectedValue = "0";



                GastosComunes gastos = new GastosComunes();
                gastos.Id_tipogasto = 0;
                gastos.Descripcion  = "seleccionar";
                List <GastosComunes> lgastos = new GastosComunesBC().getallGastosComunes(id_fam);
                lgastos.Add(gastos);
                DropDownList dl = (DropDownList)e.Row.FindControl("dl_gasto");

                dl.DataSource     = lgastos;
                dl.DataValueField = "id_tipogasto";
                dl.DataTextField  = "descripcion";
                dl.DataBind();

                //dl.SelectedValue = "0";
                FuncionGlobal.comboEstadoByFamilia(estado_dl, id_fam);
                FuncionGlobal.Combogasto(gasto_dl, id_fam);

                dl.SelectedValue  = gr_dato.DataKeys[e.Row.RowIndex].Values[1].ToString();
                dl2.SelectedValue = gr_dato.DataKeys[e.Row.RowIndex].Values[0].ToString();
            }
        }