/// <summary> /// 添加途虎挪车二维码生成记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddMoveCarGenerationRecords(SqlConnection conn, MoveCarGenerationRecordsModel model) { #region SQL const string sql = @" INSERT INTO [Tuhu_profiles].[dbo].[MoveCarGenerationRecords] ( [GeneratedNum] , [GeneratingStatus] , [CreateDatetime] , [LastUpdateDateTime] , [CreateBy] , [LastUpdateBy] ) VALUES ( @GeneratedNum , @GeneratingStatus , GETDATE() , GETDATE() , @CreateBy , @LastUpdateBy ); SELECT SCOPE_IDENTITY()"; #endregion var parameters = new[] { new SqlParameter("@GeneratedNum", model.GeneratedNum), new SqlParameter("@GeneratingStatus", model.GeneratingStatus), new SqlParameter("@CreateBy", model.CreateBy ?? ""), new SqlParameter("@LastUpdateBy", model.LastUpdateBy ?? ""), }; return(Convert.ToInt32(SqlHelper.ExecuteScalar(conn, CommandType.Text, sql, parameters))); }
/// <summary> /// 添加途虎挪车二维码生成记录 /// </summary> /// <param name="model"></param> /// <returns></returns> public int AddMoveCarGenerationRecords(MoveCarGenerationRecordsModel model) { int result = 0; try { using (var conn = ProcessConnection.OpenGungnir) { result = dal.AddMoveCarGenerationRecords(conn, model); } }catch (Exception e) { Logger.Error($"AddMoveCarGenerationRecords-> {JsonConvert.SerializeObject(model)}", e); throw; } return(result); }
public ActionResult GenerationMoveCarQRCode(int generationNum) { var manager = new MoveCarQRCodeManager(); //添加途虎挪车二维码生成记录 var generationRecordModel = new MoveCarGenerationRecordsModel(); generationRecordModel.GeneratedNum = generationNum; generationRecordModel.GeneratingStatus = 0; generationRecordModel.CreateBy = User.Identity.Name; generationRecordModel.LastUpdateBy = User.Identity.Name; int batchID = manager.AddMoveCarGenerationRecords(generationRecordModel);//生成记录表的pkid bool isSuccess = batchID > 0; if (isSuccess) { return(Json(new { status = isSuccess, msg = "操作成功!" })); } else { return(Json(new { status = isSuccess, msg = "操作失败!" })); } }