GroupBudgetInfoService.cs 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Data.SqlClient;
  5. using System.Linq;
  6. using System.Text;
  7. using Models;
  8. namespace DAL
  9. {
  10. public class GroupBudgetInfoService
  11. {
  12. List<GroupBudgetInfo> excuteSql(string sql, params SqlParameter[] param)
  13. {
  14. return ServiceBase<GroupBudgetInfo>.excuteSql(new GroupBudgetInfo(), "GroupBudgetInfo", sql, CommandType.Text, param);
  15. }
  16. GroupBudgetInfo excuteType(string sql, params SqlParameter[] param)
  17. {
  18. //查询结果放入对象集合
  19. List<GroupBudgetInfo> hdList = excuteSql(sql, param);
  20. GroupBudgetInfo gbi = new GroupBudgetInfo();
  21. //判断集合是否为空
  22. if (hdList == null || hdList.Count == 0)
  23. {
  24. return gbi;
  25. }
  26. //返回单个对象
  27. return hdList[0];
  28. }
  29. public GroupBudgetInfo select(int Id)
  30. {
  31. return this.excuteType("select * from GroupBudgetInfo where G_Isdel=0 and G_Diid=" + Id);
  32. }
  33. /// <summary>
  34. /// 增加
  35. /// </summary>
  36. /// <param name="cd"></param>
  37. /// <returns></returns>
  38. public bool Add(GroupBudgetInfo gbi)
  39. {
  40. string sql = "insert into GroupBudgetInfo values(@G_Diid,@G_GroupName,@G_Destination,@G_StartDate,@G_EndDate,@G_StayDays,@G_TripDescribe,@G_GroupNumber,@G_PettyCash,"+
  41. "@G_InvitationFee,@G_VisaDetails,@G_VisaCoefficient,@G_VisaCostPrice,@G_VisaOffer,@G_AirDetails,@G_AirCoefficient,@G_AirCostPrice,@G_AirOffer,"+
  42. "@G_GroundingDetails,@G_GroundingCoefficient,@G_GroundingCostPrice,@G_GroundingOffer,@G_HotelDetails,@G_HotelCoefficient,@G_HotelCostPrice,@G_HotelOffer,"+
  43. "@G_OfficialDetails,@G_OfficialCoefficient,@G_OfficialCostPrice,@G_OfficialOffer,@G_Oper,@G_OPDate,@G_Isdel)";
  44. SqlParameter[] parameter = new SqlParameter[]{
  45. new SqlParameter("@G_Diid",gbi.G_Diid),
  46. new SqlParameter("@G_GroupName",gbi.G_GroupName),
  47. new SqlParameter("@G_Destination",gbi.G_Destination),
  48. new SqlParameter("@G_StartDate",gbi.G_StartDate),
  49. new SqlParameter("@G_EndDate",gbi.G_EndDate),
  50. new SqlParameter("@G_StayDays",gbi.G_StayDays),
  51. new SqlParameter("@G_TripDescribe",gbi.G_TripDescribe),
  52. new SqlParameter("@G_GroupNumber",gbi.G_GroupNumber),
  53. new SqlParameter("@G_PettyCash",gbi.G_PettyCash),
  54. new SqlParameter("@G_InvitationFee",gbi.G_InvitationFee),
  55. new SqlParameter("@G_VisaDetails",gbi.G_VisaDetails),
  56. new SqlParameter("@G_VisaCoefficient",gbi.G_VisaCoefficient),
  57. new SqlParameter("@G_VisaCostPrice",gbi.G_VisaCostPrice),
  58. new SqlParameter("@G_VisaOffer",gbi.G_VisaOffer),
  59. new SqlParameter("@G_AirDetails",gbi.G_AirDetails),
  60. new SqlParameter("@G_AirCoefficient",gbi.G_AirCoefficient),
  61. new SqlParameter("@G_AirCostPrice",gbi.G_AirCostPrice),
  62. new SqlParameter("@G_AirOffer",gbi.G_AirOffer),
  63. new SqlParameter("@G_GroundingDetails",gbi.G_GroundingDetails),
  64. new SqlParameter("@G_GroundingCoefficient",gbi.G_GroundingCoefficient),
  65. new SqlParameter("@G_GroundingCostPrice",gbi.G_GroundingCostPrice),
  66. new SqlParameter("@G_GroundingOffer",gbi.G_GroundingOffer),
  67. new SqlParameter("@G_HotelDetails",gbi.G_HotelDetails),
  68. new SqlParameter("@G_HotelCoefficient",gbi.G_HotelCoefficient),
  69. new SqlParameter("@G_HotelCostPrice",gbi.G_HotelCostPrice),
  70. new SqlParameter("@G_HotelOffer",gbi.G_HotelOffer),
  71. new SqlParameter("@G_OfficialDetails",gbi.G_OfficialDetails),
  72. new SqlParameter("@G_OfficialCoefficient",gbi.G_OfficialCoefficient),
  73. new SqlParameter("@G_OfficialCostPrice",gbi.G_OfficialCostPrice),
  74. new SqlParameter("@G_OfficialOffer",gbi.G_OfficialOffer),
  75. new SqlParameter("@G_Oper",gbi.G_Oper),
  76. new SqlParameter("@G_OPDate",gbi.G_OPDate),
  77. new SqlParameter("@G_Isdel",gbi.G_Isdel)
  78. };
  79. if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
  80. return true;
  81. return false;
  82. }
  83. }
  84. }