Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.MSN b_MSN = new BLL.MSN();
                Entity.MSN[] e_MSN = b_MSN.Select_MSN();

                string Href = WebConfigurationManager.AppSettings["MSN_herf"];
                string Link = WebConfigurationManager.AppSettings["MSN_link"];
                string Img_Herf = WebConfigurationManager.AppSettings["MSN_img_herf"];
                string Img_Link = WebConfigurationManager.AppSettings["MSN_img_link"];

                if (e_MSN != null)
                {
                    foreach (Entity.MSN o_MSN in e_MSN)
                    {
                        HyperLink o_HyperLink;
                        HtmlGenericControl o_HtmlGenericControl;

                        o_HyperLink = new HyperLink();
                        o_HyperLink.NavigateUrl = Href + o_MSN.MSN_Invitee + Link;
                        o_HyperLink.Text = "客服人员:" + o_MSN.MSN_Name;
                        o_HyperLink.CssClass = "nav8";
                        o_HyperLink.Target = "_blank";
                        o_HyperLink.Style.Add(HtmlTextWriterStyle.MarginLeft, "20px");
                        MSN_Controls.Controls.Add(o_HyperLink);

                        o_HtmlGenericControl = new HtmlGenericControl();
                        o_HtmlGenericControl.InnerHtml = "  ";
                        MSN_Controls.Controls.Add(o_HtmlGenericControl);

                        o_HyperLink = new HyperLink();
                        o_HyperLink.NavigateUrl = Href + o_MSN.MSN_Invitee + Link;
                        o_HyperLink.ImageUrl = Img_Herf + o_MSN.MSN_Invitee + Img_Link;
                        o_HyperLink.Target = "_blank";
                        MSN_Controls.Controls.Add(o_HyperLink);

                        o_HtmlGenericControl = new HtmlGenericControl();
                        o_HtmlGenericControl.InnerHtml = "<br/><br/>";
                        MSN_Controls.Controls.Add(o_HtmlGenericControl);
                    }
                }
            }
        }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BLL.MSN b_MSN = new BLL.MSN();
                Entity.MSN[] e_MSN = b_MSN.Select_MSN();

                if (e_MSN != null)
                {
                    int i = 1;
                    foreach (Entity.MSN o_MSN in e_MSN)
                    {
                        HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                        HtmlTableCell o_HtmlTableCell;
                        HtmlInputHidden o_HtmlInputHidden;
                        HtmlInputText o_HtmlInputText;
                        HtmlAnchor o_HtmlAnchor;
                        HtmlGenericControl o_HtmlGenericControl;

                        o_HtmlTableCell = new HtmlTableCell();
                        o_HtmlTableCell.InnerText = i.ToString();
                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                        o_HtmlTableCell = new HtmlTableCell();
                        o_HtmlInputHidden = new HtmlInputHidden();
                        o_HtmlInputHidden.ID = "MSN_ID_" + i.ToString();
                        o_HtmlInputHidden.Name = "MSN_ID_" + i.ToString();
                        o_HtmlInputHidden.Value = o_MSN.MSN_ID.ToString();
                        o_HtmlTableCell.Controls.Add(o_HtmlInputHidden);
                        o_HtmlInputText = new HtmlInputText();
                        o_HtmlInputText.ID = "MSN_Name_" + i.ToString();
                        o_HtmlInputText.Name = "MSN_Name_" + i.ToString();
                        o_HtmlInputText.Value = o_MSN.MSN_Name;
                        o_HtmlInputText.MaxLength = 20;
                        o_HtmlTableCell.Controls.Add(o_HtmlInputText);
                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                        o_HtmlTableCell = new HtmlTableCell();
                        o_HtmlInputText = new HtmlInputText();
                        o_HtmlInputText.ID = "MSN_Invitee_" + i.ToString();
                        o_HtmlInputText.Name = "MSN_Invitee_" + i.ToString();
                        o_HtmlInputText.Value = o_MSN.MSN_Invitee;
                        o_HtmlInputText.MaxLength = 40;
                        o_HtmlTableCell.Controls.Add(o_HtmlInputText);
                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                        o_HtmlTableCell = new HtmlTableCell();
                        o_HtmlAnchor = new HtmlAnchor();
                        o_HtmlAnchor.InnerText = "修改";
                        o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(2, " + i.ToString() + ")");
                        o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Cursor, "pointer");
                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);

                        o_HtmlGenericControl = new HtmlGenericControl();
                        o_HtmlGenericControl.InnerHtml = "&nbsp;&nbsp;";
                        o_HtmlTableCell.Controls.Add(o_HtmlGenericControl);

                        o_HtmlAnchor = new HtmlAnchor();
                        o_HtmlAnchor.InnerText = "删除";
                        o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(3, " + i.ToString() + ")");
                        o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Cursor, "pointer");
                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                        o_HtmlTableRow.Align = "center";
                        o_HtmlTableRow.Height = "30";

                        g_MainTable.Rows.Add(o_HtmlTableRow);

                        i++;
                    }
                }
            }
        }
Пример #3
0
        private void MSN_Delete()
        {
            BLL.MSN b_MSN = new BLL.MSN();
            b_MSN.Delete_MSN(MSN_ID);

            ResponseSuccess("删除成功", "MSN.aspx");
        }
Пример #4
0
        private void MSN_Insert()
        {
            BLL.MSN b_MSN = new BLL.MSN();
            b_MSN.Insert_MSN(MSN_Name, MSN_Invitee);

            ResponseSuccess("添加成功", "MSN.aspx");
        }
Пример #5
0
        private void MSN_Update()
        {
            BLL.MSN b_MSN = new BLL.MSN();
            b_MSN.Update_MSN(MSN_ID, MSN_Name, MSN_Invitee);

            ResponseSuccess("修改成功", "MSN.aspx");
        }