using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using Models; namespace DAL { public class GroupBudgetInfoService { List excuteSql(string sql, params SqlParameter[] param) { return ServiceBase.excuteSql(new GroupBudgetInfo(), "GroupBudgetInfo", sql, CommandType.Text, param); } GroupBudgetInfo excuteType(string sql, params SqlParameter[] param) { //查询结果放入对象集合 List hdList = excuteSql(sql, param); GroupBudgetInfo gbi = new GroupBudgetInfo(); //判断集合是否为空 if (hdList == null || hdList.Count == 0) { return gbi; } //返回单个对象 return hdList[0]; } public GroupBudgetInfo select(int Id) { return this.excuteType("select * from GroupBudgetInfo where G_Isdel=0 and G_Diid=" + Id); } /// /// 增加 /// /// /// public bool Add(GroupBudgetInfo gbi) { string sql = "insert into GroupBudgetInfo values(@G_Diid,@G_GroupName,@G_Destination,@G_StartDate,@G_EndDate,@G_StayDays,@G_TripDescribe,@G_GroupNumber,@G_PettyCash,"+ "@G_InvitationFee,@G_VisaDetails,@G_VisaCoefficient,@G_VisaCostPrice,@G_VisaOffer,@G_AirDetails,@G_AirCoefficient,@G_AirCostPrice,@G_AirOffer,"+ "@G_GroundingDetails,@G_GroundingCoefficient,@G_GroundingCostPrice,@G_GroundingOffer,@G_HotelDetails,@G_HotelCoefficient,@G_HotelCostPrice,@G_HotelOffer,"+ "@G_OfficialDetails,@G_OfficialCoefficient,@G_OfficialCostPrice,@G_OfficialOffer,@G_Oper,@G_OPDate,@G_Isdel)"; SqlParameter[] parameter = new SqlParameter[]{ new SqlParameter("@G_Diid",gbi.G_Diid), new SqlParameter("@G_GroupName",gbi.G_GroupName), new SqlParameter("@G_Destination",gbi.G_Destination), new SqlParameter("@G_StartDate",gbi.G_StartDate), new SqlParameter("@G_EndDate",gbi.G_EndDate), new SqlParameter("@G_StayDays",gbi.G_StayDays), new SqlParameter("@G_TripDescribe",gbi.G_TripDescribe), new SqlParameter("@G_GroupNumber",gbi.G_GroupNumber), new SqlParameter("@G_PettyCash",gbi.G_PettyCash), new SqlParameter("@G_InvitationFee",gbi.G_InvitationFee), new SqlParameter("@G_VisaDetails",gbi.G_VisaDetails), new SqlParameter("@G_VisaCoefficient",gbi.G_VisaCoefficient), new SqlParameter("@G_VisaCostPrice",gbi.G_VisaCostPrice), new SqlParameter("@G_VisaOffer",gbi.G_VisaOffer), new SqlParameter("@G_AirDetails",gbi.G_AirDetails), new SqlParameter("@G_AirCoefficient",gbi.G_AirCoefficient), new SqlParameter("@G_AirCostPrice",gbi.G_AirCostPrice), new SqlParameter("@G_AirOffer",gbi.G_AirOffer), new SqlParameter("@G_GroundingDetails",gbi.G_GroundingDetails), new SqlParameter("@G_GroundingCoefficient",gbi.G_GroundingCoefficient), new SqlParameter("@G_GroundingCostPrice",gbi.G_GroundingCostPrice), new SqlParameter("@G_GroundingOffer",gbi.G_GroundingOffer), new SqlParameter("@G_HotelDetails",gbi.G_HotelDetails), new SqlParameter("@G_HotelCoefficient",gbi.G_HotelCoefficient), new SqlParameter("@G_HotelCostPrice",gbi.G_HotelCostPrice), new SqlParameter("@G_HotelOffer",gbi.G_HotelOffer), new SqlParameter("@G_OfficialDetails",gbi.G_OfficialDetails), new SqlParameter("@G_OfficialCoefficient",gbi.G_OfficialCoefficient), new SqlParameter("@G_OfficialCostPrice",gbi.G_OfficialCostPrice), new SqlParameter("@G_OfficialOffer",gbi.G_OfficialOffer), new SqlParameter("@G_Oper",gbi.G_Oper), new SqlParameter("@G_OPDate",gbi.G_OPDate), new SqlParameter("@G_Isdel",gbi.G_Isdel) }; if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0) return true; return false; } } }