protected void lblFileUpload_Click(object sender, System.EventArgs e)
        {
            //create the object of EntityFrameworkEntities to call the file upload method
            EntityFrameworkEntities objEntityFrameworkEntities = new EntityFrameworkEntities();

            //upload the file to the database
            objEntityFrameworkEntities.UploadDocument(fupFileUploader.FileBytes);
        }
Example #2
0
        /// <summary>
        /// method to perform login
        /// </summary>
        /// <param name="userName">User Name of the User</param>
        /// <param name="password">Password of the User</param>
        public int UserLogin(string userName, string password)
        {
            //object of EntityFrameworkEntities class
            var context = new EntityFrameworkEntities();
            //match username and password
            var query = context.UserDetails.Where(p => p.UserName == userName && p.Password == password).FirstOrDefault();

            //if username password match then retrive the roleId
            if (query != null)
            {
                return(query.RoleId);
            }
            else
            {
                return(0);
            }
        }