Пример #1
0
        //public ActionResult Update(int id)
        //{
        //    using (DbConn PubConn = DbConfig.CreateConn(Config.PlatformManageConnectString))
        //    {
        //        PubConn.Open();
        //        tb_cluster_collect_version_model model = new tb_cluster_collect_version_dal().Get(PubConn, id);
        //        return View(model);
        //    }
        //}

        //[HttpPost]
        //public ActionResult Update(tb_cluster_collect_version_model model,httppo)
        //{
        //    tb_cluster_collect_version_dal dal = new tb_cluster_collect_version_dal();
        //    try
        //    {
        //        using (DbConn PubConn = DbConfig.CreateConn(Config.PlatformManageConnectString))
        //        {
        //            PubConn.Open();
        //            dal.Update(PubConn, model);
        //            return RedirectToAction("index");
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        ModelState.AddModelError("Error", ex.Message);
        //        return View(model);
        //    }
        //}

        public JsonResult Delete(int id)
        {
            try
            {
                tb_cluster_collect_version_dal dal = new tb_cluster_collect_version_dal();
                using (DbConn PubConn = DbConfig.CreateConn(Config.PlatformManageConnectString))
                {
                    PubConn.Open();
                    dal.Delete(PubConn, id);
                    return(Json(new { code = 1, msg = "Success" }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { code = -1, msg = ex.Message }));
            }
        }