Exemplo n.º 1
0
        protected void FillPreview(object sender, DirectEventArgs e)
        {
            if (string.IsNullOrEmpty(templateId.SelectedItem.Value.ToString()) || string.IsNullOrEmpty(templateId.SelectedItem.Value.ToString()))
            {
                return;
            }
            TemplateBodyRecordRequest req = new TemplateBodyRecordRequest();

            req.TemplateId = Convert.ToInt32(templateId.SelectedItem.Value);
            req.LanguageId = Convert.ToInt32(langaugeId.SelectedItem.Value);
            RecordResponse <TemplateBody> resp = _administrationService.ChildGetRecord <TemplateBody>(req);

            if (!resp.Success)
            {
                Common.errorMessage(resp);
                return;
            }

            if (resp.result != null)
            {
                Panel1.Update(Server.UrlDecode(resp.result.textBody), true);
                pnlMaximumTamplate.Update(Server.UrlDecode(resp.result.textBody), true);
            }
        }
Exemplo n.º 2
0
        protected void ClosePreview(object sender, DirectEventArgs e)
        {
            string languageId = e.ExtraParams["languageId"];
            string teId       = e.ExtraParams["teId"];


            TemplateBody body = new TemplateBody()
            {
                languageId = Convert.ToInt32(languageId), teId = Convert.ToInt32(teId)
            };
            TemplateBodyRecordRequest req = new TemplateBodyRecordRequest()
            {
                LanguageId = Convert.ToInt32(languageId), TemplateId = Convert.ToInt32(teId)
            };
            RecordResponse <TemplateBody> r = _administrationService.ChildGetRecord <TemplateBody>(req);                      //Step 1 Selecting the object or building up the object for update purpose

            //Step 2 : saving to store

            //Step 3 :  Check if request fails
            if (!r.Success || r.result == null)//it maybe another check
            {
                X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                Common.errorMessage(r);;
                return;
            }

            bodyText.Text = r.result.textBody;
            body.textBody = r.result.textBody;
            //Step 2 : call setvalues with the retrieved object
            this.TemplateBodyForm.SetValues(body);



            this.TemplateBodyWindow.Show();
            templatePreviewWindow.Hide();
        }
Exemplo n.º 3
0
        protected void PoPuPBody(object sender, DirectEventArgs e)
        {
            string teId       = e.ExtraParams["teId"];
            string languageId = e.ExtraParams["languageId"];

            string type = e.ExtraParams["type"];

            switch (type)
            {
            case "imgEdit":
                //Step 1 : get the object from the Web Service
                TemplateBody body = new TemplateBody()
                {
                    languageId = Convert.ToInt32(languageId), teId = Convert.ToInt32(teId)
                };
                TemplateBodyRecordRequest req = new TemplateBodyRecordRequest()
                {
                    LanguageId = Convert.ToInt32(languageId), TemplateId = Convert.ToInt32(teId)
                };
                RecordResponse <TemplateBody> r = _administrationService.ChildGetRecord <TemplateBody>(req);                        //Step 1 Selecting the object or building up the object for update purpose

                //Step 2 : saving to store

                //Step 3 :  Check if request fails
                if (!r.Success || r.result == null)  //it maybe another check
                {
                    X.MessageBox.ButtonText.Ok = Resources.Common.Ok;
                    Common.errorMessage(r);;
                    return;
                }

                bodyText.Text = r.result.textBody;
                body.textBody = r.result.textBody;
                //Step 2 : call setvalues with the retrieved object
                this.TemplateBodyForm.SetValues(body);



                this.TemplateBodyWindow.Show();
                break;

            case "imgDelete":
                X.Msg.Confirm(Resources.Common.Confirmation, Resources.Common.DeleteOneRecord, new MessageBoxButtonsConfig
                {
                    Yes = new MessageBoxButtonConfig
                    {
                        //We are call a direct request metho for deleting a record
                        Handler = String.Format("App.direct.DeleteBody({0},{1})", teId, languageId),
                        Text    = Resources.Common.Yes
                    },
                    No = new MessageBoxButtonConfig
                    {
                        Text = Resources.Common.No
                    }
                }).Show();
                break;

            case "imgAttach":

                //Here will show up a winow relatice to attachement depending on the case we are working on
                break;

            default:
                break;
            }
        }