Example #1
0
        public void CRE_Detalle_Visita(SqlCommand comando, MOD_Detalle_Visita obj)
        {
            try
            {
                string sp = "SP_CRE_Detalle_Visita";

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

                comando.Parameters.Add(new SqlParameter("@DVI_LINEA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_ID_VISTA_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_CENTRO_ATENCION", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_TRATAMIENTO", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_MEDICAMENTO", SqlDbType.Int));

                comando.Parameters[0].Value = obj.DVI_linea;
                comando.Parameters[1].Value = obj.DVI_id_visita_centro_atencion;
                comando.Parameters[2].Value = obj.DVI_id_centro_atencion;
                comando.Parameters[3].Value = obj.DVI_id_tratamiento;
                comando.Parameters[4].Value = obj.DVI_id_medicamento;

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

                throw exc;
            }
        }
 public void UPD_Detalle_Visita(MOD_Detalle_Visita obj)
 {
     try
     {
         this.IniciarTransaccion();
         AD_Detalle_Visita objDetalle_Visita = new AD_Detalle_Visita();
         objDetalle_Visita.UPD_Detalle_Visita(this.comando, obj);
         this.ConfirmarTransaccion();
     }
     catch (Exception exc)
     {
         this.DeshacerTransaccion();
         throw exc;
     }
 }
Example #3
0
        public MOD_Detalle_Visita SEL_Grid_By_Id_Detalle_Visita(SqlCommand comando, int codigo_linea, int codigo_visita_centro_atencion, int codigo_centro_atencion)
        {
            try
            {
                string sp = "SP_SEL_GRID_BY_ID_Detalle_Visita";

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

                comando.Parameters.Add(new SqlParameter("@DVI_LINEA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_ID_VISTA_CENTRO_VISITA", SqlDbType.Int));
                comando.Parameters.Add(new SqlParameter("@DVI_ID_CENTRO_ATENCION", SqlDbType.Int));

                comando.Parameters[0].Value = codigo_linea;
                comando.Parameters[1].Value = codigo_visita_centro_atencion;
                comando.Parameters[2].Value = codigo_centro_atencion;

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    obj.DVI_linea = Convert.ToInt32(dt.Rows[i]["DVI_LINEA"]);
                    obj.DVI_id_visita_centro_atencion = Convert.ToInt32(dt.Rows[i]["DVI_ID_VISOTA_CENTRO_ATENCION"]);
                    obj.DVI_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["DVI_ID_CENTRO_ATENCION"]);
                    obj.DVI_id_medicamento = Convert.ToInt32(dt.Rows[i]["DVI_ID_MEDICAMENTO"]);
                    obj.DVI_id_tratamiento = Convert.ToInt32(dt.Rows[i]["DVI_ID_TRATAMIENTO"]);
                }

                return obj;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #4
0
        public List<MOD_Detalle_Visita> SEL_Grid_Detalle_Visita(SqlCommand comando)
        {
            try
            {
                string sp = "SP_SEL_Grid_Detalle_Visita";

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

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

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

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    MOD_Detalle_Visita obj = new MOD_Detalle_Visita();
                    obj.DVI_linea = Convert.ToInt32(dt.Rows[i]["DVI_LINEA"]);
                    obj.DVI_id_visita_centro_atencion= Convert.ToInt32(dt.Rows[i]["DVI_ID_VISOTA_CENTRO_ATENCION"]);
                    obj.DVI_id_centro_atencion = Convert.ToInt32(dt.Rows[i]["DVI_ID_CENTRO_ATENCION"]);
                    obj.DVI_id_medicamento = Convert.ToInt32(dt.Rows[i]["DVI_ID_MEDICAMENTO"]);
                    obj.DVI_id_tratamiento = Convert.ToInt32(dt.Rows[i]["DVI_ID_TRATAMIENTO"]);
                    lista.Add(obj);
                }

                return lista;
            }
            catch (Exception exc)
            {

                throw exc;
            }
        }
Example #5
0
 public void UPD_Detalle_Visita(MOD_Detalle_Visita obj)
 {
     try
     {
         LOG_Detalle_Visita Logica = new LOG_Detalle_Visita();
         Logica.UPD_Detalle_Visita(obj);
     }
     catch (Exception )
     {
         throw ;
     }
 }
Example #6
0
        public Boolean CRE_Detalle_Visita(MOD_Detalle_Visita obj)
        {
            try
            {
                LOG_Detalle_Visita Logica = new LOG_Detalle_Visita();
                Logica.CRE_Detalle_Visita(obj);
                return true;
            }
            catch (Exception )
            {
                return false;
                throw ;

            }
        }