public ActionResult MyCustomPostBack(string type, JArray gridFields, JObject typeParams, int gridIndex, int gridPageSize) { var Grid1 = UIHelper.Grid("Grid1"); string sql = string.Empty; var ttbSearch = UIHelper.TwinTriggerBox("ttbSearchMessage"); if (type == "trigger1") { ttbSearch.Text(String.Empty); ttbSearch.ShowTrigger1(false); } else if (type == "trigger2") { ttbSearch.ShowTrigger1(true); var triggerValue = typeParams.Value <string>("triggerValue"); sql = " and GroupName like '%" + triggerValue + "%'"; } Hashtable table = Panda_PGroupDal.SearchPGroup(gridIndex, gridPageSize, "GroupName", "ASC", sql); Grid1.DataSource(table["data"], gridFields); Grid1.RecordCount(Int32.Parse(table["total"].ToString())); Grid1.PageSize(gridPageSize); return(UIHelper.Result()); }
private void UpdateGrid(JArray Grid1_fields) { var grid1 = UIHelper.Grid("Grid1"); string sql = string.Empty; DataTable table = Panda_PGroupDal.SearchPGroup(""); grid1.DataSource(table, Grid1_fields); }
public ActionResult Index() { Hashtable table = Panda_PGroupDal.SearchPGroup(0, 20, "GroupName", "ASC", ""); ViewBag.Grid1DataSource = table["data"]; ViewBag.Grid1RecordCount = Int32.Parse(table["total"].ToString()); return(View()); }
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()); }
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())); }
private void UpdateGrid(JArray Grid1_fields, int gridIndex, int gridPageSize) { var Grid1 = UIHelper.Grid("Grid1"); string sql = string.Empty; //sql = sql + " and FDictID = " + Grid1_selectedRows; Hashtable table = Panda_PGroupDal.SearchPGroup(gridIndex, gridPageSize, "GroupName", "ASC", sql); Grid1.DataSource(table["data"], Grid1_fields); Grid1.RecordCount(Int32.Parse(table["total"].ToString())); }
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()); }
/// <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); }
public ActionResult Grid1_PageIndexChanged(JArray Grid1_fields, int Grid1_pageIndex, int gridPageSize, string searchMessage) { var Grid1 = UIHelper.Grid("Grid1"); string sql = string.Empty; if (!searchMessage.Equals("")) { sql = sql + " and GroupName like '%" + searchMessage + "%'"; } Hashtable table = Panda_PGroupDal.SearchPGroup(Grid1_pageIndex, gridPageSize, "GroupName", "ASC", sql); Grid1.DataSource(table["data"], Grid1_fields); Grid1.RecordCount(Int32.Parse(table["total"].ToString())); return(UIHelper.Result()); }
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()); }
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()); }
public ActionResult Grid1_Delete(JArray selectedRows, JArray Grid1_fields, JArray Grid2_fields, int gridIndex, int gridPageSize) { foreach (string rowId in selectedRows) { Hashtable hasData = new Hashtable(); hasData["GroupID"] = rowId; hasData["FIsDelete"] = 1; hasData["FDelDate"] = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ssss")); hasData["FDelUser"] = GetIdentityName(); Panda_PGroupDal.Update(hasData); } //db.SaveChanges(); DataTable dt = Panda_PGroupDal.SearchPGroup(""); var grid1 = UIHelper.Grid("Grid1"); grid1.DataSource(dt, Grid1_fields); grid1.SelectedRowIDArray(new string[] { "0" }); UpdateGrid(Grid2_fields, gridIndex, gridPageSize, dt.Rows[0]["GroupID"].ToString()); return(UIHelper.Result()); }
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()); }