Example #1
0
        public void CRE_Expediente(SqlCommand comando, MOD_Expediente obj)
        {
            try
            {
                string sp = "SP_CRE_Expediente";

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

                comando.Parameters.Add(new SqlParameter("@EXP_ID_MASCOTA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@EXP_ID_CENTRO_ATENCION", SqlDbType.VarChar));
                comando.Parameters.Add(new SqlParameter("@EXP_FECHA_CREACION", SqlDbType.Date));

                comando.Parameters[0].Value = obj.EXP_id_mascota;
                comando.Parameters[1].Value = obj.EXP_id_centro_atencion;
                comando.Parameters[2].Value = obj.EXP_fecha_creacion;

                comando.ExecuteNonQuery();
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #2
0
        public MOD_Expediente SEL_Grid_Expediente_By_Id_Mascota(SqlCommand comando, int codigo_mascota, int codigo_centro)
        {
            try
            {
                string sp = "SP_SEL_GRID_Expediente_BY_ID_Mascota";

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

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

                comando.Parameters[0].Value = codigo_mascota;
                comando.Parameters[1].Value = codigo_centro;

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.EXP_id_expediente = Convert.ToInt32(dt.Rows[i]["EXP_ID_Expediente"]);
                    obj.EXP_id_mascota = Convert.ToInt32(dt.Rows[i]["EXP_ID_MASCOTA"]);
                    obj.EXP_fecha_creacion = dt.Rows[i]["EXP_FECHA_CREACION"].ToString();
                    obj.EXP_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["EXP_ID_CENTRO_ATENCION"]);
                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #3
0
        public List<MOD_Expediente> SEL_Grid_Expediente(SqlCommand comando, int codigo, string buscar)
        {
            try
            {
                string sp = "SP_SEL_Grid_Expediente";

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

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

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

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Expediente obj = new MOD_Expediente();
                    obj.EXP_id_expediente = Convert.ToInt32(dt.Rows[i]["EXP_ID_Expediente"]);
                    obj.EXP_id_mascota = Convert.ToInt32(dt.Rows[i]["EXP_ID_MASCOTA"]);
                    obj.MAS_nombre = dt.Rows[i]["MAS_NOMBRE"].ToString();
                    obj.EXP_fecha_creacion = dt.Rows[i]["EXP_FECHA_CREACION"].ToString();
                    obj.EXP_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["EXP_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_Expediente SEL_Grid_By_Id_Expediente(SqlCommand comando, int codigo_Expediente, int codigo_centro)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_Expediente";

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

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

                comando.Parameters[0].Value = codigo_Expediente;
                comando.Parameters[1].Value = codigo_centro;

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.EXP_id_expediente = Convert.ToInt32(dt.Rows[i]["EXP_ID_Expediente"]);
                    obj.EXP_id_mascota = Convert.ToInt32(dt.Rows[i]["EXP_ID_MASCOTA"]);
                    obj.EXP_fecha_creacion = dt.Rows[i]["EXP_FECHA_CREACION"].ToString();
                    obj.EXP_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["EXP_ID_CENTRO_ATENCION"]);
                    obj.MAS_nombre = dt.Rows[i]["MAS_NOMBRE"].ToString();
                    obj.MAS_fecha_nacimiento = dt.Rows[i]["MAS_FECHA_NACIMIENTO"].ToString();
                    obj.MAS_sexo = dt.Rows[i]["MAS_SEXO"].ToString();
                    obj.MAS_color = dt.Rows[i]["MAS_COLOR"].ToString();
                    obj.DUE_nombre = dt.Rows[i]["DUE_NOMBRE"].ToString();
                    obj.DUE_apellido1 = dt.Rows[i]["DUE_APELLIDO1"].ToString();
                    obj.DUE_apellido2 = dt.Rows[i]["DUE_APELLIDO2"].ToString();
                    obj.DUE_celular = dt.Rows[i]["DUE_CELULAR"].ToString();
                    obj.DUE_telefono = dt.Rows[i]["DUE_TELEFONO"].ToString();
                    obj.DUE_email = dt.Rows[i]["DUE_EMAIL"].ToString();
                    obj.CEA_nombre = dt.Rows[i]["CEA_NOMBRE"].ToString();
                }

                return obj;
            }
            catch (Exception exc)
            {

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

            }
        }
Example #6
0
 public void UPD_Expediente(MOD_Expediente obj)
 {
     try
     {
         LOG_Expediente Logica = new LOG_Expediente();
         Logica.UPD_Expediente(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }