Exemple #1
0
        public void Invoke(object Sender, object Element)
        {
            if (Element is CommandParameters)
            {
                CommandParameters cp         = (CommandParameters)Element;
                PrimaryKeyId      key        = PrimaryKeyId.Parse(cp.CommandArguments["ObjectId"]);
                string            deleteType = cp.CommandArguments["DeleteType"];       // 0: org only; 1: org & contacts

                int           errorCount = 0;
                string        className  = OrganizationEntity.GetAssignedMetaClassName();
                DeleteRequest request    = new DeleteRequest(className, key);
                request.Parameters.Add(OrganizationRequestParameters.Delete_RelatedContactAction, (deleteType == "0") ? RelatedContactAction.Detach : RelatedContactAction.Delete);

                try
                {
                    BusinessManager.Execute(request);
                }
                catch (Exception ex)
                {
                    CHelper.GenerateErrorReport(ex);
                    errorCount++;
                }

                if (errorCount > 0)
                {
                    ((CommandManager)Sender).InfoMessage = CHelper.GetResFileString("{IbnFramework.Common:ActionWasNotProcessed}");
                }
                else
                {
                    ((Control)Sender).Page.Response.Redirect(CHelper.GetLinkEntityList(className));
                }
            }
        }
Exemple #2
0
        public void Invoke(object Sender, object Element)
        {
            object objectid        = CHelper.GetFromContext("ObjectId");
            object classNameObject = CHelper.GetFromContext("ClassName");

            if (objectid != null && classNameObject != null)
            {
                PrimaryKeyId key       = (PrimaryKeyId)objectid;
                string       className = (string)classNameObject;

                int errorCount = 0;
                try
                {
                    BusinessManager.Delete(className, key);
                }
                catch (Exception ex)
                {
                    CHelper.GenerateErrorReport(ex);
                    errorCount++;
                }

                if (errorCount > 0)
                {
                    ((CommandManager)Sender).InfoMessage = CHelper.GetResFileString("{IbnFramework.Common:ActionWasNotProcessed}");
                }
                else
                {
                    ((Control)Sender).Page.Response.Redirect(CHelper.GetLinkEntityList(className));
                }
            }
        }
        private void RedirectToList()
        {
            string link = CHelper.GetLinkEntityList(WorkflowDefinitionEntity.ClassName);

            if (!String.IsNullOrEmpty(link))
            {
                Response.Redirect(link);
            }
        }
Exemple #4
0
        private void BindToolbar()
        {
            MainBlockHeader.Title = CHelper.GetResFileString(MetaDataWrapper.GetMetaClassByName(ClassName).FriendlyName);

            MainBlockHeader.ClearLinks();

            //if (!String.IsNullOrEmpty(this.Page.Request["ViewName"]))
            //    MainBlockHeader.AddLink("Back To List", CHelper.GetLinkMetaViewShow(Request["ViewName"]));

            //SecurityService ss = ((BusinessObject)_bindObject).GetService<SecurityService>();
            //if (!(ss != null && !ss.CheckUserRight("Write")))
            //{
            MainBlockHeader.AddLink(
                "~/Images/IbnFramework/saveitem.gif",
                CHelper.GetResFileString("{IbnFramework.Global:_mc_Save}"),
                Page.ClientScript.GetPostBackClientHyperlink(btnSave, String.Empty, true)
                );

            string backLink;

            if (Back == "view" && ObjectId != PrimaryKeyId.Empty)
            {
                backLink = CHelper.GetLinkEntityView(ClassName, ObjectId.ToString());
            }
            else
            {
                if (ClassName == Mediachase.Ibn.Events.CalendarEventEntity.ClassName)
                {
                    backLink = "~/Apps/Calendar/Pages/Calendar.aspx";
                }
                else
                {
                    backLink = CHelper.GetLinkEntityList(ClassName);
                }
            }
            MainBlockHeader.AddLink(
                "~/Images/IbnFramework/cancel.gif",
                CHelper.GetResFileString("{IbnFramework.Global:_mc_Cancel}"),
                backLink);

//			if (Back
            //}

            //if (Mode.ToLower() == "popup")
            //    MainBlockHeader.AddLink("~/Images/IbnFramework/close.gif", GetGlobalResourceObject("IbnFramework.GlobalMetaInfo", "Close").ToString(), "javascript:window.close();");
        }
        private void BindToolbar()
        {
            if (template == null)
            {
                MainHeader.Title = GetGlobalResourceObject("IbnFramework.BusinessProcess", "NewTemplate").ToString();
            }
            else
            {
                MainHeader.Title = GetGlobalResourceObject("IbnFramework.BusinessProcess", "TemplateEditing").ToString();
            }

            string link = CHelper.GetLinkEntityList(WorkflowDefinitionEntity.ClassName);
            string text = CHelper.GetIconText(GetGlobalResourceObject("IbnFramework.Common", "Back").ToString(), ResolveClientUrl("~/Images/IbnFramework/cancel.GIF"));

            if (!String.IsNullOrEmpty(link))
            {
                MainHeader.AddLink(text, link);
            }
        }
Exemple #6
0
        protected void PublishButton_ServerClick(object sender, EventArgs e)
        {
            Page.Validate();
            if (!Page.IsValid || NodeIdField.Value == String.Empty)
            {
                return;
            }

            int order;

            if (!int.TryParse(ItemOrder.Text, out order))
            {
                order = 10000;
            }

            string   url = CHelper.GetLinkEntityList(ClassName);
            ListInfo li  = ListManager.GetListInfoByMetaClassName(ClassName);

            NavigationManager.AddNavigationItemForList(NodeIdField.Value, order, ItemText.Text, url, (int)li.PrimaryKeyId.Value);

            CHelper.CloseIt(Response);
        }
Exemple #7
0
        private void BindToolbar()
        {
            if (Request["ObjectId"] != ObjectId.ToString())
            {
                MainBlockHeader.Title = String.Format("{0} - {1}",
                                                      CHelper.GetResFileString(MetaDataWrapper.GetMetaClassByName(CalendarEventEntity.ClassName).FriendlyName),
                                                      GetGlobalResourceObject("IbnFramework.Calendar", "EditSeries").ToString());
            }
            else
            {
                MainBlockHeader.Title = CHelper.GetResFileString(MetaDataWrapper.GetMetaClassByName(CalendarEventEntity.ClassName).FriendlyName);
            }

            MainBlockHeader.ClearLinks();

            MainBlockHeader.AddLink(
                "~/Images/IbnFramework/saveitem.gif",
                CHelper.GetResFileString("{IbnFramework.Global:_mc_Save}"),
                Page.ClientScript.GetPostBackClientHyperlink(btnSave, String.Empty, true)
                );

            string backLink;

            if (Back == "view" && ObjectId != PrimaryKeyId.Empty)
            {
                backLink = CHelper.GetLinkEntityView(CalendarEventEntity.ClassName, Request["ObjectId"]);
            }
            else
            {
                backLink = CHelper.GetLinkEntityList(CalendarEventEntity.ClassName);
            }
            MainBlockHeader.AddLink(
                "~/Images/IbnFramework/cancel.gif",
                CHelper.GetResFileString("{IbnFramework.Global:_mc_Cancel}"),
                backLink);
        }