⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 questionallot.aspx.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
字号:
namespace PowerEasy.WebSite.Admin.Crm.ServiceCenter
{
    using PowerEasy.Common;
    using PowerEasy.Controls;
    using PowerEasy.Crm;
    using PowerEasy.Model.Crm;
    using PowerEasy.UserManage;
    using PowerEasy.Web.UI;
    using System;
    using System.Text;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    public class QuestionAllot : AdminPage
    {
        protected Button BtnSave;
        protected ExtendedGridView EgvQuestionAllot;
        protected ListBox LstAdmin;
        protected ListBox LstQuestionType;
        protected ObjectDataSource OdsQuestionAllot;
        protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
        protected ScriptManager ScriptManager1;
        protected ExtendedSiteMapPath SmpNavigator;
        protected System.Web.UI.UpdatePanel UpdatePanel1;
        protected System.Web.UI.UpdatePanel UpdatePanel2;
        protected System.Web.UI.UpdatePanel UpnlAdminList;
        protected System.Web.UI.UpdatePanel UpnlQuestionType;

        protected void BtnSave_Click(object sender, EventArgs e)
        {
            if (base.IsValid)
            {
                int[] selectedIndices = this.LstAdmin.GetSelectedIndices();
                int[] numArray2 = this.LstQuestionType.GetSelectedIndices();
                StringBuilder builder = new StringBuilder();
                foreach (int num in selectedIndices)
                {
                    builder.Append(this.LstAdmin.Items[num].Value).Append(",");
                }
                PowerEasy.Crm.QuestionAllot.Delete(builder.ToString().TrimEnd(new char[] { ',' }));
                foreach (int num2 in selectedIndices)
                {
                    foreach (int num3 in numArray2)
                    {
                        PowerEasy.Crm.QuestionAllot.Add(DataConverter.CLng(this.LstQuestionType.Items[num3].Value), DataConverter.CLng(this.LstAdmin.Items[num2].Value));
                    }
                }
            }
            this.EgvQuestionAllot.DataBind();
        }

        protected void LstAdmin_SelectedIndexChanged(object sender, EventArgs e)
        {
            int[] selectedIndices = this.LstAdmin.GetSelectedIndices();
            this.LstQuestionType.ClearSelection();
            if (selectedIndices.Length == 1)
            {
                foreach (QuestionAllotInfo info in PowerEasy.Crm.QuestionAllot.GetListByAdminId(DataConverter.CLng(this.LstAdmin.Items[selectedIndices[0]].Value)))
                {
                    this.LstQuestionType.Items.FindByValue(info.TypeId.ToString()).Selected = true;
                }
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                this.LstAdmin.DataSource = Administrators.AdminList(0, 0);
                this.LstAdmin.DataBind();
                this.LstQuestionType.DataSource = QuestionType.GetTypeList();
                this.LstQuestionType.DataBind();
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -