Example #1
0
        public void CRE_Puesto(SqlCommand comando, MOD_Puesto obj)
        {
            try
            {
                string sp = "SP_CRE_Puesto";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@PUE_nombre", SqlDbType.VarChar));
                comando.Parameters.Add(new SqlParameter("@PUE_descripcion", SqlDbType.VarChar));
                comando.Parameters.Add(new SqlParameter("@PUE_id_centro_atencion", SqlDbType.Int));

                comando.Parameters[0].Value = obj.PUE_nombre;
                comando.Parameters[1].Value = obj.PUE_descripcion;
                comando.Parameters[2].Value = obj.PUE_id_centro_atencion;

                comando.ExecuteNonQuery();

            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Example #2
0
        public void CRE_Puesto(MOD_Puesto obj)
        {
            try
            {
                this.IniciarTransaccion();

                AD_Puesto objBD = new AD_Puesto();

                objBD.CRE_Puesto(this.comando, obj);

                this.ConfirmarTransaccion();
            }
            catch (Exception exc)
            {
                this.DeshacerTransaccion();
                throw exc;
            }
        }
Example #3
0
        public List<MOD_Puesto> SEL_Grid_Puestos(SqlCommand comando, int codigo, string buscar)
        {
            try
            {
                string sp = "SP_SEL_Grid_Puestos";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@PUE_ID_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@BUSCAR", SqlDbType.VarChar));

                comando.Parameters[0].Value = codigo;
                comando.Parameters[1].Value = buscar;

                IDbDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                List<MOD_Puesto> lista = new List<MOD_Puesto>();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Puesto obj = new MOD_Puesto();
                    obj.PUE_id_puesto = Convert.ToInt32(dt.Rows[i]["PUE_ID_PUESTO"]);
                    obj.PUE_nombre = dt.Rows[i]["PUE_NOMBRE"].ToString();
                    obj.PUE_descripcion = dt.Rows[i]["PUE_DESCRIPCION"].ToString();
                    obj.PUE_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["PUE_id_centro_atencion"]);
                    obj.CEA_nombre = dt.Rows[i]["CEA_nombre"].ToString();

                    lista.Add(obj);
                }

                return lista;

            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Example #4
0
        public MOD_Puesto SEL_PuestoByID(SqlCommand comando, int PUE_ID_PUESTO)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_PUESTO";

                comando.CommandType = CommandType.StoredProcedure;
                comando.CommandText = sp;
                comando.Parameters.Clear();

                comando.Parameters.Add(new SqlParameter("@PUE_ID_PUESTO", SqlDbType.Int));

                comando.Parameters[0].Value = PUE_ID_PUESTO;

                IDbDataAdapter da = new SqlDataAdapter((SqlCommand)comando);
                DataSet ds = new DataSet();
                da.Fill(ds);

                DataTable dt = ds.Tables[0];
                MOD_Puesto obj = new MOD_Puesto();

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.PUE_id_puesto = Convert.ToInt32(dt.Rows[i]["PUE_ID_PUESTO"]);
                    obj.PUE_nombre = dt.Rows[i]["PUE_NOMBRE"].ToString();
                    obj.PUE_descripcion = dt.Rows[i]["PUE_DESCRIPCION"].ToString();
                    obj.PUE_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["PUE_id_centro_atencion"]);
                    obj.CEA_nombre = dt.Rows[i]["CEA_NOMBRE"].ToString();

                }

                return obj;

            }
            catch (Exception exc)
            {
                throw exc;
            }
        }
Example #5
0
        public Boolean CRE_Puesto(MOD_Puesto obj)
        {
            try
            {
                LOG_Puesto Logica = new LOG_Puesto();
                Logica.CRE_Puesto(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }
Example #6
0
 public void UPD_Puesto(MOD_Puesto obj)
 {
     try
     {
         LOG_Puesto Logica = new LOG_Puesto();
         Logica.UPD_Puesto(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }