Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            b_Knows = new BLL.Knows();

            if (!IsPostBack)
            {
                GetKnowsTXT(Knows_Name);
                SetLanguageControl(Knows_LanguageID);
                SetKnowsClassControl(Knows_ClassID);

                switch (g_Action_ID)
                {
                    case 1:
                        Knows_AddTime_TD.Visible = false;
                        Knows_Submit.Text = " 添加 ";
                        break;

                    case 2:
                        if (g_Knows_ID == 0)
                            ResponseError("参数错误");

                        e_Knows = b_Knows.Select_Knows(g_Knows_ID);
                        if (e_Knows != null)
                        {
                            Knows_LanguageID.SelectedValue = e_Knows.Knows_LanguageID.ToString();
                            Knows_ClassID.SelectedValue = e_Knows.Knows_ClassID.ToString();
                            Knows_Summary.Text = e_Knows.Knows_Summary;
                            Knows_Title.Text = e_Knows.Knows_Title;
                            Knows_Content.Value = e_Knows.Knows_Content;
                            Knows_AddTime.Text = e_Knows.Knows_AddTime.ToString();
                        }

                        Knows_Submit.Text = " 修改 ";
                        break;

                    case 3:
                        if (g_Knows_ID == 0)
                            ResponseError("参数错误");

                        b_Knows.Delete_Knows(g_Knows_ID);
                        ResponseClose("删除成功");
                        break;
                }
            }
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SetHyperLinkTitle(HyperLink_Title);
                SetHyperLinkKnowsClass(HyperLink_Knows_ClassID_1, HyperLink_Knows_ClassID_2, HyperLink_Knows_ClassID_3);

                BLL.Knows b_Knows = new BLL.Knows();
                Entity.Knows e_Knows = b_Knows.Select_Knows(g_Knows_ID);

                if (e_Knows != null)
                {
                    g_Knows_ClassID = e_Knows.Knows_ClassID;
                    SetHyperLinkKnows(HyperLink_Knows);

                    Knows_Content.InnerHtml += "<h1><strong>" + e_Knows.Knows_Title + "</strong></h1>";
                    Knows_Content.InnerHtml += e_Knows.Knows_Content;
                }
            }
        }
