protected void InsertAppData()
        {
            StringBuilder appDataSb = new StringBuilder();

            appDataSb.Append("window.appData = {");
            appDataSb.Append("dictionaries: {");
            appDataSb.Append("inputDocTypes: [" + FormatDictionaryList(InputDocType.GetAll(), "InputDocTypeID") + "], ");
            appDataSb.Append("inputMethods: [" + FormatDictionaryList(InputMethod.GetAll(), "InputMethodID") + "], ");
            appDataSb.Append("inputSigns: [" + FormatDictionaryList(InputSign.GetAll(), "InputSignID") + "], ");
            appDataSb.Append("inputSubjectTypes: [" + FormatDictionaryList(InputSubjectType.GetAll(), "InputSubjectTypeID") + "], ");
            appDataSb.Append("deliveryTypes: [" + FormatDictionaryList(DeliveryType.GetAll(), "DeliveryTypeID") + "] ,");
            appDataSb.Append("socialStatuses: [" + FormatDictionaryList(SocialStatus.GetAll(), "SocialStatusID") + "], ");
            appDataSb.Append("branchTypes: [" + FormatDictionaryList(BranchType.GetAll(), "BranchTypeID") + "], ");
            appDataSb.Append("socialCategories: [" + FormatDictionaryList(SocialCategory.GetAll(), "SocialCategoryID") + "], ");
            appDataSb.Append("cardStatuses: [" + FormatDictionaryList(CardStatus.GetAll(), "CardStatusID") + "], ");
            appDataSb.Append("labels: [" + FormatDictionaryList(Label.GetList(), "LabelID") + "], ");
            appDataSb.Append("docStatuses: [" + FormatDictionaryList(DocStatus.GetAll(), "DocStatusID") + "]");
            appDataSb.Append("}");
            appDataSb.Append("}");

            HtmlGenericControl scriptControl = new HtmlGenericControl("script");

            scriptControl.Attributes["type"] = "text/javascript";
            scriptControl.InnerHtml          = appDataSb.ToString();
            Page.Header.Controls.AddAt(0, scriptControl);
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddlSocialCategory.DataSource = SocialCategory.GetAll();
                ddlSocialCategory.DataBind();

                ddlBranchType.DataSource = BranchType.GetAll();
                ddlBranchType.DataBind();
            }
        }