Editor.Scheduler.CMSCustomer.GetItemTitle C# (CSharp) Method

GetItemTitle() public method

public GetItemTitle ( int iditemamm, string type ) : string
iditemamm int
type string
return string
        public string GetItemTitle(int iditemamm, string type)
        {
            return CMSServices.GetItemTitle(iditemamm, type);
        }

Usage Example

Beispiel #1
0
        private static void Pubblica(Content content, CMSCustomer customer)
        {
            string fileserver = ConfigurationSettings.AppSettings["ServerPath"];

            string idcont = content.Contentid.ToString();
            string iditemamm = content.Iditem.ToString();
            string type = content.Repository;

            //Allineo lo stato del content
            ContentServices svc = new ContentServices();
            svc.SetStateContent(content.Contentid, (int)ContentStateEnum.Allineato);

            if (type == "std") {
                //Contenuti Standard
                //cms.CoreLib.Net1.validation validation = new cms.CoreLib.Net1.validation();

                string Title = customer.GetItemTitle(Convert.ToInt32(iditemamm), type);
                string pathIdItem = customer.GetItemPath(iditemamm, type);
                //   string pathIdItem = @"contenutiAdm\" + iditemamm;
                //   string response = string.Empty;
                EditorServices.PublicContent(Convert.ToInt32(idcont), pathIdItem, Title);

                //   response = "~/" + response.Replace("\\", "/");

                //Ricavo l'id Utente
                int iditemuser = Convert.ToInt32(customer.GetItemIdUser(Convert.ToInt32(iditemamm)));
                //cms.CoreLib.Net1.Item NewItem = new cms.CoreLib.Net1.Item();
                //OracleDataReader objReader = NewItem.GetItemContent(Convert.ToInt32(iditemamm));
                //objReader.Read();
                //if (objReader["corrispond_item_id"] != DBNull.Value) {
                //    iditemuser = Convert.ToInt32(objReader["corrispond_item_id"]);
                //    cms.CoreLib.Net1.Item NewItemUS = new cms.CoreLib.Net1.Item();
                //    OracleDataReader objReaderUS = NewItemUS.GetItemContent(iditemuser);
                //    objReaderUS.Read();
                //    if (objReaderUS["item_contents_id"] != DBNull.Value) {
                //        int CorrispondIDContentUS = Convert.ToInt32(objReaderUS["item_contents_id"]);
                //        NewItem.UpdContentStyle(CorrispondIDContentUS, 'F', "default.html");
                //    }
                //    objReaderUS.Close();
                //}
                //objReader.Close();
                string pathIdItemUser = @"contenuti\" + iditemuser;

                CopyDirectory(Path.Combine(fileserver, pathIdItem), Path.Combine(fileserver, pathIdItemUser), true);

                //LUCENE
                customer.IndexItem(iditemuser);
                //EAI
                customer.UpdStdDoc(iditemuser);

                //response = "~/" + @"contenuti/" + iditemuser + @"/default.html";

                //Response.Redirect(response);
            } else if (type == "com") {
                //Contenuti Commerciali

                //cms.Entities.Document doc = new cms.Entities.Document(Convert.ToInt32(iditemamm));
                //doc.Load();

                string Title = customer.GetItemTitle(Convert.ToInt32(iditemamm), type);
                //string pathIdItem = doc.View("");
                //string pathIdItemUser = "";
                //pathIdItemUser = pathIdItem = pathIdItem.Substring(0, pathIdItem.IndexOf("/Editor/")).Replace("/", @"\");
                //pathIdItemUser = pathIdItem + @"\";
                //pathIdItem = pathIdItem + @"\Admin";

                string pathIdItem = customer.GetItemPath(iditemamm, type);
                string pathIdItemUser = pathIdItem;// = pathIdItem.Substring(0, pathIdItem.IndexOf("/Editor/")).Replace("/", @"\");
                pathIdItemUser = pathIdItem + @"\";
                pathIdItem = pathIdItem + @"\Admin";
                string response = string.Empty;

                EditorServices.PublicContent(Convert.ToInt32(idcont), pathIdItem, Title);

                CopyDirectory(Path.Combine(fileserver, pathIdItem), Path.Combine(fileserver, pathIdItemUser), true);

                //EAI
                customer.UpdCommDoc(Convert.ToInt32(iditemamm));

                //pathIdItemUser = pathIdItemUser.Replace(@"\", "/");
                //response = "~/" + pathIdItemUser + @"/default.html";

                //Response.Redirect(response);
            }
        }