public IUserModel GetByEmailAddress(string email)
        {
            UserModel model = null;

            SQLConnector.Retrieve(x => {
                x.CommandText = "dbo.Select_User_By_Email";
                x.Parameters.AddWithValue("@Email", email);
            },
                                  (DataRow dr) =>
            {
                if (dr != null)
                {
                    model = new UserModel
                    {
                        UserId      = dr.Field <int>("Id"),
                        DisplayName = dr.Field <String>("DisplayName"),
                        Email       = dr.Field <String>("Email"),
                        Password    = dr.Field <String>("Password"),
                        UserName    = dr.Field <String>("UserName")
                    };
                }
            });

            return(model);
        }
Beispiel #2
0
        public string Get(int imageId)
        {
            string base64 = string.Empty;

            SQLConnector.Retrieve(x =>
            {
                x.CommandText = "dbo.Get_Image_By_Id";
                x.Parameters.AddWithValue("@ImageId", imageId);
            },
                                  (DataRow dr) => {
                base64 = dr.Field <String>("Base64Image");
            });

            return(base64);
        }
Beispiel #3
0
        public PhotoEntryModel GetDetails(int photoId)
        {
            PhotoEntryModel model = null;

            SQLConnector.Retrieve(x =>
            {
                x.CommandText = "dbo.Get_Image_Details_By_Id";
                x.Parameters.AddWithValue("@ImageId", photoId);
            },
                                  (DataRow dr) => {
                model             = new PhotoEntryModel();
                model.PhotoId     = dr.Field <int>("Id");
                model.Base64      = dr.Field <String>("Base64Image");
                model.UploadDate  = dr.Field <DateTime>("UploadDateTime");
                model.VisitorName = dr.Field <String>("VisitorName");
            });

            return(model);
        }