public async Task <IActionResult> CreateFolder([FromBody] FolderRequest folder)
        {
            if (string.IsNullOrEmpty(folder.Name))
            {
                return(StatusCode((int)HttpStatusCode.BadRequest));
            }

            try
            {
                GoNorthProject project = await _projectDbAccess.GetDefaultProject();

                FlexFieldFolder newFolder = new FlexFieldFolder {
                    ProjectId      = project.Id,
                    ParentFolderId = folder.ParentId,
                    Name           = folder.Name,
                    Description    = folder.Description
                };
                newFolder = await _folderDbAccess.CreateFolder(newFolder);

                await _timelineService.AddTimelineEntry(FolderCreatedEvent, folder.Name);

                return(Ok(newFolder.Id));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "Could not create folder {0}", folder.Name);
                return(StatusCode((int)HttpStatusCode.InternalServerError));
            }
        }
        public ActionResult <Folder> UpdateFolder([FromBody] FolderRequest folderRequest)
        {
            Folder folder = dbContext.Folder.Where(f => f.Id == folderRequest.id && f.UserId == folderRequest.userId).SingleOrDefault();

            folder.Name = folderRequest.newName;
            dbContext.SaveChanges();
            return(folder);
        }
        public async Task <IActionResult> UpdateFolder(string id, [FromBody] FolderRequest folder)
        {
            FlexFieldFolder loadedFolder = await _folderDbAccess.GetFolderById(id);

            loadedFolder.Name = folder.Name;

            await _folderDbAccess.UpdateFolder(loadedFolder);

            _logger.LogInformation("Folder was updated.");
            await _timelineService.AddTimelineEntry(FolderUpdatedEvent, folder.Name);

            return(Ok(id));
        }
Esempio n. 4
0
        public DirectoryModel AnalyseDirectory(FolderRequest request)
        {
            Logger.LogInformation($"Analyzing Directory '{request.Path}'...");

            if (ValidateDirectory(request))
            {
                directoryResult = new DirectoryModel(request.Path);
                DirSearch(request.Path, directoryResult);
            }

            Logger.LogInformation($"Directory analyzed successfully");

            return(directoryResult);
        }
        public ActionResult <Folder> CreateFolder([FromBody] FolderRequest folderRequest)
        {
            Folder folder = new Folder();

            dbContext.Users.Where(u => u.Id == folderRequest.userId).SingleOrDefault();
            folder.UserId = folderRequest.userId;
            //folder.Id= (long)folderRequest.id;
            folder.Name       = folderRequest.name;
            folder.CreatedOn  = DateTime.Now;
            folder.ModifiedOn = DateTime.Now;

            dbContext.Folder.Add(folder);
            dbContext.SaveChanges();
            return(folder);
        }
Esempio n. 6
0
        public void CreateFolder(string folderName)
        {
            FolderRequest request = new FolderRequest(client);

            request.name = folderName;

            var apiResponse = request.post();

            if (apiResponse.IsSuccess())
            {
                Console.WriteLine("Created folder, id: {0} name:{1}", apiResponse.Data.response.data[0].id, apiResponse.Data.response.data[0].name);
            }
            else
            {
                Console.WriteLine("ERROR: Unable to create folder.");
            }
        }
Esempio n. 7
0
        public IActionResult Delete([FromBody] FolderRequest request)
        {
            try {
                var res = request.CheckForValidRequest(this, HttpContext.Request.Method, typeof(FolderRequest).Name);
                if (res?.StatusCode == 400)
                {
                    return(res);
                }

                var directoryResult = this.DirectoryService.DeleteDirectory(request);
                return(Ok(directoryResult));
            } catch (Exception ex) {
                var _ex = new Exception("Failed to Delete the Directory", ex);
                Logger.LogError(ex.Message, ex);
                return(StatusCode(500, _ex));
            }
        }
Esempio n. 8
0
        public bool ValidateDirectory(FolderRequest request)
        {
            Logger.LogInformation("Validating Directory...");
            var result = Directory.Exists(request.Path);

            if (result)
            {
                Logger.LogInformation($"Directory '{request.Path}' is valid");
            }
            else
            {
                Logger.LogError($"Directory '{request.Path}' is invallid");
                throw new Exception($"Directory '{request.Path}' is invallid");
            }

            return(result);
        }
