//
        // 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));
        }
Exemplo 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;
        }
Exemplo n.º 3
0
        /// <summary>
        /// 字段对应描述列表
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public Dictionary <string, string> ConvertColumn(DataTable dt)
        {
            Dictionary <string, string> dic = new Dictionary <string, string>();

            RoadFlow.Platform.DBConnection conn = new RoadFlow.Platform.DBConnection();
            dic = conn.GetFields(conn.GetAll().First <RoadFlow.Data.Model.DBConnection>().ID, "[Buildings]");//获取所有字段名
            string name = string.Empty;

            for (int j = 0; j < dt.Columns.Count; j++)
            {
                if (dic.Keys.Contains(dt.Columns[j].ColumnName))
                {
                    name = dic[dt.Columns[j].ColumnName];
                    if (!name.IsNullOrEmpty())
                    {
                        dic.Add(dt.Columns[j].ColumnName, name);
                    }
                }
            }
            return(dic);
        }