//
        // GET: /DBConnection/

        public ActionResult Index()
        {
            string query1 = string.Format("&appid={0}&tabid={1}", Request.QueryString["appid"], Request.QueryString["tabid"]);

            RoadFlow.Platform.DBConnection bdbconn = new RoadFlow.Platform.DBConnection();

            if (!Request.Form["DeleteBut"].IsNullOrEmpty())
            {
                string deleteID = Request.Form["checkbox_app"];
                System.Text.StringBuilder delxml = new System.Text.StringBuilder();
                foreach (string id in deleteID.Split(','))
                {
                    Guid gid;
                    if (id.IsGuid(out gid))
                    {
                        delxml.Append(bdbconn.Get(gid).Serialize());
                        bdbconn.Delete(gid);
                    }
                }
                bdbconn.ClearCache();
                RoadFlow.Platform.Log.Add("删除了数据连接", delxml.ToString(), RoadFlow.Platform.Log.Types.流程相关);
            }


            var connList = bdbconn.GetAll();

            ViewBag.Query1 = query1;
            return(View(connList));
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string query1 = string.Format("&appid={0}&tabid={1}", Request.QueryString["appid"], Request.QueryString["tabid"]);

            RoadFlow.Platform.DBConnection bdbconn = new RoadFlow.Platform.DBConnection();

            if (IsPostBack)
            {
                if (!Request.Form["DeleteBut"].IsNullOrEmpty())
                {
                    string deleteID = Request.Form["checkbox_app"];
                    System.Text.StringBuilder delxml = new System.Text.StringBuilder();
                    foreach (string id in deleteID.Split(','))
                    {
                        Guid gid;
                        if (id.IsGuid(out gid))
                        {
                            delxml.Append(bdbconn.Get(gid).Serialize());
                            bdbconn.Delete(gid);
                        }
                    }
                    bdbconn.ClearCache();
                    RoadFlow.Platform.Log.Add("删除了数据连接", delxml.ToString(), RoadFlow.Platform.Log.Types.流程相关);
                }
            }

            ConnList = bdbconn.GetAll();
            Query1   = query1;
        }
        public string Delete()
        {
            RoadFlow.Platform.DBConnection dBConnection = new RoadFlow.Platform.DBConnection();
            string        text          = base.Request.Form["ids"];
            StringBuilder stringBuilder = new StringBuilder();

            string[] array = text.Split(',');
            for (int i = 0; i < array.Length; i++)
            {
                Guid id = default(Guid);
                if (MyExtensions.IsGuid(array[i], out id))
                {
                    stringBuilder.Append(MyExtensions.Serialize((object)dBConnection.Get(id)));
                    dBConnection.Delete(id);
                }
            }
            dBConnection.ClearCache();
            RoadFlow.Platform.Log.Add("删除了数据连接", stringBuilder.ToString(), RoadFlow.Platform.Log.Types.流程相关);
            return("删除成功!");
        }