示例#1
0
        private void GetBooking()
        {
            BLL.Booking b_Booking = new BLL.Booking();

            Entity.Booking[] e_Booking = b_Booking.Select_Booking(Search_Content.Text, Convert.ToInt32(Search_Method.Text), Convert.ToInt32(Search_State.SelectedValue), g_PageSize, g_Page);
            if (e_Booking != null)
            {
                int i = 1;

                foreach (Entity.Booking o_Booking in e_Booking)
                {
                    HtmlTableRow o_HtmlTableRow = new HtmlTableRow();
                    HtmlTableCell o_HtmlTableCell;
                    HtmlAnchor o_HtmlAnchor;
                    HtmlGenericControl o_HtmlGenericControl;

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_Seq;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_Airline;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_Contact;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

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

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_Tel;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_Email;
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    if (o_Booking.Booking_AdminUser_ID != null)
                        o_HtmlTableCell.InnerText = o_Booking.Booking_AdminUser_ID.AdminUser_Name;
                    else
                        o_HtmlTableCell.InnerHtml = " ";

                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    if (o_Booking.Booking_AdminUser_ID != null)
                        o_HtmlTableCell.InnerText = o_Booking.Booking_AdminUser_ID.AdminUser_NickName;
                    else
                        o_HtmlTableCell.InnerHtml = " ";

                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    if (o_Booking.Booking_Kind)
                        o_HtmlTableCell.InnerText = "正常";
                    else
                        o_HtmlTableCell.InnerText = "假位";

                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

                    o_HtmlTableCell = new HtmlTableCell();
                    switch (o_Booking.Booking_State)
                    {
                        case 0:
                            o_HtmlTableCell.InnerHtml = "<span style=\"color:#FF0000\">未确认</span>";
                            break;

                        case 1:
                            o_HtmlTableCell.InnerHtml = "<span style=\"color:#0000FF\">已确认</span>";
                            break;

                        default:
                            o_HtmlTableCell.InnerHtml = "&nbsp;";
                            break;

                    }
                    o_HtmlTableRow.Controls.Add(o_HtmlTableCell);

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

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

                    o_HtmlTableCell = new HtmlTableCell();
                    o_HtmlTableCell.InnerText = o_Booking.Booking_ComitTime.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_Booking.Booking_ID.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_Booking.Booking_ID.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_Booking.g_TotalPage.ToString();
                Total_Count.Text = b_Booking.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_Booking.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";
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            b_Booking = new BLL.Booking();
            if (!IsPostBack)
            {
                switch (g_Action_ID)
                {
                    case 1:
                        TD_AdminUser_ID.Visible = false;
                        TD_Booking_State.Visible = false;
                        TD_AddTime.Visible = false;
                        TD_ComitTime.Visible = false;
                        break;

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

                            TD_AdminUser_ID.Visible = true;
                            TD_Booking_State.Visible = true;
                            TD_AddTime.Visible = true;
                            TD_ComitTime.Visible = true;

                            Entity.Booking e_Booking = b_Booking.Select_Booking(g_Booking_ID);
                            Booking_Seq.Text = e_Booking.Booking_Seq;
                            Booking_Airline.Text = e_Booking.Booking_Airline;
                            Booking_Contact.Text = e_Booking.Booking_Contact;
                            Booking_Num.Text = e_Booking.Booking_Num.ToString();
                            Booking_Tel.Text = e_Booking.Booking_Tel;
                            Booking_Email.Text = e_Booking.Booking_Email;
                            GetAdminUser(e_Booking.Booking_AdminUser_ID);
                            if (e_Booking.Booking_Kind)
                                Booking_Kind1.Checked = true;
                            else
                                Booking_Kind2.Checked = true;

                            switch (e_Booking.Booking_State)
                            {
                                case 0:
                                    Booking_State.SelectedIndex = 0;
                                    break;

                                case 1:
                                    Booking_State.SelectedIndex = 1;
                                    break;

                                default:
                                    break;
                            }

                            Booking_AddTime.Text = e_Booking.Booking_AddTime.ToString();
                            Booking_LastTime.Text = e_Booking.Booking_LastTime.ToString();
                            Booking_ComitTime.Text = e_Booking.Booking_ComitTime.ToString();
                            Booking_Submit.Text = " 修改 ";
                        }
                        break;

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

                        b_Booking.Delete_Booking(g_Booking_ID);
                        ResponseClose("删除成功");
                        break;

                    case 4:
                        {
                            if (g_Booking_ID == 0)
                                ResponseError("参数错误");

                            Entity.Booking e_Booking = b_Booking.Select_Booking(g_Booking_ID);
                            e_Booking.Booking_State = 1;
                            e_Booking.Booking_ComitTime = DateTime.Now.ToString();
                            b_Booking.Update_Booking(e_Booking);
                            ResponseClose("转换成功");
                        }
                        break;
                }
            }
        }