Inheritance: BaseRepository, IAdminRepository
        //
        public Company GetCompnay(int companyId)
        {
            Company company = null;
            using (var conn = new SqlConnection(PrescienceRxConnectionString))
            {
                conn.Open();

                using (var cmd = new SqlCommand(GetCompanyByIdSp, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.Add("@CompanyId", System.Data.SqlDbType.Int);
                    cmd.Parameters["@CompanyId"].Value = companyId;

                    using (var myReader = cmd.ExecuteReader())
                    {
                        try
                        {
                            if (myReader.HasRows)
                            {
                                myReader.Read();
                                company = new Company(myReader);
                                AdminRepository admrep = new AdminRepository();
                                List<Module> modules = admrep.GetModulesByCompany(Convert.ToInt32(myReader["CompanyId"]));
                                company.LstModules = new List<int>();
                                foreach (var item in modules)
                                {
                                    company.LstModules.Add(item.ModuleId);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            // TODO Logg Error here
                        }
                    }
                }

            }
            return company;
        }
        public UserProfile GetUser(int userId)
        {
            UserProfile user = null;
            using (var conn = new SqlConnection(PrescienceRxConnectionString))
            {

                conn.Open();

                using (var cmd = new SqlCommand(GetUesrByIdSp, conn))
                {
                    cmd.CommandType = System.Data.CommandType.StoredProcedure;

                    cmd.Parameters.Add("@UserId", System.Data.SqlDbType.Int);
                    cmd.Parameters["@UserId"].Value = userId;

                    using (var myReader = cmd.ExecuteReader())
                    {
                        try
                        {
                            if (myReader.HasRows)
                            {
                                myReader.Read();
                                user = new UserProfile(myReader);
                                AdminRepository admrep = new AdminRepository();
                                List<Module> modules = admrep.GetModulesByUser(userId);
                                user.LstModules = new List<int>();
                                foreach (var item in modules)
                                {
                                    user.LstModules.Add(item.ModuleId);
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            // TODO Logg Error here
                        }
                    }
                }

            }

            return user;
        }
 //
 public List<Company> GetCompanies(string companyName)
 {
     var company = new List<Company>();
     AdminRepository admrep = new AdminRepository();
     using (var conn = new SqlConnection(PrescienceRxConnectionString))
     {
         conn.Open();
         using (var cmd = new SqlCommand(GetCompaniesSp, conn))
         {
             cmd.CommandType = CommandType.StoredProcedure;
             cmd.Parameters.Add("@Name", SqlDbType.VarChar);
             cmd.Parameters["@Name"].Value = companyName;
             using (var myReader = cmd.ExecuteReader())
             {
                 try
                 {
                     while (myReader.Read())
                     {
                         company.Add(new Company(myReader));
                         List<Module> modules = admrep.GetModulesByCompany(Convert.ToInt32(myReader["CompanyId"]));
                         company[company.Count - 1].LstModules = new List<int>();
                         foreach (var item in modules)
                         {
                             company[company.Count - 1].LstModules.Add(item.ModuleId);
                         }
                     }
                 }
                 catch (Exception ex)
                 {
                     // TODO Logg Error here
                 }
             }
         }
     }
     return company;
 }