internal int EditOrderApplyReq_Application(Api_hzins_OrderApplyReq_Application m) { //暂时只有录入保险请求,没有修改保险请求的操作 if (m.id > 0) { return(0); } else { string sql = @"INSERT INTO [api_hzins_OrderApplyReq_Application] ([applicationDate] ,[startDate] ,[endDate] ,[singlePrice] ,[orderid]) VALUES (@applicationDate ,@startDate ,@endDate ,@singlePrice ,@orderid);select @@identity;"; var cmd = sqlHelper.PrepareTextSqlCommand(sql); cmd.AddParam("@applicationDate", m.applicationDate); cmd.AddParam("@startDate", m.startDate); cmd.AddParam("@endDate", m.endDate); cmd.AddParam("@singlePrice", m.singlePrice); cmd.AddParam("@orderid", m.orderid); object o = cmd.ExecuteScalar(); return(int.Parse(o.ToString())); } }
public int EditOrderApplyReq_Application(Api_hzins_OrderApplyReq_Application m) { using (var helper = new SqlHelper()) { int r = new Internalapi_hzins_OrderApplyReq_Application(helper).EditOrderApplyReq_Application(m); return(r); } }
internal Api_hzins_OrderApplyReq_Application GetOrderApplyReq_Application(int orderid) { string sql = "select * from api_hzins_OrderApplyReq_Application where orderid=" + orderid; var cmd = sqlHelper.PrepareTextSqlCommand(sql); using (var reader = cmd.ExecuteReader()) { Api_hzins_OrderApplyReq_Application m = null; if (reader.Read()) { m = new Api_hzins_OrderApplyReq_Application { id = reader.GetValue <int>("id"), applicationDate = reader.GetValue <string>("applicationDate"), startDate = reader.GetValue <string>("startDate"), endDate = reader.GetValue <string>("endDate"), singlePrice = reader.GetValue <decimal>("singlePrice"), orderid = reader.GetValue <int>("orderid") }; } return(m); } }