protected void Page_Load(object sender, EventArgs e) { b_Consumption = new BLL.Consumption(); if (!IsPostBack) { switch (g_Action_ID) { case 1: GetMember(); Consumption_Com_Member_TD.Visible = false; Consumption_Admin_Name_TD.Visible = false; Consumption_Admin_NickName_TD.Visible = false; Consumption_AddTime_TD.Visible = false; Consumption_Submit.Text = " 添加 "; break; case 2: if (g_Consumption_ID == 0) ResponseError("参数错误"); GetMember(); Entity.Consumption e_Consumption = b_Consumption.Select_Consumption(g_Consumption_ID); if (e_Consumption != null) { Consumption_Serial.Text = e_Consumption.Consumption_Serial; if (e_Consumption.Consumption_Serial.Substring(e_Consumption.Consumption_Serial.Length - 2, 2).ToUpper() == "SB") Consumption_Serial_RadioButton1.Checked = true; else Consumption_Serial_RadioButton2.Checked = true; switch (e_Consumption.Consumption_Type) { case 1: Consumption_Type1.Checked = true; break; case 2: Consumption_Type2.Checked = true; break; case 3: Consumption_Type3.Checked = true; break; default: break; } Consumption_Src.Text = e_Consumption.Consumption_Src; Consumption_Dest.Text = e_Consumption.Consumption_Dest; Consumption_Price.Text = e_Consumption.Consumption_Price.ToString(); Consumption_DePrice.Text = e_Consumption.Consumption_DePrice.ToString(); Consumption_Profit.Text = (e_Consumption.Consumption_Price - e_Consumption.Consumption_DePrice).ToString(); Consumption_Points.Text = e_Consumption.Consumption_Points.ToString(); Consumption_Commission.Text = e_Consumption.Consumption_Commission.ToString(); Consumption_Date.Text = e_Consumption.Consumption_Date.ToString("yyyy-MM-dd"); if (e_Consumption.Consumption_Org_Member_ID != null) { Consumption_Org_Member_ID.SelectedValue = e_Consumption.Consumption_Org_Member_ID.Member_ID.ToString(); Consumption_Org_Member_Account.Text = e_Consumption.Consumption_Org_Member_ID.Member_Account; Consumption_Org_Member_Account.OnClientClick = "ActionSubmit(2, " + e_Consumption.Consumption_Org_Member_ID.Member_ID.ToString() + ");return false;"; Consumption_Org_Member_Serial.Text = e_Consumption.Consumption_Org_Member_ID.Member_Serial; } else { Consumption_Org_Member_Account.Visible = false; Consumption_Org_Member_Serial.Visible = false; } if (e_Consumption.Consumption_Com_Member_ID != null) { Consumption_Com_Member_Account.Text = e_Consumption.Consumption_Com_Member_ID.Member_Account; Consumption_Com_Member_Account.OnClientClick = "ActionSubmit(2, " + e_Consumption.Consumption_Com_Member_ID.Member_ID.ToString() + ");return false;"; Consumption_Com_Member_Serial.Text = e_Consumption.Consumption_Com_Member_ID.Member_Serial; } else { Consumption_Com_Member_Account.Visible = false; Consumption_Com_Member_Serial.Visible = false; } if (e_Consumption.Consumption_Admin_ID != null) { Consumption_Admin_Name.Text = e_Consumption.Consumption_Admin_ID.AdminUser_Name; Consumption_Admin_NickName.Text = e_Consumption.Consumption_Admin_ID.AdminUser_NickName; } Consumption_Remark.Text = e_Consumption.Consumption_Remark; Consumption_AddTime.Text = e_Consumption.Consumption_AddTime.ToString(); } Consumption_Submit.Text = " 修改 "; Consumption_Submit.Visible = false; break; case 3: if (g_Consumption_ID == 0) ResponseError("参数错误"); b_Consumption.Delete_Consumption(g_Consumption_ID); ResponseClose("删除成功"); break; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (g_Member == null) ResponseClose("超时,重新登录"); int g_Member_Info_ID = 1; if (VerifyUtility.IsNumber_NotNull(Request["Member_Info_ID"])) g_Member_Info_ID = Convert.ToInt32(Request["Member_Info_ID"]); for (int i = 1; i <= 3; i++) { Control o_Control = null; o_Control = form1.FindControl("Li" + i.ToString()); if (o_Control != null) { HtmlControl o_HtmlControl = (HtmlControl)o_Control; if (o_HtmlControl != null) { if (i == g_Member_Info_ID) o_HtmlControl.Attributes["class"] = "win_pic_li1"; else o_HtmlControl.Attributes["class"] = "win_pic_li2"; } } o_Control = form1.FindControl("Div" + i.ToString()); if (o_Control != null) { HtmlControl o_HtmlControl = (HtmlControl)o_Control; if (o_HtmlControl != null) { if (i == g_Member_Info_ID) o_HtmlControl.Attributes["class"] = "win_pic_txt"; else o_HtmlControl.Attributes["class"] = "win_pic_txt2"; } } } if (g_Member.Member_Level < 3) Div_Consumption.Visible = false; Member_Account.Text = g_Member.Member_Account; Member_Serial.Text = g_Member.Member_Serial; Member_Name_CN.Text = g_Member.Member_Name_CN; Member_Name_EN.Text = g_Member.Member_Name_EN; if (g_Member.Member_Sex) Member_Male.Checked = true; else Member_Female.Checked = true; Member_Work.SelectedValue = g_Member.Member_Work; Member_Tel.Text = g_Member.Member_Tel; Member_Mobile.Text = g_Member.Member_Mobile; Member_Email.Text = g_Member.Member_Email; Member_Address.Text = g_Member.Member_Address; Member_Company_Name.Text = g_Member.Member_Company_Name; Member_Company_Tel.Text = g_Member.Member_Company_Tel; Member_Company_Address.Text = g_Member.Member_Company_Address; Member_Airlines.Text = "Search All Airlines"; Airlines = g_Member.Member_Airlines; if (g_Member.Member_Months != null) { foreach (int Member_Months in g_Member.Member_Months) { Control o_Control = form1.FindControl("Member_Months_" + Member_Months.ToString()); if (o_Control != null) { CheckBox o_CheckBox = (CheckBox)o_Control; if (o_CheckBox != null) o_CheckBox.Checked = true; } } } Member_Account.ReadOnly = true; Member_Serial.ReadOnly = true; Member_Consumption_Account.Text = g_Member.Member_Account; Member_Consumption_Commission.Text = g_Member.Member_Commission.ToString(); Member_Consumption_Times.Text = g_Member.Member_Times.ToString(); Member_Consumption_Points.Text = g_Member.Member_Points.ToString(); Member_Consumption_Consumption.Text = g_Member.Member_Consumption.ToString(); BLL.Consumption b_Consumption = new BLL.Consumption(); Entity.Consumption[] e_Consumption = b_Consumption.Select_Consumption(g_Member.Member_Account, 9, 0, 0, 0x7FFFFFFF, 1); if (e_Consumption != null) { StringBuilder o_InnerHtml = new StringBuilder(); int i = 0; foreach (Entity.Consumption o_Consumption in e_Consumption) { string o_CssClass = ""; if (i % 2 == 0) o_CssClass = " win_pic_txtdl_none"; o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Date.ToString("yyyy-MM-dd") + "</dt>"); switch (o_Consumption.Consumption_Type) { case 1: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">单程</dt>"); break; case 2: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">双程</dt>"); break; case 3: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">多程</dt>"); break; default: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\"> </dt>"); break; } o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Src + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl3" + o_CssClass + "\">" + o_Consumption.Consumption_Dest + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">" + o_Consumption.Consumption_Price.ToString() + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl3" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Points.ToString() + "</dt>"); i++; } if (VerifyUtility.IsString_NotNull(o_InnerHtml.ToString())) Member_Consumption_List.InnerHtml += o_InnerHtml.ToString(); } } }
private void GetMember() { Entity.Member o_Member = b_Member.Select_Member(g_Member_ID); if (o_Member != null) { Member_Account.Text = o_Member.Member_Account; Member_Serial.Text = o_Member.Member_Serial; Member_Name_CN.Text = o_Member.Member_Name_CN; Member_Name_EN.Text = o_Member.Member_Name_EN; if (o_Member.Member_Sex) Member_Male.Checked = true; else Member_Female.Checked = true; Member_Work.Text = o_Member.Member_Work; Member_Tel.Text = o_Member.Member_Tel; Member_Mobile.Text = o_Member.Member_Mobile; Member_Email.Text = o_Member.Member_Email; Member_Address.Text = o_Member.Member_Address; Member_Company_Name.Text = o_Member.Member_Company_Name; Member_Company_Tel.Text = o_Member.Member_Company_Tel; Member_Company_Address.Text = o_Member.Member_Company_Address; Member_Airlines.Text = o_Member.Member_Airlines; if (o_Member.Member_Months != null) { foreach (int Member_Months in o_Member.Member_Months) { Control o_Control = form1.FindControl("Member_Months_" + Member_Months.ToString()); if (o_Control != null) { CheckBox o_CheckBox = (CheckBox)o_Control; if (o_CheckBox != null) o_CheckBox.Checked = true; } } } Member_Account.ReadOnly = true; Member_Serial.ReadOnly = true; Member_Consumption_Account.Text = o_Member.Member_Account; Member_Consumption_Commission.Text = o_Member.Member_Commission.ToString(); Member_Consumption_Times.Text = o_Member.Member_Times.ToString(); Member_Consumption_Points.Text = o_Member.Member_Points.ToString(); Member_Consumption_Consumption.Text = o_Member.Member_Consumption.ToString(); if (o_Member.Member_Recommended > 0) { Entity.Member c_Member = b_Member.Select_Member(o_Member.Member_Recommended); if (c_Member != null) { Member_ReSerial.NavigateUrl = "?Action_ID=2&Member_ID=" + c_Member.Member_ID; Member_ReSerial.Text = c_Member.Member_Account; } else Member_ReSerial.Visible = false; } else Member_ReSerial.Visible = false; BLL.Consumption b_Consumption = new BLL.Consumption(); Entity.Consumption[] e_Consumption = b_Consumption.Select_Consumption(o_Member.Member_Account, 9, 0, 0, 0x7FFFFFFF, 1); if (e_Consumption != null) { StringBuilder o_InnerHtml = new StringBuilder(); int i = 0; foreach (Entity.Consumption o_Consumption in e_Consumption) { string o_CssClass = ""; if (i % 2 == 0) o_CssClass = " win_pic_txtdl_none"; o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Date.ToString("yyyy-MM-dd") + "</dt>"); switch (o_Consumption.Consumption_Type) { case 1: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">单程</dt>"); break; case 2: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">双程</dt>"); break; case 3: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">多程</dt>"); break; default: o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\"> </dt>"); break; } o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Src + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl3" + o_CssClass + "\">" + o_Consumption.Consumption_Dest + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl4" + o_CssClass + "\" style=\"width:48px\">" + o_Consumption.Consumption_Price.ToString() + "</dt>"); o_InnerHtml.Append("<dt class=\"win_pic_txtdl3" + o_CssClass + "\" style=\"width:84px\">" + o_Consumption.Consumption_Points.ToString() + "</dt>"); i++; } if (VerifyUtility.IsString_NotNull(o_InnerHtml.ToString())) Member_Consumption_List.InnerHtml += o_InnerHtml.ToString(); } } }
private void GetConsumption() { int Year = 0; int Month = 0; BLL.Consumption b_Consumption = new BLL.Consumption(); if (VerifyUtility.IsNumber_NotNull(Search_Year.SelectedValue)) Year = Convert.ToInt32(Search_Year.SelectedValue); if (VerifyUtility.IsNumber_NotNull(Search_Month.SelectedValue)) Month = Convert.ToInt32(Search_Month.SelectedValue); Entity.Consumption[] e_Consumption = b_Consumption.Select_Consumption(Search_Content.Text, Convert.ToInt32(Search_Method.SelectedValue), Year, Month, g_PageSize, g_Page); if (e_Consumption != null) { int i = 1; foreach (Entity.Consumption o_Consumption in e_Consumption) { 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 = o_Consumption.Consumption_Serial; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); switch (o_Consumption.Consumption_Type) { case 1: o_HtmlTableCell.InnerText = "单程"; break; case 2: o_HtmlTableCell.InnerText = "双程"; break; case 3: o_HtmlTableCell.InnerText = "多程"; break; default: o_HtmlTableCell.InnerText = ""; break; } o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_Src; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_Dest; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_Price.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = (o_Consumption.Consumption_Price - o_Consumption.Consumption_DePrice).ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_Date.ToString("yyyy-MM-dd"); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_Points.ToString(); o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Org_Member_ID != null) { o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionMember(2, " + o_Consumption.Consumption_Org_Member_ID.Member_ID.ToString() + ");return false;"); o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2"); o_HtmlAnchor.InnerText = o_Consumption.Consumption_Org_Member_ID.Member_Account; o_HtmlTableCell.Controls.Add(o_HtmlAnchor); } else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Org_Member_ID != null) o_HtmlTableCell.InnerText = o_Consumption.Consumption_Org_Member_ID.Member_Serial; else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Com_Member_ID != null) { o_HtmlAnchor = new HtmlAnchor(); o_HtmlAnchor.HRef = "#"; o_HtmlAnchor.Attributes.Add("onclick", "ActionMember(2, " + o_Consumption.Consumption_Com_Member_ID.Member_ID.ToString() + ");return false;"); o_HtmlAnchor.Attributes.Add("class", "AdminToolsLink2"); o_HtmlAnchor.InnerText = o_Consumption.Consumption_Com_Member_ID.Member_Account; o_HtmlTableCell.Controls.Add(o_HtmlAnchor); } else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Com_Member_ID != null) o_HtmlTableCell.InnerText = o_Consumption.Consumption_Com_Member_ID.Member_Serial; else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Admin_ID != null) o_HtmlTableCell.InnerText = o_Consumption.Consumption_Admin_ID.AdminUser_Name; else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); if (o_Consumption.Consumption_Admin_ID != null) o_HtmlTableCell.InnerText = o_Consumption.Consumption_Admin_ID.AdminUser_NickName; else o_HtmlTableCell.InnerHtml = " "; o_HtmlTableRow.Controls.Add(o_HtmlTableCell); o_HtmlTableCell = new HtmlTableCell(); o_HtmlTableCell.InnerText = o_Consumption.Consumption_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_Consumption.Consumption_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_Consumption.Consumption_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_Consumption.g_TotalPage.ToString(); Total_Count.Text = b_Consumption.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_Consumption.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"; } }