示例#1
0
        public List<M_GrupoSanguineo> GetAllGrupoSanguineo()
        {
            List<M_GrupoSanguineo> lst = new List<M_GrupoSanguineo>();
            string query = "SELECT * FROM T_GrupoSanguineo";
            DataTable dt = cnn.EjecutaQueryParam(query);
            try
            {
                if (dt != null)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        oGrupoS = new M_GrupoSanguineo();

                        oGrupoS.Id_GrupoS = Convert.ToInt32(row["Id_GrupoS"].ToString());
                        oGrupoS.GrupoS = row["GrupoS"].ToString();
                        lst.Add(oGrupoS);
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return lst;
        }
示例#2
0
        public M_GrupoSanguineo GetGrupoSanguineo(int Id_GrupoS)
        {
            string query = "SELECT * FROM T_GrupoSanguineo WHERE Id_GrupoS = '" + Id_GrupoS + "'";
            DataTable dt = cnn.EjecutaQueryParam(query);
            try
            {
                if (dt != null)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        oGrupoS = new M_GrupoSanguineo();
                        oGrupoS.Id_GrupoS = Convert.ToInt32(row["Id_GrupoS"].ToString());
                        oGrupoS.GrupoS = row["GrupoS"].ToString();

                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            return oGrupoS;
        }