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()); }
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 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 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()); }