protected void Page_Load(object sender, EventArgs e) { b_LowFare = new BLL.LowFare(); if (!IsPostBack) { switch (g_Action_ID) { case 2: { if (g_LowFare_ID == 0) ResponseError("参数错误"); Entity.LowFare e_LowFare = b_LowFare.Select_LowFare(g_LowFare_ID); GetLowFare(e_LowFare); } break; case 3: { if (g_LowFare_ID == 0) ResponseError("参数错误"); b_LowFare.Delete_LowFare(g_LowFare_ID); ResponseClose("删除成功"); } break; case 4: { if (g_LowFare_ID == 0) ResponseError("参数错误"); Entity.LowFare e_LowFare = b_LowFare.Select_LowFare(g_LowFare_ID); e_LowFare.LowFare_AdminUser_ID = g_AdminUser; e_LowFare.LowFare_Status = 1; e_LowFare.LowFare_SubmitTime = DateTime.Now.ToString(); b_LowFare.Update_LowFare(e_LowFare); ResponseClose("转换成功"); } break; } } }
private void GetLowFare() { BLL.LowFare b_LowFare = new BLL.LowFare(); Entity.LowFare[] e_LowFare = b_LowFare.Select_LowFare(Search_Content.Text, Convert.ToInt32(Search_Method.SelectedValue), Convert.ToInt32(LowFare_Status.SelectedValue), g_PageSize, g_Page); if (e_LowFare != null) { int i = 1; foreach (Entity.LowFare o_LowFare in e_LowFare) { 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(); switch (o_LowFare.LowFare_Status) { case 0: o_HtmlTableCell.InnerText = "未处理"; break; case 1: o_HtmlTableCell.InnerText = "已处理"; break; default: o_HtmlTableCell.InnerText = ""; break; } o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); switch (o_LowFare.LowFare_Type) { case 1: o_HtmlTableCell.InnerText = "Round-trip"; break; case 2: o_HtmlTableCell.InnerText = "One-way"; break; case 3: o_HtmlTableCell.InnerText = "Multi-city"; break; default: o_HtmlTableCell.InnerText = ""; break; } o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_Adults.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_Children.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_Infants.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_Airline; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_Class; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_LowFare.LowFare_Member_ID != null) { o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionMember(2, " + o_LowFare.LowFare_Member_ID.Member_ID.ToString() + ");return false;"); o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2"); o_HtmlAnchor.InnerText = o_LowFare.LowFare_Member_ID.Member_Account; o_HtmlTableCell.Controls.Add(o_HtmlAnchor); } else o_HtmlTableCell.InnerText = ""; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_LowFare.LowFare_Member_ID != null) o_HtmlTableCell.InnerText = o_LowFare.LowFare_Member_ID.Member_Serial; else o_HtmlTableCell.InnerText = ""; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_LowFare.LowFare_AdminUser_ID != null) o_HtmlTableCell.InnerText = o_LowFare.LowFare_AdminUser_ID.AdminUser_Name; else o_HtmlTableCell.InnerText = ""; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_LowFare.LowFare_AdminUser_ID != null) o_HtmlTableCell.InnerText = o_LowFare.LowFare_AdminUser_ID.AdminUser_NickName; else o_HtmlTableCell.InnerText = ""; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_AddTime.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_LowFare.LowFare_SubmitTime.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_LowFare.LowFare_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 = " "; o_HtmlTableCell.Controls.Add(o_HtmlGenericControl); if (o_LowFare.LowFare_Status == 0) { o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(4, " + o_LowFare.LowFare_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 = " "; o_HtmlTableCell.Controls.Add(o_HtmlGenericControl); } o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionSubmit(3, " + o_LowFare.LowFare_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_LowFare.g_TotalPage.ToString(); Total_Count.Text = b_LowFare.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_LowFare.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"; } }
protected void LowFare_Submit_Click(object sender, EventArgs e) { if (g_Member == null) ResponseError("超时请重新登录"); if (LowFare_Type1.Checked) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type1.Text)) ResponseError("请输入From"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type1.Text)) ResponseError("请输入To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type1.Text)) ResponseError("请输入Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type1.SelectedValue)) ResponseError("请选择Departing时间段"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Returning_Text_Type1.Text)) ResponseError("请输入Returning日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time2_Select_Type1.SelectedValue)) ResponseError("请选择Returning时间段"); Application.Lock(); BLL.LowFare_Detail b_LowFare_Detail = new BLL.LowFare_Detail(); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = b_LowFare_Detail.LowFare_Detail_Next_LowFare_ID(); e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type1.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type1.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type1.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type1.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type1.SelectedValue; e_LowFare_Detail.LowFare_Detail_Returning = LowFare_Detail_Returning_Text_Type1.Text; e_LowFare_Detail.LowFare_Detail_Time2 = LowFare_Detail_Time2_Select_Type1.Text; e_LowFare_Detail.LowFare_Flexibility2 = LowFare_Detail_Flexibility2_Type1.SelectedValue; Entity.LowFare e_LowFare = new Entity.LowFare(); e_LowFare.LowFare_Type = 1; e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); e_LowFare.LowFare_Adults = Convert.ToInt32(LowFare_Adults.SelectedValue); e_LowFare.LowFare_Children = Convert.ToInt32(LowFare_Children.SelectedValue); e_LowFare.LowFare_Infants = Convert.ToInt32(LowFare_Infants.SelectedValue); e_LowFare.LowFare_Passengers = LowFare_Passengers.Text; for (int i = 1; i <= 34; i++) { if (Request["checkbox" + i.ToString()] != null) e_LowFare.LowFare_Airline += Request["checkbox" + i.ToString()] + ";"; } if (e_LowFare.LowFare_Airline.EndsWith(";")) e_LowFare.LowFare_Airline = e_LowFare.LowFare_Airline.Remove(e_LowFare.LowFare_Airline.Length - 1, 1); e_LowFare.LowFare_Class = LowFare_Class.SelectedValue; e_LowFare.LowFare_Member_ID = g_Member; e_LowFare.LowFare_AdminUser_ID = null; e_LowFare.LowFare_Status = 0; e_LowFare.LowFare_AddTime = DateTime.Now; e_LowFare.LowFare_SubmitTime = ""; BLL.LowFare b_LowFare = new BLL.LowFare(); b_LowFare.Insert_LowFare(e_LowFare); Application.UnLock(); ResponseSuccess("提交成功"); } if (LowFare_Type2.Checked) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type2.Text)) ResponseError("请输入From"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type2.Text)) ResponseError("请输入To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type2.Text)) ResponseError("请输入Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type2.SelectedValue)) ResponseError("请选择Departing时间段"); Application.Lock(); BLL.LowFare_Detail b_LowFare_Detail = new BLL.LowFare_Detail(); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = b_LowFare_Detail.LowFare_Detail_Next_LowFare_ID(); e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type2.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type2.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type2.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type2.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type2.SelectedValue; Entity.LowFare e_LowFare = new Entity.LowFare(); e_LowFare.LowFare_Type = 2; e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); e_LowFare.LowFare_Adults = Convert.ToInt32(LowFare_Adults.SelectedValue); e_LowFare.LowFare_Children = Convert.ToInt32(LowFare_Children.SelectedValue); e_LowFare.LowFare_Infants = Convert.ToInt32(LowFare_Infants.SelectedValue); e_LowFare.LowFare_Passengers = LowFare_Passengers.Text; for (int i = 1; i <= 34; i++) { if (Request["checkbox" + i.ToString()] != null) e_LowFare.LowFare_Airline += Request["checkbox" + i.ToString()] + ";"; } if (e_LowFare.LowFare_Airline.EndsWith(";")) e_LowFare.LowFare_Airline = e_LowFare.LowFare_Airline.Remove(e_LowFare.LowFare_Airline.Length - 1, 1); e_LowFare.LowFare_Class = LowFare_Class.SelectedValue; e_LowFare.LowFare_Member_ID = g_Member; e_LowFare.LowFare_AdminUser_ID = null; e_LowFare.LowFare_Status = 0; e_LowFare.LowFare_AddTime = DateTime.Now; e_LowFare.LowFare_SubmitTime = ""; BLL.LowFare b_LowFare = new BLL.LowFare(); b_LowFare.Insert_LowFare(e_LowFare); Application.UnLock(); ResponseSuccess("提交成功"); } if (LowFare_Type3.Checked) { BLL.LowFare_Detail b_LowFare_Detail = new BLL.LowFare_Detail(); Entity.LowFare e_LowFare = new Entity.LowFare(); Application.Lock(); int LowFare_Detail_LowFare_ID = b_LowFare_Detail.LowFare_Detail_Next_LowFare_ID(); Application.UnLock(); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_1.Text) && !VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_2.Text) && !VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_3.Text) && !VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_4.Text)) ResponseError("请输入From"); if (VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_1.Text)) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type3_1.Text)) ResponseError("请输入Flight 1 To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type3_1.Text)) ResponseError("请输入请输入Flight 1 Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type3_1.SelectedValue)) ResponseError("请选择请输入Flight 1 Departing时间段"); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = LowFare_Detail_LowFare_ID; e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type3_1.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type3_1.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type3_1.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type3_1.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type3_1.SelectedValue; if (e_LowFare.LowFare_Detail_ID == null) e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); } if (VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_2.Text)) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type3_2.Text)) ResponseError("请输入Flight 2 To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type3_2.Text)) ResponseError("请输入Flight 2 Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type3_2.SelectedValue)) ResponseError("请选择Flight 2 Departing时间段"); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = LowFare_Detail_LowFare_ID; e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type3_2.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type3_2.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type3_2.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type3_2.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type3_2.SelectedValue; if (e_LowFare.LowFare_Detail_ID == null) e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); } if (VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_3.Text)) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type3_3.Text)) ResponseError("请输入Flight 3 To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type3_3.Text)) ResponseError("请输入Flight 3 Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type3_3.SelectedValue)) ResponseError("请选择Flight 3 Departing时间段"); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = LowFare_Detail_LowFare_ID; e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type3_3.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type3_3.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type3_3.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type3_3.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type3_3.SelectedValue; if (e_LowFare.LowFare_Detail_ID == null) e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); } if (VerifyUtility.IsString_NotNull(LowFare_Detail_From_Text_Type3_4.Text)) { if (!VerifyUtility.IsString_NotNull(LowFare_Detail_To_Text_Type3_4.Text)) ResponseError("请输入Flight 4 To"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Departing_Text_Type3_4.Text)) ResponseError("请输入Flight 4 Departing日期"); if (!VerifyUtility.IsString_NotNull(LowFare_Detail_Time1_Select_Type3_4.SelectedValue)) ResponseError("请选择Flight 4 Departing时间段"); Entity.LowFare_Detail e_LowFare_Detail = new Entity.LowFare_Detail(); e_LowFare_Detail.LowFare_Detail_ID = 0; e_LowFare_Detail.LowFare_Detail_LowFare_ID = LowFare_Detail_LowFare_ID; e_LowFare_Detail.LowFare_Detail_From = LowFare_Detail_From_Text_Type3_4.Text; e_LowFare_Detail.LowFare_Detail_To = LowFare_Detail_To_Text_Type3_4.Text; e_LowFare_Detail.LowFare_Detail_Departing = LowFare_Detail_Departing_Text_Type3_4.Text; e_LowFare_Detail.LowFare_Detail_Time1 = LowFare_Detail_Time1_Select_Type3_4.Text; e_LowFare_Detail.LowFare_Flexibility1 = LowFare_Detail_Flexibility1_Type3_4.SelectedValue; if (e_LowFare.LowFare_Detail_ID == null) e_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); e_LowFare.LowFare_Detail_ID.Add(e_LowFare_Detail); } Application.Lock(); e_LowFare.LowFare_Type = 3; e_LowFare.LowFare_Adults = Convert.ToInt32(LowFare_Adults.SelectedValue); e_LowFare.LowFare_Children = Convert.ToInt32(LowFare_Children.SelectedValue); e_LowFare.LowFare_Infants = Convert.ToInt32(LowFare_Infants.SelectedValue); e_LowFare.LowFare_Passengers = LowFare_Passengers.Text; for (int i = 1; i <= 34; i++) { if (Request["checkbox" + i.ToString()] != null) e_LowFare.LowFare_Airline += Request["checkbox" + i.ToString()] + ";"; } if (e_LowFare.LowFare_Airline.EndsWith(";")) e_LowFare.LowFare_Airline = e_LowFare.LowFare_Airline.Remove(e_LowFare.LowFare_Airline.Length - 1, 1); e_LowFare.LowFare_Class = LowFare_Class.SelectedValue; e_LowFare.LowFare_Member_ID = g_Member; e_LowFare.LowFare_AdminUser_ID = null; e_LowFare.LowFare_Status = 0; e_LowFare.LowFare_AddTime = DateTime.Now; e_LowFare.LowFare_SubmitTime = ""; BLL.LowFare b_LowFare = new BLL.LowFare(); b_LowFare.Insert_LowFare(e_LowFare); Application.UnLock(); ResponseSuccess("提交成功"); } }