Пример #1
0
        public ActionResult Grid1_RowSelect(string selectedRowId, int gridIndex, int gridPageSize, JArray Grid2_fields)
        {
            string sql = string.Empty;

            sql = sql + " and a.GroupID = " + selectedRowId;
            Hashtable table = Panda_PGroupDal.SearchGroupPump(gridIndex, gridPageSize, "PCode", "DESC", sql);

            UIHelper.Grid("Grid2").DataSource(table["data"], Grid2_fields);
            UIHelper.Grid("Grid2").RecordCount(Int32.Parse(table["total"].ToString()));
            return(UIHelper.Result());
        }
Пример #2
0
        private void UpdateGrid(JArray Grid2_fields, int gridIndex, int gridPageSize, string Grid1_selectedRows)
        {
            var    grid2 = UIHelper.Grid("Grid2");
            string sql   = string.Empty;

            sql = sql + " and a.GroupID = " + Grid1_selectedRows;
            Hashtable table = Panda_PGroupDal.SearchGroupPump(gridIndex, gridPageSize, "PCode", "DESC", sql);

            grid2.DataSource(table["data"], Grid2_fields);
            grid2.RecordCount(Int32.Parse(table["total"].ToString()));
        }
Пример #3
0
        public ActionResult ddlGridPageSize_SelectedIndexChanged(string ddlGridPageSize, string ddlGridPageSize_text, int gridIndex, string selectedRowId, JArray Grid2_fields)
        {
            var    grid2 = UIHelper.Grid("Grid2");
            string sql   = string.Empty;

            sql = sql + " and a.GroupID = " + selectedRowId;
            Hashtable table = Panda_PGroupDal.SearchGroupPump(gridIndex, int.Parse(ddlGridPageSize), "PCode", "DESC", sql);

            grid2.DataSource(table["data"], Grid2_fields);
            grid2.RecordCount(Int32.Parse(table["total"].ToString()));
            grid2.PageSize(int.Parse(ddlGridPageSize));
            return(UIHelper.Result());
        }
Пример #4
0
        /// <summary>
        /// 当前登录用户泵房组
        /// </summary>
        /// <returns></returns>
        public string GetUserPumpGroup()
        {
            string pumpList = string.Empty;

            if (User.Identity.IsAuthenticated)
            {
                string    group = Panda_UserInfoDal.Get(GetIdentityName())["UserPumpGroup"].ToString();
                DataTable dt    = Panda_PGroupDal.SearchGroupPump(" and a.GroupID='" + group + "'");
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    pumpList = pumpList + "'" + dt.Rows[i]["PumpID"] + "',";
                }
                return(pumpList.Substring(0, pumpList.LastIndexOf(',')));
            }
            return(String.Empty);
        }
Пример #5
0
        public ActionResult Grid2_PageIndexChanged(string selectedRowId, JArray Grid2_fields, int Grid2_pageIndex, int gridPageSize)
        {
            var grid2 = UIHelper.Grid("Grid2");

            if (selectedRowId.Equals("-1"))
            {
                ViewBag.Grid2DataSource  = null;
                ViewBag.Grid2RecordCount = 0;
                grid2.DataSource(null, Grid2_fields);
                grid2.RecordCount(0);
            }
            else
            {
                string sql = string.Empty;

                sql = sql + " and a.GroupID = " + selectedRowId;
                Hashtable table = Panda_PGroupDal.SearchGroupPump(Grid2_pageIndex, gridPageSize, "PCode", "DESC", sql);
                grid2.DataSource(table["data"], Grid2_fields);
                grid2.RecordCount(Int32.Parse(table["total"].ToString()));
            }

            return(UIHelper.Result());
        }
Пример #6
0
        public ActionResult Grid2_Insert(JArray Grid2_fields, int gridIndex, int gridPageSize, int Grid1_selectedRows, string idList)
        {
            string[]        id   = idList.Split(',');
            Panda_GroupPump pump = new Panda_GroupPump();

            pump.GroupID = Grid1_selectedRows;
            for (int i = 0; i < id.Length; i++)
            {
                pump.PumpID = id[i];
                db.Panda_GroupPump.Add(pump);
                db.SaveChanges();
            }

            var    grid2 = UIHelper.Grid("Grid2");
            string sql   = string.Empty;

            sql = sql + " and a.GroupID = " + Grid1_selectedRows;
            Hashtable table = Panda_PGroupDal.SearchGroupPump(gridIndex, gridPageSize, "PCode", "DESC", sql);

            grid2.DataSource(table["data"], Grid2_fields);
            grid2.RecordCount(Int32.Parse(table["total"].ToString()));
            return(UIHelper.Result());
        }
Пример #7
0
        public ActionResult Index()
        {
            ViewBag.CorePumpGroupNew    = CheckPower("CorePumpGroupNew");
            ViewBag.CorePumpGroupDelete = CheckPower("CorePumpGroupDelete");
            string    sql = string.Empty;
            DataTable dt  = Panda_PGroupDal.SearchPGroup("");

            ViewBag.Grid1DataSource = dt;
            if (dt.Rows.Count > 0)
            {
                ViewBag.Grid1SelectedRowID = dt.Rows[0]["GroupID"].ToString();
                sql = sql + " and a.GroupID = " + dt.Rows[0]["GroupID"].ToString();
                Hashtable table = Panda_PGroupDal.SearchGroupPump(0, 20, "PCode", "DESC", sql);
                ViewBag.Grid2DataSource  = table["data"];
                ViewBag.Grid2RecordCount = Int32.Parse(table["total"].ToString());
            }
            else
            {
                ViewBag.Grid2DataSource  = null;
                ViewBag.Grid2RecordCount = 0;
            }

            return(View());
        }