private ShareFileClient() { Apps = new AppsEntity(this); Favorites = new FavoritesEntity(this); WebhookClients = new WebhookClientsEntity(this); WebhookSubscriptions = new WebhookSubscriptionsEntity(this); Workflows = new WorkflowsEntity(this); Policies = new PoliciesEntity(this); ConnectorGroups = new ConnectorGroupsEntity(this); EncryptedEmails = new EncryptedEmailsEntity(this); FileLock = new FileLockEntity(this); RemoteUploads = new RemoteUploadsEntity(this); Reports = new ReportsEntity(this); FolderTemplates = new FolderTemplatesEntity(this); AccessControls = new AccessControlsEntity(this); Accounts = new AccountsEntity(this); AsyncOperations = new AsyncOperationsEntity(this); Capabilities = new CapabilitiesEntity(this); Devices = new DevicesEntity(this); FavoriteFolders = new FavoriteFoldersEntity(this); Groups = new GroupsEntity(this); Items = new ItemsEntity(this); Metadata = new MetadataEntity(this); Sessions = new SessionsEntity(this); Shares = new SharesEntity(this); StorageCenters = new StorageCentersEntity(this); Users = new UsersEntity(this); Zones = new ZonesEntity(this); SamlMetadata = new SamlMetadataEntity(this); }
public tblAppUser RegisterUser(DevicesEntity deviceModel) { bool flag = false; List <tblAppUser> user = new List <tblAppUser>(); List <tblDevice> tblDevice = new List <tblDevice>(); try { user = _unitOfWork.AppUserRepo.Get(c => c.PhoneNumber.Equals(deviceModel.PhoneNumber)).ToList(); if (user.Count() > 0) { tblDevice = _unitOfWork.DeviceRepo.Get(c => c.EmailId.Equals(deviceModel.EmailId) && c.PhoneNumber.Equals(deviceModel.PhoneNumber)).ToList(); if (tblDevice.Count() == 0) { using (var scope = new TransactionScope()) { var TblDevice = new tblDevice { //Drowid = 1, DeviceId = deviceModel.DeviceId, EmailId = deviceModel.EmailId, PhoneNumber = deviceModel.PhoneNumber, SignPath = deviceModel.SignPath, }; _unitOfWork.DeviceRepo.Insert(TblDevice); _unitOfWork.Save(); scope.Complete(); } } flag = true; } if (flag) { return(user.FirstOrDefault()); } else { tblAppUser emptyUser = new tblAppUser(); return(emptyUser); } } catch (Exception ex) { CustomLogger.LogError("AuthRepository in RegisterUser " + Convert.ToString(ex.Message)); CustomLogger.SendExcepToDB(ex, "AuthRepository"); throw; } finally { } }
//public tblAppUser Register() //{ // string sPath = ""; // sPath = System.Web.Hosting.HostingEnvironment.MapPath("~/locker/"); // DevicesEntity deviceModel = new DevicesEntity(); // tblAppUser result = new tblAppUser(); // System.Web.HttpPostedFile hpf = HttpContext.Current.Request.Files["Image"]; // deviceModel.DeviceId = Convert.ToString(HttpContext.Current.Request.Form["DeviceId"]); // deviceModel.EmailId = Convert.ToString(HttpContext.Current.Request.Form["EmailId"]); // deviceModel.PhoneNumber = Convert.ToString(HttpContext.Current.Request.Form["PhoneNumber"]); // //deviceModel.SignPath = System.Text.Encoding.ASCII.GetBytes(HttpContext.Current.Request.Form["Image"]); // deviceModel.SignPath = null; // deviceModel.OTP = "999999"; // if (hpf != null) // { // try // { // // deviceModel.UserId = Convert.ToString(HttpContext.Current.Request.Form["UserId"]); // if (hpf.ContentLength > 0) // { // string fileType = hpf.ContentType; // Stream file_Strm = hpf.InputStream; // string file_Name = Path.GetFileName(hpf.FileName); // int fileSize = hpf.ContentLength; // byte[] fileRcrd = new byte[fileSize]; // file_Strm.Read(fileRcrd, 0, fileSize); // Stream fs = hpf.InputStream; // BinaryReader br = new BinaryReader(fs); // Byte[] bytes = br.ReadBytes((Int32)fs.Length); // deviceModel.SignPath = bytes; // } // result = _authRepository.RegisterUser(deviceModel); // return result; // } // catch (Exception ex) // { // throw new ApiDataException(2000, "Technical error occured, Please contact administrator", HttpStatusCode.InternalServerError); // } // } // else // { // throw new ApiDataException(1004, "Image is not selected", HttpStatusCode.InternalServerError); // } //} public tblAppUser Register() { string sPath = ""; sPath = System.Web.Hosting.HostingEnvironment.MapPath("~/locker/"); DevicesEntity deviceModel = new DevicesEntity(); tblAppUser result = new tblAppUser(); // System.Web.HttpPostedFile hpf = HttpContext.Current.Request.Files["Image"]; deviceModel.DeviceId = Convert.ToString(HttpContext.Current.Request.Form["DeviceId"]); deviceModel.EmailId = Convert.ToString(HttpContext.Current.Request.Form["EmailId"]); deviceModel.PhoneNumber = Convert.ToString(HttpContext.Current.Request.Form["PhoneNumber"]); deviceModel.SignPath = Convert.ToString(HttpContext.Current.Request.Form["Image"]); // deviceModel.SignPath = null; deviceModel.OTP = "999999"; // if (hpf != null) // { try { // deviceModel.UserId = Convert.ToString(HttpContext.Current.Request.Form["UserId"]); // if (hpf.ContentLength > 0) // { //string fileType = hpf.ContentType; //Stream file_Strm = hpf.InputStream; //string file_Name = Path.GetFileName(hpf.FileName); //int fileSize = hpf.ContentLength; //byte[] fileRcrd = new byte[fileSize]; //file_Strm.Read(fileRcrd, 0, fileSize); // Stream fs = hpf.InputStream; // BinaryReader br = new BinaryReader(fs); // Byte[] bytes = br.ReadBytes((Int32)fs.Length); // deviceModel.SignPath = bytes; // } result = _authRepository.RegisterUser(deviceModel); return(result); } catch (Exception ex) { throw new ApiDataException(2000, "Technical error occured, Please contact administrator", HttpStatusCode.InternalServerError); } // } //else // { // throw new ApiDataException(1004, "Image is not selected", HttpStatusCode.InternalServerError); // } }