123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- using Models;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq;
- using System.Text;
- namespace DAL
- {
- public class EnterExitCostService
- {
- List<EnterExitCost> excuteSql(string sql, params SqlParameter[] param)
- {
- return ServiceBase<EnterExitCost>.excuteSql(new EnterExitCost(), "EnterExitCost", sql, CommandType.Text, param);
- }
- EnterExitCost excuteType(string sql, params SqlParameter[] param)
- {
- //查询结果放入对象集合
- List<EnterExitCost> hdList = excuteSql(sql, param);
- //判断集合是否为空
- if (hdList == null || hdList.Count == 0)
- //返回null
- return null;
- //返回单个对象
- return hdList[0];
- }
- //增Add
- public bool Add(EnterExitCost Dov)
- {
- string sql = "insert into EnterExitCost values(@Diid,@InsidePay,@VisaPay,@VisaPayRemark,@SafePay,@YiMiao,@HeSuan,@ServiceFee,@Ticket,@OutsideJJ,@OutsaideGW,@AirJJ,@AirGW,"
- + "@CityTranffic,@RateUSD,@RateJPY,@RateEUR,@RateGBP,@RateHKD,@OPer,@OPDate,@Isdel,@ChoiceOne,@ChoiceTwo,@ChoiceThree,@ChoiceFour,@ChoiceFive,"
- + " @SumJJC,@SumGWC,@AirJJC_Checked,@AirGWC_Checked,@ChoiceSix);SELECT @@IDENTITY";
- SqlParameter[] parameter = new SqlParameter[]{
- new SqlParameter("@Diid",Dov.Diid),
- new SqlParameter("@InsidePay",Dov.InsidePay),
- new SqlParameter("@VisaPay",Dov.VisaPay),
- new SqlParameter("@VisaPayRemark",Dov.VisaPayRemark),
- new SqlParameter("@SafePay",Dov.SafePay),
- new SqlParameter("@YiMiao",Dov.YiMiao),
- new SqlParameter("@HeSuan",Dov.HeSuan),
- new SqlParameter("@ServiceFee",Dov.ServiceFee),
- new SqlParameter("@Ticket",Dov.Ticket),
- new SqlParameter("@OutsideJJ",Dov.OutsideJJ),
- new SqlParameter("@OutsaideGW",Dov.OutsaideGW),
- new SqlParameter("@AirJJ",Dov.AirJJ),
- new SqlParameter("@AirGW",Dov.AirGW),
- new SqlParameter("@CityTranffic",Dov.CityTranffic),
- new SqlParameter("@RateUSD",Dov.RateUSD),
- new SqlParameter("@RateJPY",Dov.RateJPY),
- new SqlParameter("@RateEUR",Dov.RateEUR),
- new SqlParameter("@RateGBP",Dov.RateGBP),
- new SqlParameter("@RateHKD",Dov.RateHKD),
- new SqlParameter("@OPer",Dov.OPer),
- new SqlParameter("@OPDate",Dov.OPDate),
- new SqlParameter("@Isdel",Dov.Isdel),
- new SqlParameter("@ChoiceOne",Dov.ChoiceOne),
- new SqlParameter("@ChoiceTwo",Dov.ChoiceTwo),
- new SqlParameter("@ChoiceThree",Dov.ChoiceThree),
- new SqlParameter("@ChoiceFour",Dov.ChoiceFour),
- new SqlParameter("@ChoiceFive",Dov.ChoiceFive),
- new SqlParameter("@SumJJC",Dov.SumJJC),
- new SqlParameter("@SumGWC",Dov.SumGWC),
- new SqlParameter("@AirJJC_Checked",Dov.AirJJC_Checked),
- new SqlParameter("@AirGWC_Checked",Dov.AirGWC_Checked),
- new SqlParameter("@ChoiceSix",Dov.ChoiceSix)
- };
- int obj = Convert.ToInt32(SqlHelper.ExecuteScalar(sql, CommandType.Text, parameter));
- if (obj > 0)
- {
- return true;
- }
- return false;
- }
- //改Update
- public bool Edit(EnterExitCost Dov)
- {
- string sql = "update EnterExitCost set Diid=@Diid,InsidePay=@InsidePay,VisaPay=@VisaPay,VisaPayRemark=@VisaPayRemark,SafePay=@SafePay,YiMiao=@YiMiao,HeSuan=@HeSuan,ServiceFee=@ServiceFee,Ticket=@Ticket,OutsideJJ=@OutsideJJ,OutsaideGW=@OutsaideGW,"
- + "AirJJ=@AirJJ,AirGW=@AirGW,CityTranffic=@CityTranffic,RateUSD=@RateUSD,RateJPY=@RateJPY,RateEUR=@RateEUR,RateHKD=@RateHKD,"
- + "RateGBP=@RateGBP,OPer=@OPer,OPDate=@OPDate,Isdel=@Isdel,ChoiceOne=@ChoiceOne,ChoiceTwo=@ChoiceTwo,ChoiceThree=@ChoiceThree,ChoiceFour=@ChoiceFour,ChoiceFive=@ChoiceFive,"
- + "SumJJC=@SumJJC,SumGWC=@SumGWC,AirJJC_Checked=@AirJJC_Checked,AirGWC_Checked=@AirGWC_Checked,ChoiceSix=@ChoiceSix where Id = @Id";
- SqlParameter[] parameter = new SqlParameter[]{
- new SqlParameter("@Diid",Dov.Diid),
- new SqlParameter("@InsidePay",Dov.InsidePay),
- new SqlParameter("@VisaPay",Dov.VisaPay),
- new SqlParameter("@VisaPayRemark",Dov.VisaPayRemark),
- new SqlParameter("@SafePay",Dov.SafePay),
- new SqlParameter("@YiMiao",Dov.YiMiao),
- new SqlParameter("@HeSuan",Dov.HeSuan),
- new SqlParameter("@ServiceFee",Dov.ServiceFee),
- new SqlParameter("@Ticket",Dov.Ticket),
- new SqlParameter("@OutsideJJ",Dov.OutsideJJ),
- new SqlParameter("@OutsaideGW",Dov.OutsaideGW),
- new SqlParameter("@AirJJ",Dov.AirJJ),
- new SqlParameter("@AirGW",Dov.AirGW),
- new SqlParameter("@CityTranffic",Dov.CityTranffic),
- new SqlParameter("@RateUSD",Dov.RateUSD),
- new SqlParameter("@RateJPY",Dov.RateJPY),
- new SqlParameter("@RateEUR",Dov.RateEUR),
- new SqlParameter("@RateGBP",Dov.RateGBP),
- new SqlParameter("@RateHKD",Dov.RateHKD),
- new SqlParameter("@OPer",Dov.OPer),
- new SqlParameter("@OPDate",Dov.OPDate),
- new SqlParameter("@Isdel",Dov.Isdel),
- new SqlParameter("@ChoiceOne",Dov.ChoiceOne),
- new SqlParameter("@ChoiceTwo",Dov.ChoiceTwo),
- new SqlParameter("@ChoiceThree",Dov.ChoiceThree),
- new SqlParameter("@ChoiceFour",Dov.ChoiceFour),
- new SqlParameter("@ChoiceFive",Dov.ChoiceFive),
- new SqlParameter("@SumJJC",Dov.SumJJC),
- new SqlParameter("@SumGWC",Dov.SumGWC),
- new SqlParameter("@AirJJC_Checked",Dov.AirJJC_Checked),
- new SqlParameter("@AirGWC_Checked",Dov.AirGWC_Checked),
- new SqlParameter("@ChoiceSix",Dov.ChoiceSix),
- new SqlParameter("@Id",Dov.Id)
- };
- if (SqlHelper.ExecuteNonQuery(sql, CommandType.Text, parameter) > 0)
- return true;
- return false;
- }
- //删
- public bool delOA(int id)
- {
- if (SqlHelper.ExecuteNonQuery("update EnterExitCost set Isdel=1 where Id= @Id", CommandType.Text, new SqlParameter("@Id", id)) > 0)
- return true;
- return false;
- }
- public bool delbydiid(string diid)
- {
- if (SqlHelper.ExecuteNonQuery("update EnterExitCost set Isdel = 1 where diid = "+ diid, CommandType.Text) > 0)
- return true;
- return false;
- }
- public EnterExitCost getById(int id)
- {
- return excuteType("select * from EnterExitCost where Isdel=0 and diid=@id", new SqlParameter("@id", id));
- }
- public EnterExitCost getByDiid(string Diid)
- {
- return excuteType("select * from EnterExitCost where Isdel=0 and Diid =@Diid", new SqlParameter("@Diid", Diid));
- }
- }
- }
|