コード例 #1
0
ファイル: MessageController.cs プロジェクト: xwx2015/MQ
 public ActionResult Update(tb_messagequeue_model model, string node, long id)
 {
     ViewBag.node = node;
     var mqidinfo = XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.PartitionRuleHelper.GetMQIDInfo(Convert.ToInt64(id));
     ViewBag.tablepartition = mqidinfo.TablePartition; ViewBag.daypartition = mqidinfo.Day.ToString("yyMMdd");
     string tablename = PartitionRuleHelper.GetTableName(mqidinfo.TablePartition, mqidinfo.Day);
     var dal = new tb_messagequeue_dal(); dal.TableName = tablename;
     using (DbConn conn = DbConfig.CreateConn(DataConfig.DataNodeParConn(node)))
     {
         conn.Open();
         tb_messagequeue_model result = dal.GetModel(conn, id, tablename);
         if (result != null)
         {
             result.message = model.message;
             result.state = model.state;
             result.source = model.source;
             if (dal.Update(conn, result, tablename))
             {
                 return RedirectToAction("Index", new { node =node, tablepartition = XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.PartitionRuleHelper.PartitionNameRule( mqidinfo.TablePartition), daypartition = mqidinfo.Day.ToString("yyMMdd"), mqid = id });
             }
         }
         ModelState.AddModelError("Error", "更新错误");
         return View(result);
     }
 }
コード例 #2
0
ファイル: MessageController.cs プロジェクト: xwx2015/MQ
 public ActionResult Update(long id, string node)
 {
     using (DbConn conn = DbConfig.CreateConn(DataConfig.DataNodeParConn(node)))
     {
         conn.Open();
         ViewBag.node = node;
         var mqidinfo = XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.PartitionRuleHelper.GetMQIDInfo(Convert.ToInt64(id));
         ViewBag.tablepartition = mqidinfo.TablePartition; ViewBag.daypartition = mqidinfo.Day.ToString("yyMMdd");
         string tablename = PartitionRuleHelper.GetTableName(mqidinfo.TablePartition, mqidinfo.Day);
         var dal = new tb_messagequeue_dal(); dal.TableName = tablename;
         tb_messagequeue_model model = dal.GetModel(conn, id, tablename);
         return View(model);
     }
 }