Example #1
0
 public SelectLanguageForm(SelectedLanguages language)
 {
     InitializeComponent();
     String serverPath = EFClientTools.DesignClientUtility.GetServerPath();
     EFBase.MessageProvider provider = new EFBase.MessageProvider(serverPath, EFClientTools.DesignClientUtility.ClientInfo.Locale);
     String message = provider["Srvtools/MultiLanguage/languages"];
     this.checkedListBoxLanguages.Items.AddRange(message.Split(';'));
     Languages = language;
 }
Example #2
0
        protected override void Render(HtmlTextWriter writer)
        {
            if (!this.DesignMode)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID);
                writer.AddAttribute(JQProperty.DataOverlayTheme, Theme);
                writer.AddAttribute(JQProperty.DataRole, JQDataRole.Page);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                var formTheme = Theme;

                writer.AddAttribute(JQProperty.DataRole, JQDataRole.Header);
                if (!string.IsNullOrEmpty(formTheme))
                {
                    writer.AddAttribute(JQProperty.DataTheme, formTheme);
                }
                writer.RenderBeginTag(HtmlTextWriterTag.Div);
                if (!string.IsNullOrEmpty(Title))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.H1);
                    writer.Write(Title);
                    writer.RenderEndTag();
                }
                writer.RenderEndTag();

                if (!string.IsNullOrEmpty(formTheme))
                {
                    writer.AddAttribute(JQProperty.DataTheme, formTheme);
                }
                writer.AddAttribute(JQProperty.DataRole, JQDataRole.Content);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (!string.IsNullOrEmpty(formTheme))
                {
                    writer.AddAttribute(JQProperty.DataTheme, formTheme);
                }
                writer.AddAttribute(HtmlTextWriterAttribute.Class, JQClass.Form);
                writer.AddAttribute(JQProperty.DataOptions, DataOptions);
                writer.RenderBeginTag(HtmlTextWriterTag.Div);

                if (IsShowFlowIcon && (this.Page.Request.QueryString["LISTID"] != null ||
                    this.Page.Request.QueryString["NAVMODE"] != null &&
                    (this.Page.Request.QueryString["NAVMODE"].ToString() == "Insert"
                    || this.Page.Request.QueryString["NAVMODE"].ToString() == "Modify"
                    || this.Page.Request.QueryString["NAVMODE"].ToString() == "Prepare"
                    || this.Page.Request.QueryString["NAVMODE"].ToString() == "Inquery")))
                {
                    writer.RenderBeginTag(HtmlTextWriterTag.Table);

                    String messageKey = "FLClientControls/FLNavigator/NavText";
                    EFBase.MessageProvider provider = new EFBase.MessageProvider(this.Page.Request.PhysicalApplicationPath, EFClientTools.ClientUtility.ClientInfo.Locale);
                    string[] flowTexts = provider[messageKey].Split(';');

                    InitStates();

                    writer.RenderBeginTag(HtmlTextWriterTag.Tr);
                    //writer.AddAttribute(HtmlTextWriterAttribute.Colspan, (HorizontalColumnsCount * 2).ToString());
                    writer.AddAttribute(HtmlTextWriterAttribute.Align, "left");
                    if (IsControlVisible("Submit"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        //<a id="aInbox" data-role="button" data-theme="b" data-mini="true" onclick="gotoInbox()">待办事项</a>
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowSubmit");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[16]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-FlowSubmit");
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Submit");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:80px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowSubmit");
                        if (this.CurrentFLState == "Continue")
                        {
                            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doApprove('{0}', '{1}')", this.ID, flowTexts[17]));
                        }
                        else
                        {
                            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doSubmit('{0}', '{1}')", this.ID, flowTexts[16]));
                        }
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[16]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Approve") && (string.IsNullOrEmpty(this.Page.Request.QueryString["PLUSROLES"]) || this.Page.Request.QueryString["PLUSROLES"].ToLower() == "null"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowApprove");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[17]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Approve");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowApprove");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doApprove('{0}', '{1}')", this.ID, flowTexts[17]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[17]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Return") && this.Page.Request.QueryString["FLNAVIGATOR_MODE"] != "0" && (string.IsNullOrEmpty(this.Page.Request.QueryString["PLUSROLES"]) || this.Page.Request.QueryString["PLUSROLES"].ToLower() == "null"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowReturn");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[18]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Return");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowReturn");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doReturn('{0}', '{1}')", this.ID, flowTexts[18]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[18]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Reject"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowReject");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[19]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Reject");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowPause");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doReject('{0}', '{1}')", this.ID, flowTexts[19]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[19]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Plus"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowPlus");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[22]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Plus");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowPause");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Plus')");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doPlusApprove('{0}', '{1}')", this.ID, flowTexts[22]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[22]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (!IsNotifyOFF && IsControlVisible("Notify"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowNotify");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[20]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Notify");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowNotify");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doNotify('{0}', '{1}')", this.ID, flowTexts[20]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[20]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("FlowDelete"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowDelete");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[21]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-FlowDelete");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowDelete");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doFlowDelete('{0}', '{1}')", this.ID, flowTexts[21]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[21]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Pause"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowPause");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[23]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Pause");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowPause");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doPause('{0}', '{1}')", this.ID, flowTexts[23]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[23]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }

                    if (IsControlVisible("Comment"))
                    {
                        writer.RenderBeginTag(HtmlTextWriterTag.Td);
                        writer.AddAttribute(HtmlTextWriterAttribute.Id, "FlowComment");
                        writer.AddAttribute(HtmlTextWriterAttribute.Title, flowTexts[24]);
                        writer.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:void(0)");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton);
                        writer.AddAttribute("data-role", "button");
                        writer.AddAttribute("data-theme", "b");
                        writer.AddAttribute("data-mini", "true");
                        writer.AddAttribute("iconcls", "icon-flow-Comment");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Style, "display:inline-block;width:26px;height:26px;cursor:pointer;padding:2px;");
                        //writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.LinkButton + " infosysbutton-FlowComment");
                        writer.AddAttribute(HtmlTextWriterAttribute.Onclick, string.Format("doComment('{0}', '{1}')", this.ID, flowTexts[24]));
                        //writer.RenderBeginTag(HtmlTextWriterTag.Span);
                        writer.RenderBeginTag(HtmlTextWriterTag.A);
                        writer.Write(flowTexts[24]);
                        writer.RenderEndTag();
                        writer.RenderEndTag();//td
                    }
                    writer.RenderEndTag();//tr

                    writer.RenderEndTag();//Table
                }

                var jqDefault = this.Parent.Controls.OfType<JQDefault>().FirstOrDefault(c => c.BindingObjectID == this.ID);
                var jqValidate = this.Parent.Controls.OfType<JQValidate>().FirstOrDefault(c => c.BindingObjectID == this.ID);
                var jqAutoSeq = this.Parent.Controls.OfType<JQAutoSeq>().FirstOrDefault(c => c.BindingObjectID == this.ID);
                if (jqAutoSeq == null && this.Parent.Parent != null)
                {
                    jqAutoSeq = this.Parent.Parent.Controls.OfType<JQAutoSeq>().FirstOrDefault(c => c.BindingObjectID == this.ID);
                }

                foreach (var column in this.Columns)
                {
                    var relationColumn = this.RelationColumns.FirstOrDefault(c => c.FieldName == column.FieldName);
                    if (relationColumn != null)
                    {
                        column.Default = relationColumn.Value;
                    }
                    else if (jqDefault != null)
                    {
                        var defaultColumn = jqDefault.Columns.FirstOrDefault(c => c.FieldName == column.FieldName);
                        if (defaultColumn != null)
                        {
                            column.Default = defaultColumn.Value;
                        }
                    }
                    if (jqValidate != null)
                    {
                        var validateColumn = jqValidate.Columns.FirstOrDefault(c => c.FieldName == column.FieldName);
                        if (validateColumn != null)
                        {
                            column.Validate = validateColumn.Value;
                        }
                    }
                    if (jqAutoSeq != null)
                    {
                        if (jqAutoSeq.FieldName == column.FieldName)
                        {
                            column.AutoSeq = jqAutoSeq.Value;
                        }
                    }
                    column.Render(writer);
                }
                writer.RenderEndTag();

                JQScriptManager.RenderPopup(writer, string.Format("{0}_popup", ID));
                //var popupID = string.Format("{0}_popup", ID);
                //writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-content");
                //writer.AddAttribute(HtmlTextWriterAttribute.Id, popupID);
                //writer.AddAttribute(JQProperty.DataRole, JQDataRole.Popup);
                //writer.AddAttribute(JQProperty.DataTheme, JQDataTheme.D);
                //writer.AddAttribute(JQProperty.DataOverlayTheme, JQDataTheme.A);
                //writer.RenderBeginTag(HtmlTextWriterTag.Div);
                // //<a href="#" data-rel="back" data-role="button" data-theme="a" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>
                //writer.AddAttribute(JQProperty.DataRel, "back");
                //writer.AddAttribute(JQProperty.DataRole, JQDataRole.Button);
                //writer.AddAttribute(JQProperty.DataIcon, JQDataIcon.Delete);

                //writer.AddAttribute(JQProperty.DataIconPos, JQDataIconPos.NoText);
                //writer.AddAttribute(HtmlTextWriterAttribute.Class, "ui-btn-right");
                //writer.RenderBeginTag(HtmlTextWriterTag.A);
                //writer.Write("Close");
                //writer.RenderEndTag();
                //writer.RenderBeginTag(HtmlTextWriterTag.P);
                //writer.RenderEndTag();
                //writer.RenderEndTag();

                writer.RenderEndTag();

                writer.RenderEndTag();

            }
        }