Beispiel #3
0
        private void GetKnows()
        {
            BLL.Knows b_Knows = new BLL.Knows();
            Entity.Knows[] e_Knows = b_Knows.Select_Knows(Convert.ToInt32(Knows_LanguageID.SelectedValue), Search_Content.Text, Convert.ToInt32(Search_Method.SelectedValue), g_PageSize, g_Page);
            if (e_Knows != null)
            {
                int i = 1;

                foreach (Entity.Knows o_Knows in e_Knows)
                {
                    HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                    HtmlTableCell o_HtmlTableCell;
                    HtmlAnchor o_HtmlAnchor;
                    HtmlGenericControl o_HtmlGenericControl;

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = ((g_Page - 1) * g_PageSize + i).ToString();
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = g_Language[o_Knows.Knows_LanguageID];
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = g_Knows[o_Knows.Knows_ClassID][0];
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Knows.Knows_Title;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

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

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlAnchor = new HtmlAnchor();
                    o_HtmlAnchor.HRef = "#";
                    o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(2, " + o_Knows.Knows_ID.ToString() + ", " + g_Knows_ClassID.ToString() + ");return false;");
                    o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                    o_HtmlAnchor.InnerText = "修改";
                    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.HRef = "#";
                    o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(3, " + o_Knows.Knows_ID.ToString() + ", " + g_Knows_ClassID.ToString() + ");return false;");
                    o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2");
                    o_HtmlAnchor.InnerText = "删除";
                    o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableRow.Align = "center";
                    o_HtmlTableRow.Style.Add(HtmlTextWriterStyle.Height, "30px");

                    g_MainTable.Rows.Add(o_HtmlTableRow);

                    i++;
                }

                Current_Page.Text = g_Page.ToString();
                Total_Page.Text = b_Knows.g_TotalPage.ToString();
                Total_Count.Text = b_Knows.g_TotalCount.ToString();

                if (g_Page > 1)
                {
                    Previous_Page.Visible = true;
                    Previous_Page.CommandArgument = (g_Page - 1).ToString();
                }
                else
                {
                    Previous_Page.Visible = false;
                }

                if (g_Page < b_Knows.g_TotalPage)
                {
                    Next_Page.Visible = true;
                    Next_Page.CommandArgument = (g_Page + 1).ToString();
                }
                else
                {
                    Next_Page.Visible = false;
                }

                Current_Page.Visible = true;
                Splite_Page.Visible = true;
                Total_Page.Visible = true;
            }
            else
            {
                Current_Page.Visible = false;
                Splite_Page.Visible = false;
                Total_Page.Visible = false;
                Total_Count.Text = "0";
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SetHyperLinkTitle(HyperLink_Title);
                SetHyperLinkKnows(HyperLink_Knows);

                SetHyperLinkKnowsClass(HyperLink_Knows_ClassID_1, HyperLink_Knows_ClassID_2, HyperLink_Knows_ClassID_3);

                if (g_Knows_ClassID == 0 || g_Knows_ClassID == 1)
                {
                    AirportCode.Visible = false;
                    AirportName.Visible = false;

                    BLL.Knows b_Knows = new BLL.Knows();
                    Entity.Knows[] e_Knows = b_Knows.Select_Knows(g_Knows_ClassID, g_LanguageID, "", 0, 7, g_Page);

                    if (e_Knows != null)
                    {
                        foreach (Entity.Knows o_Knows in e_Knows)
                        {
                            HtmlGenericControl o_Div = new HtmlGenericControl("div");
                            o_Div.Attributes.Add("class", "inside3_news");

                            HtmlGenericControl o_H3 = new HtmlGenericControl("h3");
                            HtmlGenericControl o_Strong = new HtmlGenericControl("strong");
                            HtmlAnchor o_Anchor = new HtmlAnchor();
                            o_Anchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID.ToString() + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                            o_Anchor.InnerText = o_Knows.Knows_Title;
                            o_Anchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");
                            HtmlGenericControl o_Span = new HtmlGenericControl("span");
                            o_Span.Style.Add(HtmlTextWriterStyle.Color, "#636363");
                            o_Span.InnerText = "(" + o_Knows.Knows_AddTime.ToShortDateString() + ")";
                            o_Strong.Controls.Add(o_Anchor);
                            o_Strong.Controls.Add(o_Span);
                            o_H3.Controls.Add(o_Strong);
                            o_Div.Controls.Add(o_H3);

                            Knows_Lists.Controls.Add(o_Div);
                        }
                    }
                }
                else
                {
                    if (g_Knows_ClassID == 2)
                    {
                        AirportCode.Visible = true;
                        AirportName.Visible = true;

                        BLL.Knows b_Knows = new BLL.Knows();
                        Entity.Knows[] e_Knows = b_Knows.Select_Knows(g_Knows_ClassID, g_LanguageID, "", 0, 0x7FFFFFFF, g_Page);

                        if (e_Knows != null)
                        {
                            foreach (Entity.Knows o_Knows in e_Knows)
                            {
                                if (AirportCode_Table.Rows.Count == 0)
                                {
                                    HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                                    HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                    HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                    o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                    o_HtmlAnchor.InnerText = o_Knows.Knows_Summary;
                                    o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");
                                    o_HtmlTableRow.Height = "30px";

                                    o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                    AirportCode_Table.Rows.Add(o_HtmlTableRow);
                                }
                                else
                                {
                                    HtmlTableRow o_HtmlTableRow = AirportCode_Table.Rows[AirportCode_Table.Rows.Count - 1];

                                    if (o_HtmlTableRow.Cells.Count == 4)
                                    {
                                        o_HtmlTableRow = new HtmlTableRow();
                                        o_HtmlTableRow.Height = "30px";

                                        HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                        HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                        o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                        o_HtmlAnchor.InnerText = o_Knows.Knows_Summary;
                                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");

                                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                        AirportCode_Table.Rows.Add(o_HtmlTableRow);
                                    }
                                    else
                                    {
                                        HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                        HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                        o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                        o_HtmlAnchor.InnerText = o_Knows.Knows_Summary;
                                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");

                                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                    }
                                }

                                if (AirportName_Table.Rows.Count == 0)
                                {
                                    HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                                    HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                    HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                    o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                    o_HtmlAnchor.InnerText = o_Knows.Knows_Title;
                                    o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");
                                    o_HtmlTableRow.Height = "30px";

                                    o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                    AirportName_Table.Rows.Add(o_HtmlTableRow);
                                }
                                else
                                {
                                    HtmlTableRow o_HtmlTableRow = AirportName_Table.Rows[AirportName_Table.Rows.Count - 1];

                                    if (o_HtmlTableRow.Cells.Count == 3)
                                    {
                                        o_HtmlTableRow = new HtmlTableRow();
                                        HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                        HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                        o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                        o_HtmlAnchor.InnerText = o_Knows.Knows_Title;
                                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");
                                        o_HtmlTableRow.Height = "30px";

                                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                        AirportName_Table.Rows.Add(o_HtmlTableRow);
                                    }
                                    else
                                    {
                                        HtmlTableCell o_HtmlTableCell = new HtmlTableCell();
                                        HtmlAnchor o_HtmlAnchor = new HtmlAnchor();

                                        o_HtmlAnchor.HRef = "Knows_Detail.aspx?Knows_ClassID=" + g_Knows_ClassID + "&Knows_ID=" + o_Knows.Knows_ID.ToString();
                                        o_HtmlAnchor.InnerText = o_Knows.Knows_Title;
                                        o_HtmlAnchor.Style.Add(HtmlTextWriterStyle.Color, "#0355a3");

                                        o_HtmlTableCell.Controls.Add(o_HtmlAnchor);
                                        o_HtmlTableRow.Controls.Add(o_HtmlTableCell);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }