private void AddReport(FormCollection collection, CatalogModel content, LoginModel login)
 {
     try
     {
         content.ReportItem.FilePath = collection["ReportFilePath"];
         content.ReportItem.Name = collection["ReportName"];
         content.AddReport();
     }
     catch (Exception e)
     {
         content.Error = e;
     }
 }
 private void Delete(LoginModel login, CatalogModel content)
 {
     try
     {
         //Delete item in SRS
         content.DeleteItem(login.AuthenticationUser);
         RefreshCatalog(login, content);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
        private void RefreshCatalog(LoginModel login, CatalogModel content)
        {
            //Refresh the catalog model
            content = CatalogModel.GetCatalogItems(login.AuthenticationUser, content.SRSProxy);

            //Replace the catalog session with the updated one
            Session.Remove("Catalog");
            Session.Add("Catalog", content);
        }
        private bool SaveDatasource(FormCollection collection, CatalogModel content, LoginModel login)
        {
            try
            {
                string address = string.Empty;
                foreach (var item in content.DataSourceItem.itemProperties)
                {
                    item.Value = collection[item.PropertyName];
                }

                if (content.ItemType.Equals("Folder"))
                {
                    address = content.Path.Substring(content.Path.IndexOf('/'));
                }
                else
                {
                    address = content.Parent.Substring(content.Parent.IndexOf('/'));
                }

                content.SaveDataSource(login.AuthenticationUser, address);
                RefreshCatalog(login, content);
                return true;
            }
            catch (Exception e)
            {
                content.Error = e;
                return false;
            }
        }
示例#5
0
 public static void Logout(LoginModel login)
 {
     if (login != null)
     {
         login.AuthenticationUser.Dispose();
     }
     FormsAuthentication.SignOut();
 }