public IDataRepository CreateDataRepositorProxy() { return new FedoraCommonsRepo(FedoraUrl, FedoraUserName, FedoraPassword, FedoraAccessUrl, FedoraManagementUrl, ConnectionString, FedoraNamespace); }
public static string DeleteModel(string pid) { pid = HttpContext.Current.Server.UrlDecode(pid); string response = "0"; var factory = new DataAccessFactory(); IDataRepository dal = factory.CreateDataRepositorProxy(); ContentObject co = dal.GetContentObjectById(pid, false); if (co != null && HttpContext.Current.User.Identity.IsAuthenticated && (co.SubmitterEmail.Equals(HttpContext.Current.User.Identity.Name, StringComparison.InvariantCultureIgnoreCase) || Website.Security.IsAdministrator())) { try { dal.DeleteContentObject(co); response = "1"; } catch { } } else if (!HttpContext.Current.User.Identity.IsAuthenticated) { HttpContext.Current.Response.StatusCode = 403; } dal.Dispose(); return response; }