Ejemplo n.º 1
0
 private void LoadDb()
 {
     if (database == null)
     {
         database = new AccessLayer(HttpContext.Current.Server.MapPath("App_Data\\Sqlite.db3"));
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Enables processing of HTTP Web requests by a custom HttpHandler that implements the <see cref="T:System.Web.IHttpHandler" /> interface.
        /// </summary>
        /// <param name="context">An <see cref="T:System.Web.HttpContext" /> object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) used to service HTTP requests.</param>
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                String url = Convert.ToString(context.Request.Url);
                this.AccessLayer = new AccessLayer();

                switch (context.Request.HttpMethod)
                {
                case "GET":
                    Read(context);
                    break;

                case "POST":
                    Create(context);
                    break;

                case "PUT":
                    Update(context);
                    break;

                case "DELETE":
                    Delete(context);
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                context.Response.Write(e.Message);
            }
        }
 public IEnumerable <T> GetAll(Expression <Func <T, bool> > filter = null)
 {
     if (filter != null)
     {
         return(AccessLayer.Set <T>().Where(filter));
     }
     return(DbSet);
 }
Ejemplo n.º 4
0
        public List <AdditionalUserDetails> GetAdditionalUserDetailsEF(Int32 userID)
        {
            var accessLayer = new AccessLayer();
            var additonal   = accessLayer.GetAdditionalUserDetailsEF(userID);

            return(additonal.Select(r => new AdditionalUserDetails()
            {
                Address = r.Address,
                Phone = (long)r.PhoneNumber
            }).ToList());
        }
Ejemplo n.º 5
0
        internal static Uri GetAuthenticationUri(Configuration configuration, ServerInfo server)
        {
            var uri = AccessLayer.GetImplicitGrantAuthenticationUri(
                AuthServer,
                "/oauth/authorize",
                DemoAppClientId,
                server.RemoteHostId.ToString(),
                "",
                configuration.Alias);

            return(uri);
        }
Ejemplo n.º 6
0
        public string RetriveVerificationKeyEF(string email)
        {
            var accessLayer = new AccessLayer();
            List <EmailVerification> emails = accessLayer.RetriveVerificationKeyEF(email);
            string code = "";

            foreach (EmailVerification item in emails)
            {
                code = item.ActivationCode;
            }
            return(code);
        }
Ejemplo n.º 7
0
        public bool CheckDoctorInDBEF(Int32 doctorID, Int32 userID)
        {
            var accessLayer = new AccessLayer();

            if (accessLayer.CheckDoctorInDBEF(doctorID, userID).Count == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 8
0
        public bool CheckCredentialEF(string email, string password)
        {
            var accessLayer = new AccessLayer();
            var credentials = accessLayer.CheckCredentialEF(email, password);

            if (credentials.Count == 1)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 9
0
        public string GetProfilePictureEF(Int32 userID)
        {
            var accessLayer = new AccessLayer();
            List <ProfilePicture> profilePic = new List <ProfilePicture>();

            profilePic = accessLayer.GetProfilePictureEF(userID);
            string url = "";

            foreach (ProfilePicture item in profilePic)
            {
                url = item.PictureURL;
            }
            return(url);
        }
Ejemplo n.º 10
0
        public List <UserDetailsModel> GetUserModelList(string email)
        {
            var accessLayer       = new AccessLayer();
            var credential        = accessLayer.GetUserDetailsFromCredentialEF(email);
            UserDetailsModel user = new UserDetailsModel();

            return(credential.Select(r => new UserDetailsModel()
            {
                userId = (int)r.UserID,
                firstName = r.FirstName,
                lastName = r.LastName,
                email = r.EmailID,
                password = r.Password
            }).ToList());
        }
Ejemplo n.º 11
0
        public List <ReportModel> GetReportBasedOnDateEF(string fromDate, string toDate, Int32 userID)
        {
            var accessLayer = new AccessLayer();
            var reports     = accessLayer.GetReportBasedOnDateEF(fromDate, toDate, userID);

            return(reports.Select(r => new ReportModel()
            {
                reportID = (int)r.ReportID,
                reportType = r.ReportType,
                date = r.Date,
                doctor = r.Doctor,
                hospital = r.Hospital,
                userID = (int)r.UserID,
                upload = r.FileURL
            }).ToList());
        }
Ejemplo n.º 12
0
        //Report
        public List <ReportModel> GetRepotDetailsOfUserEF(Int32 userID)
        {
            var accessLayer = new AccessLayer();
            var reports     = accessLayer.GetRepotDetailsOfUserEF(userID);

            return(reports.Select(r => new ReportModel()
            {
                reportID = (int)r.ReportID,
                reportType = r.ReportType,
                date = r.Date,
                doctor = r.Doctor,
                hospital = r.Hospital,
                userID = (int)r.UserID,
                upload = r.FileURL
            }).ToList());
        }
Ejemplo n.º 13
0
        public List <HospitalForTableModel> GetHospitalEF(Int32 ID)
        {
            var accessLayer = new AccessLayer();
            var hospitals   = accessLayer.GetHospital(ID);

            return(hospitals.Select(r => new HospitalForTableModel()
            {
                HospitalID = (int)r.HospitalID,
                HospitalName = r.HospitalName,
                EmailID = r.EmailID,
                Address = r.Address,
                Contact1 = (long)r.ContactNumber1,
                Contact2 = (long)r.ContactNumber2,
                PrimaryMark = r.PrimaryMark,
                UserID = (int)r.UserID
            }).ToList());
        }
Ejemplo n.º 14
0
        public static ServerInfo GetServer(string friendlyName)
        {
            var connection = ConnectionPreferenceType.CloudOnly;
            var response   = AccessLayer.Discovery(
                ResourceServer,
                friendlyName,
                ref connection,
                "",
                TimeSpan.FromSeconds(10d));

            return(new ServerInfo
            {
                FriendlyName = friendlyName,
                RemoteHostId = response.RemoteHostId,
                LocalIp = response.LocalHostIpAddress,
            });
        }
Ejemplo n.º 15
0
        public void UpdateDoctorInEF(DoctorDetailsModel docModel, Int32 userID)
        {
            var        accessLayer = new AccessLayer();
            UserDoctor udModel     = new UserDoctor();

            udModel.DoctorID          = docModel.doctorID;
            udModel.FirstName         = docModel.firstName;
            udModel.LastName          = docModel.lastName;
            udModel.EmailID           = docModel.email;
            udModel.RelatedHostpital  = docModel.relatedHospital;
            udModel.Specialty         = docModel.specialty;
            udModel.Address           = docModel.address;
            udModel.ContactNumber1    = docModel.contactNumber1;
            udModel.ContactNumber2    = docModel.contactNumber2;
            udModel.PrimaryDoctorMark = docModel.primaryDoctorMark;
            udModel.UserID            = docModel.userID;
            accessLayer.UpdateDoctorInEF(udModel, userID);
        }
Ejemplo n.º 16
0
        public List <DoctorForTable> GetDoctorListEF(Int32 ID)
        {
            var accessLayer = new AccessLayer();
            var doctors     = accessLayer.GetDoctors(ID);

            return(doctors.Select(r => new DoctorForTable()
            {
                DoctorID = (int)r.DoctorID,
                FirstName = r.FirstName,
                LastName = r.LastName,
                EmailID = r.EmailID,
                Address = r.Address,
                Specialty = r.Specialty,
                RelatedHospital = r.RelatedHostpital,
                ContactNumber1 = (long)r.ContactNumber1,
                ContactNumber2 = (long)r.ContactNumber2,
                PrimaryDoctorMark = r.PrimaryDoctorMark,
            }).ToList());
        }
Ejemplo n.º 17
0
        public void SetToken(Token newToken)
        {
            this.token = newToken;

            //
            // ACCESS DATA FROM NOAH
            //
            this.accessLayer = new AccessLayer(
                ConnectionHelper.ResourceServer,
                this.connectedServer.RemoteHostId.ToString(),
                ConnectionHelper.DemoAppClientId,
                DemoAppModuleId,
                token);
            var registration = this.accessLayer.RegisterApp(this.configuration.Alias, "0.1", "DemoApp");

            //
            // SUCCESSFULL CONNECTION
            //
            this.isConnected  = true;
            this.isConnecting = false;
            Connected(this, EventArgs.Empty);
        }
Ejemplo n.º 18
0
        //Entity Framework
        public bool CheckEmailVerificationEF(string email)
        {
            List <EmailVerification> emailList = new List <EmailVerification>();
            var  accessLayer = new AccessLayer();
            var  emailCheck  = accessLayer.CheckEmailVerificationEF(email);
            bool result      = false;

            emailList = emailCheck.Select(r => new EmailVerification()
            {
                EmailID            = r.EmailID,
                VarificationStatus = r.VarificationStatus,
                ActivationCode     = r.ActivationCode
            }).ToList();

            foreach (EmailVerification item in emailList)
            {
                if (item.VarificationStatus.Equals("verified"))
                {
                    result = true;
                }
            }
            return(result);
        }
Ejemplo n.º 19
0
        public List <string> GetSpecialistEF()
        {
            var accessLayer = new AccessLayer();

            return(accessLayer.GetSpecialistEF());
        }
 public async Task SaveChangesAsync()
 {
     await AccessLayer.SaveChangesAsync();
 }
Ejemplo n.º 21
0
        public void UpdatePrimaryMarkEF(Int32 userID, Int32 hospitalID)
        {
            var accessLayer = new AccessLayer();

            accessLayer.UpdatePrimaryMarkEF(userID, hospitalID);
        }
Ejemplo n.º 22
0
        }//Update Doctor Primary Mark

        public void UpdateDoctorPrimaryMarkEF(Int32 userID, Int32 doctorID)
        {
            var accessLayer = new AccessLayer();

            accessLayer.UpdateDoctorPrimaryMarkED(userID, doctorID);
        }
Ejemplo n.º 23
0
        public List <string> GetHospitalForDDLEF(Int32 userID)
        {
            var accessLayer = new AccessLayer();

            return(accessLayer.GetHospitalForDDLEF(userID));
        }
Ejemplo n.º 24
0
        //Enity FrameWork

        public void SetHospitalDetailsEF(HospitalDetailsModel hospital)
        {
            var accessLayer = new AccessLayer();

            accessLayer.AddNewHositalEF(hospital);
        }
Ejemplo n.º 25
0
        public void AddNewReportEF(ReportModel report)
        {
            var accessLayer = new AccessLayer();

            accessLayer.AddNewReportEF(report);
        }
Ejemplo n.º 26
0
        public void AddNewDoctorEF(DoctorDetailsModel doctor)
        {
            var accessLayer = new AccessLayer();

            accessLayer.AddNewDoctorEF(doctor);
        }
Ejemplo n.º 27
0
        public void UpdateHospitalDetailsEF(HospitalForTableModel hospital)
        {
            var accessLayer = new AccessLayer();

            accessLayer.UpdateHospitalDetailsEF(hospital);
        }
Ejemplo n.º 28
0
        public void DeleteDoctorDetailsEF(Int32 doctorID, Int32 userID)
        {
            var accessLayer = new AccessLayer();

            accessLayer.DeleteDoctorDetailsEF(doctorID, userID);
        }
Ejemplo n.º 29
0
        public ActionResult Index()
        {
            var results = AccessLayer.GetTypeData();

            return(View());
        }
Ejemplo n.º 30
0
        //EF Verifiaction Status and Key Setup
        public void SetVerificationKeyEF(string email, string status, string code)
        {
            var accessLayer = new AccessLayer();

            accessLayer.SetVerificationKeyEF(email, status, code);
        }