public ActionResult GetUserList() { Users users = new Users(); string strWhere = " 1=1 "; string KeyWord = DNTRequest.GetString("KeyWord"); string RoleID = DNTRequest.GetString("RoleID"); int rows = DNTRequest.GetInt("rows", 10); if (KeyWord != "") { strWhere += " and (Uname like '%" + KeyWord + "%') or ( UId in (select UId from .[dbo].Users where truename like '%" + KeyWord + "%')) "; } if (RoleID != "") { strWhere += " and UId in (select UId from .[dbo].Users where roleId=" + RoleID.ToString() + ")"; } int count = 0; //string sql = @"select p.Uname,p.Sex,p.roleId,p.truename,p.UId from Users p order by UId desc"; //string sql = @"select * ,(select top 1 truename from [dbo].Users where UId=m.UId) as truename, (select roleName from Role where roleId in(select top 1 roleId from Users where UId=m.UId)) as roelName from .[dbo].Users m where " + strWhere; DataSet ds = bll.GetUserList(); // DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, 7, rows, "UId desc"), out count); List <VURser> list = TBToList <VURser> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <VURser> >(); grid.total = count; grid.rows = list; return(Json(grid, JsonRequestBehavior.AllowGet)); }
public ActionResult GetRoleList(int?page) { page = page == null ? 1 : page; //string sql = "select m.*,d.ItemText StatusName from tb_Role m left join tb_Doption d on d.MoptionID=2 and d.ItemValue=m.Status where 1=1 "; string KeyWord = DNTRequest.GetString("KeyWord"); string Status = DNTRequest.GetString("Status"); int rows = DNTRequest.GetInt("rows", 10); //if (KeyWord != "") //{ // sql += " and (m.RoleName like '%" + KeyWord + "%') "; //} //if (Status != "") //{ // sql += " and (m.Status =" + Status + ")"; //} int count = 0; DataSet ds = ubll.GetList(); //DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, page.Value, rows, "RoleID desc"), out count); List <Role> list = TBToList <Role> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <Role> >(); grid.total = count; grid.rows = list; //JavaScriptSerializer js = new JavaScriptSerializer(); return(Json(grid, JsonRequestBehavior.AllowGet)); }
public ActionResult GetGoodsList() { int count = 0; //string sql = @"select p.Uname,p.Sex,p.roleId,p.truename,p.UId from Users p order by UId desc"; //string sql = @"select * ,(select top 1 truename from [dbo].Users where UId=m.UId) as truename, (select roleName from Role where roleId in(select top 1 roleId from Users where UId=m.UId)) as roelName from .[dbo].Users m where " + strWhere; DataSet ds = bll.GetGoodsList(); List <Goods> list = TBToList <Goods> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <Goods> >(); grid.total = count; grid.rows = list; return(Json(grid, JsonRequestBehavior.AllowGet)); }
public ActionResult GetSOList() { int count = 0; //string sql = @"select p.Uname,p.Sex,p.roleId,p.truename,p.UId from Users p order by UId desc"; //string sql = @"select * ,(select top 1 truename from [dbo].Users where UId=m.UId) as truename, (select roleName from Role where roleId in(select top 1 roleId from Users where UId=m.UId)) as roelName from .[dbo].Users m where " + strWhere; DataSet ds = bll.GetsOrdermin(); // DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, 7, rows, "UId desc"), out count); List <VOrderSminxi> list = TBToList <VOrderSminxi> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <VOrderSminxi> >(); grid.total = count; grid.rows = list; return(Json(grid, JsonRequestBehavior.AllowGet)); }
public ActionResult GetProductTypeList(int id = 0, string KeyWord = "") { int count = 0; string sql = "SELECT [id] ,[code] ,[name],[ParentId],[AddTime] FROM [" + DBName + "].[dbo].[tb_ProductType] "; string strWhere = " Where 1=1"; if (KeyWord != "") { strWhere += " and ( id in ( select id from [" + DBName + "].[dbo].[tb_ProductType] where code like '%" + KeyWord + "%' or name like '%" + KeyWord + "%' ) "; strWhere += " or id in ( select ParentId from [" + DBName + "].[dbo].[tb_ProductType] where code like '%" + KeyWord + "%' or name like '%" + KeyWord + "%' ) ) "; } //sql = sql + strWhere; //DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, 1, 10000, "id desc"), out count); //List<MenuPage> list = TBToList<MenuPage>.ConvertToList(ds.Tables[0]).ToList(); ////List<tb_ProductType> list = ef.tb_ProductType.Where(p => p.MenuID > 0).ToList(); //List<MenuPage> listJson = new List<MenuPage>(); //foreach (tb_ProductType model in list.Where(p => p.ParentId == 0).OrderBy(p => p.id)) //{ // MakeMenuJson(list, model, id); // listJson.Add(model); //} //return Json(listJson, JsonRequestBehavior.AllowGet); GoodsBLL bn = new GoodsBLL(); //string sql = @"select p.Uname,p.Sex,p.roleId,p.truename,p.UId from Users p order by UId desc"; //string sql = @"select * ,(select top 1 truename from [dbo].Users where UId=m.UId) as truename, (select roleName from Role where roleId in(select top 1 roleId from Users where UId=m.UId)) as roelName from .[dbo].Users m where " + strWhere; DataSet ds = bn.GetMenu(); // DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, 7, rows, "UId desc"), out count); List <MenuPage> list = TBToList <MenuPage> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <MenuPage> >(); grid.total = count; grid.rows = list; return(Json(grid, JsonRequestBehavior.AllowGet)); }
public ActionResult GetListtb_Store(int?page) { string KeyWord = DNTRequest.GetString("KeyWord"); int rows = DNTRequest.GetInt("rows", 10); string strWhere = " 1=1 "; if (KeyWord != "") { strWhere += " and (Name like '%" + KeyWord + "%' or code like '%" + KeyWord + "%') "; } int count = 0; DataSet ds = gb.GetMenushop(); //string sql = @"select * from [" + DBName + @"].[dbo].[tb_Store] where " + strWhere; //DataSet ds = DataPageHelper.GetDataPage(DataPageHelper.GetPageSql(sql, page.Value, rows, "id desc"), out count); List <VUShop> list = TBToList <VUShop> .ConvertToList(ds.Tables[0]).ToList(); var grid = new EasyuiDataGrid <List <VUShop> >(); grid.total = count; grid.rows = list; return(Json(grid, JsonRequestBehavior.AllowGet)); }