/// <summary> /// 添加车辆出租信息 /// </summary> /// <param name="userFromCookie"></param> /// <param name="context"></param> private void AddVehicleRental(DriveMgr.Model.User userFromCookie, HttpContext context) { if (userFromCookie != null && new DriveMgr.BLL.Authority().IfAuthority("vehicleRental", "add", userFromCookie.Id)) { string ui_vehicleRental_StudentName_add = context.Request.Params["ui_vehicleRental_StudentName_add"] ?? ""; //string ui_vehicleRental_StudentCode_add = context.Request.Params["ui_vehicleRental_StudentCode_add"] ?? ""; //string ui_vehicleRental_CoachName_add = context.Request.Params["ui_vehicleRental_CoachName_add"] ?? ""; string ui_vehicleRental_RentDate_add = context.Request.Params["ui_vehicleRental_RentDate_add"] ?? ""; string ui_vehicleRental_LicencePlateNum_add = context.Request.Params["ui_vehicleRental_LicencePlateNum_add"] ?? ""; string ui_vehicleRental_PriceConfig_add = context.Request.Params["ui_vehicleRental_PriceConfig_add"] ?? ""; string ui_vehicleRental_Longer_add = context.Request.Params["ui_vehicleRental_Longer_add"] ?? ""; string ui_vehicleRental_TotalPrice_add = context.Request.Params["ui_vehicleRental_TotalPrice_add"] ?? ""; string ui_vehicleRental_Remark_add = context.Request.Params["ui_vehicleRental_Remark_add"] ?? ""; DriveMgr.Model.VehicleRentalModel vehicleRentalAdd = new Model.VehicleRentalModel(); //vehicleRentalAdd.StudentCode = ui_vehicleRental_StudentName_add.Trim(); vehicleRentalAdd.StudentName = ui_vehicleRental_StudentName_add.Trim(); //vehicleRentalAdd.CoachName = ui_vehicleRental_CoachName_add.Trim(); vehicleRentalAdd.VehicleId = Int32.Parse(ui_vehicleRental_LicencePlateNum_add.Trim()); vehicleRentalAdd.PriceConfigID = Int32.Parse(ui_vehicleRental_PriceConfig_add.Trim()); vehicleRentalAdd.Longer = decimal.Parse(ui_vehicleRental_Longer_add.Trim()); vehicleRentalAdd.TotalPrice = decimal.Parse(ui_vehicleRental_TotalPrice_add.Trim()); vehicleRentalAdd.RentDate = DateTime.Parse(ui_vehicleRental_RentDate_add.Trim()); vehicleRentalAdd.Remark = ui_vehicleRental_Remark_add.Trim(); vehicleRentalAdd.CreateDate = DateTime.Now; vehicleRentalAdd.CreatePerson = userFromCookie.UserId; vehicleRentalAdd.UpdatePerson = userFromCookie.UserId; vehicleRentalAdd.UpdateDate = DateTime.Now; if (vehicleRentalBll.AddVehicleRental(vehicleRentalAdd)) { userOperateLog.OperateInfo = "添加车辆出租信息"; userOperateLog.IfSuccess = true; userOperateLog.Description = "添加成功,车辆出租信息:" + ui_vehicleRental_LicencePlateNum_add.Trim(); context.Response.Write("{\"msg\":\"添加成功!\",\"success\":true}"); } else { userOperateLog.OperateInfo = "添加车辆出租信息"; userOperateLog.IfSuccess = false; userOperateLog.Description = "添加失败"; context.Response.Write("{\"msg\":\"添加失败!\",\"success\":false}"); } } else { userOperateLog.OperateInfo = "添加车辆出租信息"; userOperateLog.IfSuccess = false; userOperateLog.Description = "无权限,请联系管理员"; context.Response.Write("{\"msg\":\"无权限,请联系管理员!\",\"success\":false}"); } DriveMgr.BLL.UserOperateLog.InsertOperateInfo(userOperateLog); }
/// <summary> /// 更新一条数据 /// </summary> public bool UpdateVehicleRental(Model.VehicleRentalModel model) { return(vehicleRentalDal.UpdateVehicleRental(model)); }
/// <summary> /// 增加一条数据 /// </summary> public bool AddVehicleRental(Model.VehicleRentalModel model) { return(vehicleRentalDal.AddVehicleRental(model)); }