public Entity.Booking[] Select_Booking(string p_Search_Content, int p_Search_Method, int p_Search_State, int p_PageSize, int p_PageIndex) { switch (p_Search_Method) { case 6: { BLL.AdminUser b_AdminUser = new AdminUser(); Entity.AdminUser o_AdminUser = b_AdminUser.Select_AdminUser(1, p_Search_Content); if (o_AdminUser != null) { p_Search_Content = o_AdminUser.AdminUser_ID.ToString(); p_Search_Method = 6; } else return null; } break; case 7: { BLL.AdminUser b_AdminUser = new AdminUser(); Entity.AdminUser o_AdminUser = b_AdminUser.Select_AdminUser(2, p_Search_Content); if (o_AdminUser != null) { p_Search_Content = o_AdminUser.AdminUser_ID.ToString(); p_Search_Method = 7; } else return null; } break; default: break; } DataTable o_DataTable = d_Booking.Select_Booking(p_Search_Content, p_Search_Method, p_Search_State, p_PageSize, p_PageIndex, ref g_TotalCount, ref g_TotalPage); if (o_DataTable == null) return null; else { Entity.Booking[] e_Booking = new Entity.Booking[o_DataTable.Rows.Count]; int i = 0; foreach (DataRow o_DataRow in o_DataTable.Rows) { e_Booking[i] = new Entity.Booking(); DateRow_Booking(o_DataRow, e_Booking[i]); i++; } return e_Booking; } }
private void DateRow_LowFare(DataRow p_DataRow, Entity.LowFare p_LowFare) { if (p_DataRow == null || p_LowFare == null) return; p_LowFare.LowFare_ID = Convert.ToInt32(p_DataRow["LowFare_ID"].ToString()); p_LowFare.LowFare_Type = Convert.ToInt32(p_DataRow["LowFare_Type"].ToString()); BLL.LowFare_Detail b_LowFare_Detail = new LowFare_Detail(); Entity.LowFare_Detail[] e_LowFare_Detail = b_LowFare_Detail.Select_LowFare_Detail_LowFare_ID(Convert.ToInt32(p_DataRow["LowFare_Detail_ID"].ToString()), 1, 1); if (e_LowFare_Detail != null) { p_LowFare.LowFare_Detail_ID = new List<Entity.LowFare_Detail>(); foreach (Entity.LowFare_Detail o_LowFare_Detail in e_LowFare_Detail) p_LowFare.LowFare_Detail_ID.Add(o_LowFare_Detail); } p_LowFare.LowFare_Adults = Convert.ToInt32(p_DataRow["LowFare_Adults"].ToString()); p_LowFare.LowFare_Children = Convert.ToInt32(p_DataRow["LowFare_Children"].ToString()); p_LowFare.LowFare_Infants = Convert.ToInt32(p_DataRow["LowFare_Infants"].ToString()); p_LowFare.LowFare_Passengers = p_DataRow["LowFare_Passengers"].ToString(); p_LowFare.LowFare_Airline = p_DataRow["LowFare_Airline"].ToString(); p_LowFare.LowFare_Class = p_DataRow["LowFare_Class"].ToString(); BLL.Member b_Member = new Member(); p_LowFare.LowFare_Member_ID = b_Member.Select_Member(Convert.ToInt32(p_DataRow["LowFare_Member_ID"].ToString())); BLL.AdminUser b_AdminUser = new AdminUser(); p_LowFare.LowFare_AdminUser_ID = b_AdminUser.Select_AdminUser(Convert.ToInt32(p_DataRow["LowFare_AdminUser_ID"].ToString())); p_LowFare.LowFare_Status = Convert.ToInt32(p_DataRow["LowFare_Status"].ToString()); p_LowFare.LowFare_AddTime = DateTime.Parse(p_DataRow["LowFare_AddTime"].ToString()); p_LowFare.LowFare_SubmitTime = p_DataRow["LowFare_SubmitTime"].ToString(); }
public Entity.Consumption[] Select_Consumption(string p_Search_Content, int p_Search_Method, int p_Search_Year, int p_Search_Month, int p_PageSize, int p_PageIndex) { switch (p_Search_Method) { case 9: { BLL.Member b_Member = new Member(); Entity.Member o_Member = b_Member.Select_Member(1, p_Search_Content); if (o_Member != null) { p_Search_Content = o_Member.Member_ID.ToString(); p_Search_Method = 9; } else return null; } break; case 10: { BLL.Member b_Member = new Member(); Entity.Member o_Member = b_Member.Select_Member(2, p_Search_Content); if (o_Member != null) { p_Search_Content = o_Member.Member_ID.ToString(); p_Search_Method = 9; } else return null; } break; case 11: { BLL.Member b_Member = new Member(); Entity.Member o_Member = b_Member.Select_Member(1, p_Search_Content); if (o_Member != null) { p_Search_Content = o_Member.Member_ID.ToString(); p_Search_Method = 10; } else return null; } break; case 12: { BLL.Member b_Member = new Member(); Entity.Member o_Member = b_Member.Select_Member(2, p_Search_Content); if (o_Member != null) { p_Search_Content = o_Member.Member_ID.ToString(); p_Search_Method = 10; } else return null; } break; case 13: { BLL.AdminUser b_AdminUser = new AdminUser(); Entity.AdminUser o_AdminUser = b_AdminUser.Select_AdminUser(1, p_Search_Content); if (o_AdminUser != null) { p_Search_Content = o_AdminUser.AdminUser_ID.ToString(); p_Search_Method = 11; } else return null; } break; case 14: { BLL.AdminUser b_AdminUser = new AdminUser(); Entity.AdminUser o_AdminUser = b_AdminUser.Select_AdminUser(2, p_Search_Content); if (o_AdminUser != null) { p_Search_Content = o_AdminUser.AdminUser_ID.ToString(); p_Search_Method = 11; } else return null; } break; default: break; } DataTable o_DataTable = d_Consumption.Select_Consumption(p_Search_Content, p_Search_Method, p_Search_Year, p_Search_Month, p_PageSize, p_PageIndex, ref g_TotalCount, ref g_TotalPage); if (o_DataTable == null) return null; else { Entity.Consumption[] e_Consumption = new Entity.Consumption[o_DataTable.Rows.Count]; int i = 0; foreach (DataRow o_DataRow in o_DataTable.Rows) { e_Consumption[i] = new Entity.Consumption(); DateRow_Consumption(o_DataRow, e_Consumption[i]); i++; } return e_Consumption; } }
private void DateRow_Booking(DataRow p_DataRow, Entity.Booking p_Booking) { if (p_DataRow == null || p_Booking == null) return; p_Booking.Booking_ID = Convert.ToInt32(p_DataRow["Booking_ID"].ToString()); p_Booking.Booking_Seq = p_DataRow["Booking_Seq"].ToString(); p_Booking.Booking_Airline = p_DataRow["Booking_Airline"].ToString(); p_Booking.Booking_Contact = p_DataRow["Booking_Contact"].ToString(); p_Booking.Booking_Num = Convert.ToInt32(p_DataRow["Booking_Num"].ToString()); p_Booking.Booking_Tel = p_DataRow["Booking_Tel"].ToString(); p_Booking.Booking_Email = p_DataRow["Booking_Email"].ToString(); BLL.AdminUser b_AdminUser = new AdminUser(); p_Booking.Booking_AdminUser_ID = b_AdminUser.Select_AdminUser(Convert.ToInt32(p_DataRow["Booking_AdminUser_ID"].ToString())); if (p_DataRow["Booking_Kind"].ToString().ToLower() == "true") p_Booking.Booking_Kind = true; else p_Booking.Booking_Kind = false; p_Booking.Booking_State = Convert.ToInt32(p_DataRow["Booking_State"].ToString()); p_Booking.Booking_AddTime = DateTime.Parse(p_DataRow["Booking_AddTime"].ToString()); p_Booking.Booking_LastTime = DateTime.Parse(p_DataRow["Booking_LastTime"].ToString()); if (p_DataRow["Booking_LastTime"] != null && VerifyUtility.IsString_NotNull(p_DataRow["Booking_LastTime"].ToString())) p_Booking.Booking_ComitTime = p_DataRow["Booking_ComitTime"].ToString(); }
private void DateRow_Consumption(DataRow p_DataRow, Entity.Consumption p_Consumption) { if (p_DataRow == null || p_Consumption == null) return; p_Consumption.Consumption_ID = Convert.ToInt32(p_DataRow["Consumption_ID"].ToString()); p_Consumption.Consumption_Serial = p_DataRow["Consumption_Serial"].ToString(); p_Consumption.Consumption_Type = Convert.ToInt32(p_DataRow["Consumption_Type"].ToString()); p_Consumption.Consumption_Src = p_DataRow["Consumption_Src"].ToString(); p_Consumption.Consumption_Dest = p_DataRow["Consumption_Dest"].ToString(); p_Consumption.Consumption_Price = Convert.ToInt32(p_DataRow["Consumption_Price"].ToString()); p_Consumption.Consumption_DePrice = Convert.ToInt32(p_DataRow["Consumption_DePrice"].ToString()); p_Consumption.Consumption_Points = Convert.ToInt32(p_DataRow["Consumption_Points"].ToString()); p_Consumption.Consumption_Commission = Convert.ToInt32(p_DataRow["Consumption_Commission"].ToString()); p_Consumption.Consumption_Date = DateTime.Parse(p_DataRow["Consumption_Date"].ToString()); BLL.Member b_Member = new Member(); p_Consumption.Consumption_Org_Member_ID = b_Member.Select_Member(Convert.ToInt32(p_DataRow["Consumption_Org_Member_ID"].ToString())); p_Consumption.Consumption_Com_Member_ID = b_Member.Select_Member(Convert.ToInt32(p_DataRow["Consumption_Com_Member_ID"].ToString())); BLL.AdminUser b_AdminUser = new AdminUser(); p_Consumption.Consumption_Admin_ID = b_AdminUser.Select_AdminUser(Convert.ToInt32(p_DataRow["Consumption_Admin_ID"].ToString())); p_Consumption.Consumption_AddTime = DateTime.Parse(p_DataRow["Consumption_AddTime"].ToString()); p_Consumption.Consumption_Remark = p_DataRow["Consumption_Remark"].ToString(); }