Esempio n. 1
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (!Check()) return;

            folder = XYECOM.Core.XYRequest.GetQueryString("folder");

            type = XYECOM.Core.XYRequest.GetQueryString("type");

            folder = folder.Replace("|", "/");

            if (type.Equals(""))
                templateInfo = XYECOM.Template.ShopAbout.GetItem(Server.MapPath("/templates/_shop/" + folder));
            else
                templateInfo = XYECOM.Template.ShopStyle.GetItem(folder);

            if (rdoAccessPublic.Checked)
            {
                templateInfo.Access = XYECOM.Template.ShopTemplateAccess.Public;

                if (rdoAllUser.Checked)
                    templateInfo.User = "******";
                else
                    templateInfo.User = GetSelectUserGroupValue();
            }
            else
            {
                templateInfo.Access = XYECOM.Template.ShopTemplateAccess.Private;
                templateInfo.User = this.txtUserIdList.Text.Trim().Replace("��", ",").Replace(",,", ",");
            }

            bool update = true;

            if(type.Equals(""))
                update = XYECOM.Template.ShopAbout.Update(folder, templateInfo);
            else
                update = XYECOM.Template.ShopStyle.Update(folder, templateInfo);

            if (!update)
            {
                this.lblMessage.Text = "����ʧ�ܣ�����ģ��Ŀ¼дȨ�ޣ�";
                return;
            }

            this.ClientScript.RegisterClientScriptBlock(GetType(), "", "<script type=\"text/javascript\">parent.ShopAboutSettingClose();</" + "" + "script>");
        }
Esempio n. 2
0
        private void PageInit()
        {
            this.lstUsers.Attributes.Add("ondblclick", "javascript:SelectUser(this,'txtUserIdList');");

            folder = XYECOM.Core.XYRequest.GetQueryString("folder");
            type = XYECOM.Core.XYRequest.GetQueryString("type");

            if (folder.Equals("")) throw new Exception("ģ���ȡ��ز�����������");

            string styleName = "";
            if (folder.IndexOf("|") != -1 || type.Equals("style"))
            {
                XYECOM.Template.ShopStyleInfo sInfo = XYECOM.Template.ShopStyle.GetItem(folder.Split('|')[0]);

                if (sInfo != null)
                {
                    styleName = sInfo.Name;
                }
            }

            folder = folder.Replace("|", "/");

            if (type.Equals(""))
                templateInfo = XYECOM.Template.ShopAbout.GetItem(Server.MapPath("/templates/_shop/" + folder));
            else
                templateInfo = XYECOM.Template.ShopStyle.GetItem(folder);

            if (templateInfo == null) throw new Exception("ģ�岻���ڻ��ѱ�ɾ����");

            if (type.Equals("style"))
                this.lblTemplateName.Text = styleName;
            else
            {
                if (!styleName.Equals("")) styleName = styleName + " > ";
                this.lblTemplateName.Text = styleName + ((XYECOM.Template.ShopAboutInfo)templateInfo).CName;
            }

            if (templateInfo.Access == XYECOM.Template.ShopTemplateAccess.Private)
            {
                rdoAccessPrivate.Checked = true;
                txtUserIdList.Text = templateInfo.User;

                trPublic.Visible = false;
                trPrivate.Visible = true;
            }
            else
            {
                trPublic.Visible = true;
                trPrivate.Visible = false;

                rdoAccessPublic.Checked = true;
                if (templateInfo.User.ToLower().Equals("all"))
                {
                    rdoAllUser.Checked = true;
                }
            }
        }