public void Insert_Consumption(Entity.Consumption o_Consumption) { if (o_Consumption == null) return; Entity.Consumption e_Consumption = new Entity.Consumption(); e_Consumption.Consumption_ID = o_Consumption.Consumption_ID; e_Consumption.Consumption_Serial = FilterUtility.FilterSQL(o_Consumption.Consumption_Serial); e_Consumption.Consumption_Type = o_Consumption.Consumption_Type; e_Consumption.Consumption_Src = FilterUtility.FilterSQL(o_Consumption.Consumption_Src); e_Consumption.Consumption_Dest = FilterUtility.FilterSQL(o_Consumption.Consumption_Dest); e_Consumption.Consumption_Price = o_Consumption.Consumption_Price; e_Consumption.Consumption_DePrice = o_Consumption.Consumption_DePrice; e_Consumption.Consumption_Points = o_Consumption.Consumption_Points; e_Consumption.Consumption_Commission = o_Consumption.Consumption_Commission; e_Consumption.Consumption_Date = o_Consumption.Consumption_Date; e_Consumption.Consumption_Org_Member_ID = o_Consumption.Consumption_Org_Member_ID; e_Consumption.Consumption_Com_Member_ID = o_Consumption.Consumption_Com_Member_ID; e_Consumption.Consumption_Admin_ID = o_Consumption.Consumption_Admin_ID; e_Consumption.Consumption_AddTime = o_Consumption.Consumption_AddTime; e_Consumption.Consumption_Remark = FilterUtility.FilterSQL(o_Consumption.Consumption_Remark); d_Consumption.Insert_Consumption(e_Consumption); }
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; } }
public Entity.Consumption Select_Consumption(int p_Consumption_ID) { DataTable o_DataTable = d_Consumption.Select_Consumption(p_Consumption_ID, ref g_TotalCount, ref g_TotalPage); if (o_DataTable == null) return null; else { DataRow o_DataRow = o_DataTable.Rows[0]; Entity.Consumption e_Consumption = new Entity.Consumption(); DateRow_Consumption(o_DataRow, e_Consumption); return e_Consumption; } }