Esempio n. 9
0
        public void GetFolders()
        {
            FolderRequest request = new FolderRequest(client);

            var apiResponse = request.get();

            DisplayFolderItems(apiResponse);

            // If "next" is not null, then there are more records that can be retrieved.
            // Retrieve all the available folders.
            while (apiResponse.Data.response.next != null)
            {
                request.start = apiResponse.Data.response.next.ToString();
                apiResponse   = request.get();
                DisplayFolderItems(apiResponse);
            }
        }
Esempio n. 10
0
        public async Task SaveWithServerAsync(Folder folder)
        {
            var            request = new FolderRequest(folder);
            FolderResponse response;

            if (folder.Id == null)
            {
                response = await _apiService.PostFolderAsync(request);

                folder.Id = response.Id;
            }
            else
            {
                response = await _apiService.PutFolderAsync(folder.Id, request);
            }
            var userId = await _stateService.GetActiveUserIdAsync();

            var data = new FolderData(response, userId);

            await UpsertAsync(data);
        }
Esempio n. 11
0
        public async Task <ApiResult <FolderResponse> > SaveAsync(Folder folder)
        {
            ApiResult <FolderResponse> response = null;
            var request = new FolderRequest(folder);

            if (folder.Id == null)
            {
                response = await _folderApiRepository.PostAsync(request);
            }
            else
            {
                response = await _folderApiRepository.PutAsync(folder.Id, request);
            }

            if (response.Succeeded)
            {
                var data = new FolderData(response.Result, _authService.UserId);
                if (folder.Id == null)
                {
                    await _folderRepository.InsertAsync(data);

                    folder.Id = data.Id;
                }
                else
                {
                    await _folderRepository.UpdateAsync(data);
                }
            }
            else if (response.StatusCode == System.Net.HttpStatusCode.Forbidden ||
                     response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
            {
                _authService.LogOut();
            }

            return(response);
        }
Esempio n. 12
0
 public async Task <FolderResponse> PutFolderAsync(string id, FolderRequest request)
 {
     return(await SendAsync <FolderRequest, FolderResponse>(HttpMethod.Put, string.Concat("/folders/", id),
                                                            request, true, true));
 }
Esempio n. 13
0
 public Task <FolderResponse> PostFolderAsync(FolderRequest request)
 {
     return(SendAsync <FolderRequest, FolderResponse>(HttpMethod.Post, "/folders", request, true, true));
 }
Esempio n. 14
0
 public bool DeleteDirectory(FolderRequest request)
 {
     return(deleteDirectory(request.Path));
 }
Esempio n. 15
0
        public void GetFolders()
        {
            FolderRequest request = new FolderRequest(client);
                
            var apiResponse = request.get();

            DisplayFolderItems(apiResponse);

            // If "next" is not null, then there are more records that can be retrieved.
            // Retrieve all the available folders.
            while (apiResponse.Data.response.next != null)
            { 
                request.start = apiResponse.Data.response.next.ToString();
                apiResponse = request.get();
                DisplayFolderItems(apiResponse);
            }
        }
Esempio n. 16
0
    private void Process_DoUpdate()
    {
        string sTerms = "";
        if (Request.Form[hdn_adb_action.UniqueID] == "prop")
        {

            this._OldTemplateName = m_refContentApi.GetTemplatesByFolderId(m_iID).FileName;
            _DiscussionBoard.Id = m_iID;
            _DiscussionBoard.Name = (string)(Request.Form[txt_adb_boardname.UniqueID].Trim(".".ToCharArray()));
            _DiscussionBoard.Title = Request.Form[txt_adb_title.UniqueID];

            //BreadCrumb/SiteMapPath update.
            if ((Request.Form["hdnInheritSitemap"] != null) && (Request.Form["hdnInheritSitemap"].ToString().ToLower() == "true"))
            {
                _DiscussionBoard.SitemapInherited = Convert.ToInt32(true);
            }
            else
            {
                _DiscussionBoard.SitemapInherited = Convert.ToInt32(false);
                _DiscussionBoard.SitemapPath = Utilities.DeserializeSitemapPath(Request.Form, this.ContentLanguage);
            }

            _DiscussionBoard.AcceptedHTML = this.ProcessCSV(Request.Form[txt_acceptedhtml.UniqueID], "html");
            _DiscussionBoard.AcceptedExtensions = this.ProcessCSV(Request.Form[txt_acceptedextensions.UniqueID], "ext");

            if (Request.Form[chk_adb_mc.UniqueID] != null && Request.Form[chk_adb_mc.UniqueID] != "")
            {
                _DiscussionBoard.ModerateComments = true;
            }
            else
            {
                _DiscussionBoard.ModerateComments = false;
            }
            if (Request.Form[chk_adb_ra.UniqueID] != null && Request.Form[chk_adb_ra.UniqueID] != "")
            {
                _DiscussionBoard.RequireAuthentication = true;
            }
            else
            {
                _DiscussionBoard.RequireAuthentication = false;
            }
            if (Request.Form[chk_lock_board.UniqueID] != null && Request.Form[chk_lock_board.UniqueID] != "")
            {
                _DiscussionBoard.LockBoard = true;
            }
            else
            {
                _DiscussionBoard.LockBoard = false;
            }
            // handle dynamic replication properties
            if ((Request.Form[chk_repl.UniqueID] != null && Request.Form[chk_repl.UniqueID] != "") || (Request.Form["EnableReplication"] != null && Request.Form["EnableReplication"] == "1"))
            {
                _DiscussionBoard.ReplicationMethod = 1;
            }
            else
            {
                _DiscussionBoard.ReplicationMethod = 0;
            }
            sTerms = (string)_Editor.Content;
            if (!(Request.Form["content_html_action"] == null))
            {
                sTerms = Context.Server.HtmlDecode(sTerms);
            }
            _DiscussionBoard.TermsAndConditions = sTerms;
            _DiscussionBoard.StyleSheet = Request.Form[txt_adb_stylesheet.UniqueID];
            if (Information.IsNumeric(Request.Form[txt_maxfilesize.UniqueID]) && Convert.ToInt32(Request.Form[txt_maxfilesize.UniqueID]) > 0)
            {
                _DiscussionBoard.MaxFileSize = Convert.ToInt32(Request.Form[txt_maxfilesize.UniqueID]);
            }
            else
            {
                _DiscussionBoard.MaxFileSize = 0;
            }

            _DiscussionBoard.TaxonomyInherited = false;

            if ((Request.Form["CategoryRequired"] != null) && Request.Form["CategoryRequired"].ToString().ToLower() == "on")
            {
                _DiscussionBoard.CategoryRequired = true;
            }
            else
            {
                _DiscussionBoard.CategoryRequired = Convert.ToBoolean(Convert.ToInt32(Request.Form[parent_category_required.UniqueID]));
            }

            if (Request.Form["taxlist"] == null || Request.Form["taxlist"].Trim().Length == 0)
            {
                _DiscussionBoard.CategoryRequired = false;
            }

            string IdRequests = "";
            if ((Request.Form["taxlist"] != null) && Request.Form["taxlist"] != "")
            {
                IdRequests = Request.Form["taxlist"];
            }

            //dbBoard.TaxonomyInheritedFrom = Convert.ToInt32(Request.Form(inherit_taxonomy_from.UniqueID))
            if (_GroupID != -1)
            {
                _EkContentRef.UpdateBoard(_DiscussionBoard, _GroupID);
            }
            else
            {
                _DiscussionBoard = _EkContentRef.UpdateBoard(_DiscussionBoard);

            }

            FolderRequest folder_request = new FolderRequest();
            _FolderData = m_refContentApi.GetFolderById(m_iID);

            //@folderid int,
            //@foldername nvarchar(75),
            //@folderdescription nvarchar(255),
            //@stylesheet nvarchar(255),
            //@inheritmeta int,
            //@inheritmetafrom int,
            //@replicationflag int,
            //@productionhost nvarchar(510)='',
            //@staginghost nvarchar(510)='',
            //@inheritmetadata int,
            //@inheritmetadatafrom int,
            //@inherittaxonomy bit=0,
            //@inherittaxonomyfrom int=0,
            //@categoryrequired bit=0,
            //@catlanguage int=1033, ??
            //@catlist varchar(4000)=''

            folder_request.FolderId = _FolderData.Id;
            folder_request.FolderName = _FolderData.Name;
            folder_request.FolderDescription = _FolderData.Description;
            folder_request.StyleSheet = _FolderData.StyleSheet;
            folder_request.MetaInherited = _FolderData.MetaInherited;
            folder_request.MetaInheritedFrom = _FolderData.MetaInheritedFrom;
            //folder_request.EnableReplication = ??
            folder_request.DomainProduction = _FolderData.DomainProduction;
            folder_request.DomainStaging = _FolderData.DomainStaging;
            folder_request.MetaInherited = _FolderData.MetaInherited;
            folder_request.TaxonomyInherited = false;
            folder_request.TaxonomyInheritedFrom = _FolderData.MetaInheritedFrom;
            folder_request.CategoryRequired = _FolderData.CategoryRequired;

            //Updating Board folder with Sitemap information.
            folder_request.SiteMapPath = _DiscussionBoard.SitemapPath;
            folder_request.SiteMapPathInherit = System.Convert.ToBoolean(_DiscussionBoard.SitemapInherited);
            //catlanguage ??
            folder_request.TaxonomyIdList = IdRequests;
            if (_GroupID != -1)
            {
                m_refContentApi.UpdateBoardForumFolder(folder_request, _GroupID);
            }
            else
            {
                m_refContentApi.UpdateFolder(folder_request);
            }

            ProcessContentTemplatesPostBack();
            if (usesModal)
            {
                Response.Redirect(m_refContentApi.ApplicationPath + "CloseThickbox.aspx", false);
            }
            else if (Request.Form[hdn_adb_boardname.UniqueID] == Request.Form[txt_adb_boardname.UniqueID])
            {
                Response.Redirect((string)("addeditboard.aspx?action=View&id=" + _DiscussionBoard.Id.ToString()), false);
            }
            else
            {
                Response.Redirect("../content.aspx?TreeUpdated=1&LangType=" + ContentLanguage + "&action=ViewBoard&id=" + m_iID.ToString() + "&reloadtrees=Forms,Content,Library", false);
            }

            //If Not (Request.Form("suppress_notification") <> "") Then
            //    m_refcontent.UpdateSubscriptionPropertiesForFolder(m_intFolderId, sub_prop_data)
            //    m_refcontent.UpdateSubscriptionsForFolder(m_intFolderId, page_subscription_data)
            //End If

        }
        else if (Request.Form[hdn_adb_action.UniqueID] == "cat")
        {
            Ektron.Cms.DiscussionCategory[] acCat = new DiscussionCategory[1];
            acCat[0] = new Ektron.Cms.DiscussionCategory();
            acCat[0].BoardID = m_iID;
            acCat[0].CategoryID = _CategoryId;
            acCat[0].Name = Request.Form[txt_catname.UniqueID];
            acCat[0].SetSortOrder(Convert.ToInt32(Request.Form[txt_catsort.UniqueID]));

            _EkContentRef.UpdateCategory(acCat);

            if (usesModal)
            {
                Response.Redirect("addeditboard.aspx?action=View&id=" + m_iID.ToString() + "&thickbox=true", false);
            }
            else
            {
                Response.Redirect("addeditboard.aspx?action=View&id=" + m_iID.ToString(), false);
            }

        }
        else if (Request.Form[hdn_adb_action.UniqueID] == "addcat")
        {
            Ektron.Cms.DiscussionCategory[] acCat = new DiscussionCategory[1];
            acCat[0] = new Ektron.Cms.DiscussionCategory();
            acCat[0].BoardID = m_iID;
            acCat[0].CategoryID = 0;
            acCat[0].Name = Request.Form[txt_catname.UniqueID];
            acCat[0].SetSortOrder(Convert.ToInt32(Request.Form[txt_catsort.UniqueID]));

            _EkContentRef.AddCategoryforBoard(acCat);

            Response.Redirect((string)("../content.aspx?action=ViewContentByCategory&id=" + m_iID.ToString()), false);
        }
        else if (Request.Form[hdn_adb_action.UniqueID] == "delcat")
        {
            _EkContentRef.DeleteBoardCategory(_CategoryId, Convert.ToInt64(Request.Form[drp_movecat.UniqueID]));
            Response.Redirect((string)("addeditboard.aspx?action=View&id=" + m_iID.ToString()), false);
        }
    }
Esempio n. 17
0
        public void CreateFolder(string folderName)
        {
            FolderRequest request = new FolderRequest(client);
            request.name = folderName;

            var apiResponse = request.post();
            if(apiResponse.IsSuccess())
            {
                Console.WriteLine("Created folder, id: {0} name:{1}", apiResponse.Data.response.data[0].id, apiResponse.Data.response.data[0].name);
            }
            else
            {
                Console.WriteLine("ERROR: Unable to create folder.");
            }
        }
Esempio n. 18
0
 public IActionResult Update(string uid, FolderRequest f) =>
 Repo
 .Update(uid, f.ToModel())
 .ToActionResult(x => ToGetSingleFolderReply(x));
Esempio n. 19
0
 public IActionResult Create(FolderRequest r) =>
 Repo
 .Create(r.ToModel())
 .ToActionResult(x => ToGetSingleFolderReply(x));
Esempio n. 20
0
    private void Process_DoAddCalendar()
    {
        Ektron.Cms.Content.Calendar.CalendarDal calapi = new Ektron.Cms.Content.Calendar.CalendarDal(_ContentApi.RequestInformationRef);
        FolderRequest calendar = new FolderRequest();
        string FolderPath;

        calendar.FolderName = (string)(Request.Form["foldername"].Trim(".".ToCharArray()));
        calendar.FolderDescription = Request.Form["folderdescription"];
        calendar.ParentId = _Id;
        if (Request.Form["TemplateTypeBreak"] == null)
        {
            calendar.TemplateFileName = Request.Form["templatefilename"];
        }
        else
        {
            calendar.TemplateFileName = "";
        }
        calendar.StyleSheet = Request.Form["stylesheet"];
        calendar.SiteMapPathInherit = System.Convert.ToBoolean((Request.Form["hdnInheritSitemap"] != null) && (Request.Form["hdnInheritSitemap"].ToString().ToLower() == "true"));
        calendar.SiteMapPath = Utilities.DeserializeSitemapPath(Request.Form, this._ContentLanguage);
        calendar.MetaInherited = System.Convert.ToInt32(((Request.Form["break_inherit_button"] != null) && Request.Form["break_inherit_button"].ToString().ToLower() == "on") ? 1 : 0);
        calendar.MetaInheritedFrom = Convert.ToInt64(Request.Form["inherit_meta_from"]);
        calendar.FolderCfldAssignments = Request.Form["folder_cfld_assignments"];
        calendar.XmlInherited = false;
        calendar.XmlConfiguration = "0";
        calendar.StyleSheet = Request.Form["stylesheet"];
        calendar.TaxonomyInherited = System.Convert.ToBoolean((Request.Form["TaxonomyTypeBreak"] != null) && Request.Form["TaxonomyTypeBreak"].ToString().ToLower() == "on");
        calendar.CategoryRequired = System.Convert.ToBoolean((Request.Form["CategoryRequired"] != null) && Request.Form["CategoryRequired"].ToString().ToLower() == "on");
        calendar.TaxonomyInheritedFrom = Convert.ToInt64(Request.Form[inherit_taxonomy_from.UniqueID]);
        calendar.AliasInherited = System.Convert.ToBoolean((Request.Form["chkInheritAliases"] != null) && Request.Form["chkInheritAliases"].ToString().ToLower() == "on");
        calendar.AliasInheritedFrom = Convert.ToInt64(Request.Form[inherit_alias_from.UniqueID]);
        calendar.AliasRequired = System.Convert.ToBoolean((Request.Form["chkForceAliasing"] != null) && Request.Form["chkForceAliasing"].ToString().ToLower() == "on");
        string IdRequests = "";
        if ((Request.Form["taxlist"] != null) && Request.Form["taxlist"] != "")
        {
            IdRequests = Request.Form["taxlist"];
        }
        calendar.TaxonomyIdList = IdRequests;
        calendar.FolderType = Convert.ToInt16(EkEnumeration.FolderType.Calendar);
        calendar.IsDomainFolder = false;
        calendar.DomainProduction = Request.Form["DomainProduction"];
        calendar.DomainStaging = Request.Form["DomainStaging"];
        calendar.SubscriptionProperties = new SubscriptionPropertiesData();
        calendar.SubscriptionProperties.BreakInheritance = System.Convert.ToBoolean(!string.IsNullOrEmpty((Request.Form["webalert_inherit_button"])) ? false : true);
        if (Request.Form["notify_option"] == ("Always"))
        {
            calendar.SubscriptionProperties.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Always;
        }
        else if (Request.Form["notify_option"] == ("Initial"))
        {
            calendar.SubscriptionProperties.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Initial;
        }
        else if (Request.Form["notify_option"] == ("Never"))
        {
            calendar.SubscriptionProperties.NotificationType = Ektron.Cms.Common.EkEnumeration.SubscriptionPropertyNotificationTypes.Never;
        }
        calendar.SubscriptionProperties.SuspendNextNotification = false;
        calendar.SubscriptionProperties.SendNextNotification = false;
        calendar.SubscriptionProperties.OptOutID = Convert.ToInt64(Request.Form["notify_optoutid"]);
        calendar.SubscriptionProperties.DefaultMessageID = (!string.IsNullOrEmpty(Request.Form["use_message_button"])) ? (Convert.ToInt64(Request.Form["notify_messageid"])) : 0;
        calendar.SubscriptionProperties.SummaryID = (!string.IsNullOrEmpty(Request.Form["use_summary_button"])) ? 1 : 0;
        calendar.SubscriptionProperties.ContentID = (!string.IsNullOrEmpty(Request.Form["use_content_button"])) ? (Convert.ToInt64(Request.Form["frm_content_id"])) : 0;
        calendar.SubscriptionProperties.UnsubscribeID = Convert.ToInt64(Request.Form["notify_unsubscribeid"]);
        calendar.SubscriptionProperties.URL = (string)((!string.IsNullOrEmpty(Request.Form["notify_url"])) ? (Request.Form["notify_url"]) : (Request.ServerVariables["HTTP_HOST"]));
        calendar.SubscriptionProperties.FileLocation = Server.MapPath(_ContentApi.AppPath + "subscriptions");
        calendar.SubscriptionProperties.WebLocation = (string)((!string.IsNullOrEmpty(Request.Form["notify_weblocation"])) ? (Request.Form["notify_weblocation"]) : "subscriptions");
        calendar.SubscriptionProperties.Subject = (string)((!string.IsNullOrEmpty(Request.Form["notify_subject"])) ? (Request.Form["notify_subject"]) : "");
        calendar.SubscriptionProperties.EmailFrom = (string)((!string.IsNullOrEmpty(Request.Form["notify_emailfrom"])) ? (Request.Form["notify_emailfrom"]) : "");
        calendar.SubscriptionProperties.UseContentTitle = "";
        calendar.SubscriptionProperties.UseContentLink = System.Convert.ToInt32((!string.IsNullOrEmpty(Request.Form["use_contentlink_button"])) ? 1 : 0);
        calendar.ContentSubAssignments = Request.Form["content_sub_assignments"];
        //-----------------IscontentSearchable-----------------------
        if (Request.Form["chkInheritIscontentSearchable"] != null && Request.Form["chkInheritIscontentSearchable"].ToString().ToLower() == "on")
        {
            calendar.IsContentSearchableInherited = true;
            if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on")
            {
                calendar.IscontentSearchable = true;
            }
            else
            {
                calendar.IscontentSearchable = (Request.Form[current_IscontentSearchable.UniqueID] == "1");
            }
        }
        else
        {
            calendar.IsContentSearchableInherited = false;
            if (Request.Form["chkIscontentSearchable"] != null && Request.Form["chkIscontentSearchable"].ToString().ToLower() == "on")
            {
                calendar.IscontentSearchable = true;
            }
            else
            {
                calendar.IscontentSearchable = false;
            }
        }
        calendar.IsContentSearchableInheritedFrom = long.Parse(Request.Form[inherit_IscontentSearchable_from.UniqueID]);
        //-----------------IsContentSearchable End-------------------
        //-------------------DisplaySettings--------------------
        int totalTabs = 0;
        if (Request.Form["chkInheritIsDisplaySettings"] != null && Request.Form["chkInheritIsDisplaySettings"].ToString().ToLower() == "on")
        {
            calendar.IsDisplaySettingsInherited = true;
            if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on"))
            {
                if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary;
                }
                if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData;
                }
                if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing;
                }
                if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule;
                }
                if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment;
                }
                if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates;
                }
                if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy;
                }
                calendar.DisplaySettings = totalTabs;
            }
            else
            {
                calendar.DisplaySettings = int.Parse(Request.Form[current_IsDisplaySettings.UniqueID]);
            }
        }
        else
        {
            calendar.IsDisplaySettingsInherited = false;
            if ((Request.Form["chkIsDisplaySettingsAllTabs"] != null && Request.Form["chkIsDisplaySettingsAllTabs"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on") || (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on"))
            {
                if (Request.Form["chkIsDisplaySettingsSummary"] != null && Request.Form["chkIsDisplaySettingsSummary"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Summary;
                }
                if (Request.Form["chkIsDisplaySettingsMetaData"] != null && Request.Form["chkIsDisplaySettingsMetaData"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.MetaData;
                }
                if (Request.Form["chkIsDisplaySettingsAliasing"] != null && Request.Form["chkIsDisplaySettingsAliasing"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Aliasing;
                }
                if (Request.Form["chkIsDisplaySettingsSchedule"] != null && Request.Form["chkIsDisplaySettingsSchedule"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Schedule;
                }
                if (Request.Form["chkIsDisplaySettingsComment"] != null && Request.Form["chkIsDisplaySettingsComment"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Comment;
                }
                if (Request.Form["chkIsDisplaySettingsTemplates"] != null && Request.Form["chkIsDisplaySettingsTemplates"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Templates;
                }
                if (Request.Form["chkIsDisplaySettingsTaxonomy"] != null && Request.Form["chkIsDisplaySettingsTaxonomy"].ToString().ToLower() == "on")
                {
                    totalTabs += (int)EkEnumeration.FolderTabDisplaySettings.Taxonomy;
                }
                calendar.DisplaySettings = totalTabs;
            }
            else
            {
                calendar.DisplaySettings = 1;
            }
        }
        calendar.DisplaySettingsInheritedFrom = long.Parse(Request.Form[inherit_IsDisplaySettings_from.UniqueID]);
        //-------------------DisplaySettingsEnd------------------
        long calendarid = calapi.AddCalendar(calendar);

        _CustomFieldsApi.ProcessCustomFields(calendarid);

        FolderPath = _ContentApi.EkContentRef.GetFolderPath(calendarid);
        if ((FolderPath.Substring(FolderPath.Length - 1, 1) == "\\"))
        {
            FolderPath = FolderPath.Substring(FolderPath.Length - (FolderPath.Length - 1));
        }
        FolderPath = FolderPath.Replace("\\", "\\\\");
        string close;
        close = Request.QueryString["close"];
        if (close == "true")
        {
            Response.Redirect("close.aspx", false);
        }
        else if (Request.Form[frm_callingpage.UniqueID] == "cmsform.aspx")
        {
            Response.Redirect((string)("cmsform.aspx?LangType=" + _ContentLanguage + "&action=ViewAllFormsByFolderID&folder_id=" + calendarid + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false);
        }
        else
        {
            Response.Redirect((string)("content.aspx?LangType=" + _ContentLanguage + "&action=ViewContentByCategory&id=" + calendarid + "&reloadtrees=Forms,Content,Library&TreeNav=" + FolderPath), false);
        }
    }