public static int AddHotelServices(Models.Home.HotelServices model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into HotelServices("); strSql.Append("WeiXinId,UserweixinId,HotelId,ServiceTime,RoomNo,Mobile,Remark,Type,Status,AddTime,Goods,UserName,Feedback1,Feedback2,Feedback3,Feedback4,Feedback5,FMoney,FType"); strSql.Append(") values ("); strSql.Append("@WeiXinId,@UserweixinId,@HotelId,@ServiceTime,@RoomNo,@Mobile,@Remark,@Type,@Status,getdate(),@Goods,@UserName,@Feedback1,@Feedback2,@Feedback3,@Feedback4,@Feedback5,@FMoney,@FType"); strSql.Append(") "); strSql.Append(";select @@IDENTITY"); string obj = HotelCloud.SqlServer.SQLHelper.Get_Value(strSql.ToString(), HotelCloud.SqlServer.SQLHelper.GetCon(), new Dictionary <string, HotelCloud.SqlServer.DBParam> { { "WeiXinId", new HotelCloud.SqlServer.DBParam { ParamValue = model.WeiXinId.ToString() } }, { "UserweixinId", new HotelCloud.SqlServer.DBParam { ParamValue = model.UserweixinId.ToString() } }, { "HotelId", new HotelCloud.SqlServer.DBParam { ParamValue = model.HotelId.ToString() } }, { "ServiceTime", new HotelCloud.SqlServer.DBParam { ParamValue = model.ServiceTime.ToString() } }, { "RoomNo", new HotelCloud.SqlServer.DBParam { ParamValue = model.RoomNo.ToString() } }, { "Mobile", new HotelCloud.SqlServer.DBParam { ParamValue = model.Mobile.ToString() } }, { "Remark", new HotelCloud.SqlServer.DBParam { ParamValue = model.Remark.ToString() } }, { "Type", new HotelCloud.SqlServer.DBParam { ParamValue = model.Type.ToString() } }, { "Status", new HotelCloud.SqlServer.DBParam { ParamValue = model.Status.ToString() } }, { "AddTime", new HotelCloud.SqlServer.DBParam { ParamValue = model.AddTime.ToString() } }, { "Goods", new HotelCloud.SqlServer.DBParam { ParamValue = model.Goods.ToString() } }, { "UserName", new HotelCloud.SqlServer.DBParam { ParamValue = model.UserName.ToString() } }, { "Feedback1", new HotelCloud.SqlServer.DBParam { ParamValue = model.Feedback1.ToString() } }, { "Feedback2", new HotelCloud.SqlServer.DBParam { ParamValue = model.Feedback2.ToString() } }, { "Feedback3", new HotelCloud.SqlServer.DBParam { ParamValue = model.Feedback3.ToString() } }, { "Feedback4", new HotelCloud.SqlServer.DBParam { ParamValue = model.Feedback4.ToString() } }, { "Feedback5", new HotelCloud.SqlServer.DBParam { ParamValue = model.Feedback5.ToString() } }, { "FMoney", new HotelCloud.SqlServer.DBParam { ParamValue = model.FMoney.ToString() } }, { "FType", new HotelCloud.SqlServer.DBParam { ParamValue = model.FType.ToString() } }, }); if (!string.IsNullOrEmpty(obj)) { return(Convert.ToInt32(obj)); } return(0); }
public static int AddHotelServices(Models.Home.HotelServices model) { return(HotelServicesDAL.AddHotelServices(model)); }