public Task <bool> BatchSetOpenIdAsync() { Task <bool> result = new Task <bool>(() => { var execute = false; var client = _sugarFactory.GetInstance(_options.First().ConnectionString, _options.First().ProviderName); client.Ado.UseTran(() => { var list = client.Queryable <Base_UserEntity>().Select(c => new Base_UserEntity { UserId = c.UserId }).ToList(); foreach (var data in list) { data.OpenId = Encrypt.Md5($"{data.UserId.ToUpper()}{"fl7236a0c8e83fa133".ToUpper()}"); } execute = client.Updateable(list).Where(true).ExecuteCommandHasChange(); }); return(execute); }); result.Start(); return(result); }
public ActionResult AddListSalesDetail(List <P_ConsumptionInfo> cilist) { CodeModels.CallBackEntity <string> cbe = new CallBackEntity <string>(); SqlSugarClient sclient = SugarFactory.GetInstance(); var result = sclient.Ado.UseTran(() => { foreach (P_ConsumptionInfo ci in cilist) { if (ci.Consumption_Money != null && ci.Consumption_Money != 0) { ci.Consumption_Code = Guid.NewGuid(); int count = sclient.Insertable <P_ConsumptionInfo>(ci).ExecuteCommand(); } } }); if (result.IsSuccess) { cbe.Status = 200; cbe.Msg = "成功"; } else { cbe.Status = 400; cbe.Msg = "提交数据有误!"; } return(Json(cbe)); }
public ActionResult Save(FormCollection f, P_CommodityType info) { int count = 0; if (info.Id > 0) { count = SugarFactory.GetInstance().Updateable <P_CommodityType>(info).ExecuteCommand(); } else { count = SugarFactory.GetInstance().Insertable <P_CommodityType>(info).ExecuteCommand(); } if (info.Id == 0) { if (count > 0) { return(Json(TipHelper.JsonData("新增类别成功!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } else { return(Json(TipHelper.JsonData("新增类别失败!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } } else { if (count > 0) { return(Json(TipHelper.JsonData("更新类别成功!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } else { return(Json(TipHelper.JsonData("更新类别失败!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } } }
public ActionResult AjaxList(jQueryDataTableParamModel param) { ISugarQueryable <P_CommodityType> sqable = SugarFactory.GetInstance().Queryable <P_CommodityType>(); //获取总记录数 this.TotalRecordCount = sqable.Count(); this.PageSize = 15; int allcount = this.TotalRecordCount; List <P_CommodityType> CommodityAll = sqable.ToPageList(param.iDisplayStart / param.iDisplayLength + 1, this.PageSize, ref allcount); //转化数据格式 var result = from m in CommodityAll select new[] { m.Type_Code.ToString(), m.Type_Name, }; //返回json数据 return(Json( new { sEcho = param.sEcho, iTotalRecords = this.TotalRecordCount, iTotalDisplayRecords = this.TotalRecordCount, aaData = result } )); }
public ActionResult AjaxClassMenuList(jQueryDataTableParamModel param) { //获取总记录数 this.TotalRecordCount = SugarFactory.GetInstance().Ado.GetInt("select Count(*) from P_SystemMenu");; this.PageSize = 15; int allcount = this.TotalRecordCount; List <P_SystemMenu> menuAll = SugarFactory.GetInstance().Queryable <P_SystemMenu>().OrderBy(it => it.Menu_Id, SqlSugar.OrderByType.Asc).ToPageList(param.iDisplayStart / param.iDisplayLength + 1, this.PageSize, ref allcount); //转化数据格式 var result = from m in menuAll select new[] { m.Menu_Code.ToString(), m.Menu_Name, m.Menu_Image, m.Menu_Url, m.Menu_Order.ToString() }; //返回json数据 return(Json( new { sEcho = param.sEcho, iTotalRecords = this.TotalRecordCount, iTotalDisplayRecords = this.TotalRecordCount, aaData = result } )); }
public ActionResult Login(FormCollection fc) { string account = fc["account"].ToString(); string password = fc["password"].ToString(); P_User user = SugarFactory.GetInstance().Queryable <P_User>().Where(it => it.User_Accounts == account).AddJoinInfo("P_SystemRoles", "s2", "User_Roles_Code=Role_Code").Select("P_User.*,s2.Role_Name").Single(); string pass = Encryption.GetMd5(password); if (user != null) { if (user.User_Pwd.Equals(Encryption.GetMd5(password))) { ContextConfig.SetUser(user); return(Content("toastr.success('登陆成功!');", "application/x-javascript")); } else { return(Content("toastr.success('密码错误!');", "application/x-javascript")); } } else { return(Content("toastr.success('用户不存在!');", "application/x-javascript")); } }
public ActionResult AddSalesDetail(P_ConsumptionInfo ci) { CodeModels.CallBackEntity <string> cbe = new CallBackEntity <string>(); if (ci.Consumption_Money != null && ci.Consumption_Money != 0) { ci.Consumption_Code = Guid.NewGuid(); int count = SugarFactory.GetInstance().Insertable <P_ConsumptionInfo>(ci).ExecuteCommand(); if (count > 0) { cbe.Status = 200; cbe.Msg = "成功"; } else { cbe.Status = 400; cbe.Msg = "失败"; } } else { cbe.Status = 400; cbe.Msg = "金额不能为空"; } return(Json(cbe)); }
public User FirstOrDefault(Expression <Func <User, bool> > predicate) { using (var db = SugarFactory.GetInstance()) { // select single var single = db.Queryable <User>().Single(predicate); return(single); } }
public User Insert(User entity) { using (var db = SugarFactory.GetInstance()) { // insert item db.Insert(entity); return(entity); } }
public bool IsExist(Expression <Func <User, bool> > predicate) { using (var db = SugarFactory.GetInstance()) { // is any bool isAny = db.Queryable <User>().Any(predicate); return(isAny); } }
public User Update(User entity) { using (var db = SugarFactory.GetInstance()) { // update by entity db.Update(entity); return(entity); } }
public void Init() { Console.WriteLine("启动MappingColumns.Init"); //全局设置 using (var db = SugarFactory.GetInstance()) { var list = db.Queryable <Student>().Where(it => it.classId == 1).ToList(); } }
public ActionResult AjaxList(jQueryDataTableParamModel param) { //条件 string isExecutedSearch = Request.Params.Get("isExecutedSearch"); string where = " 1=1 "; if (isExecutedSearch != null && isExecutedSearch == "1") { if (!String.IsNullOrEmpty(Request.Params.Get("searchtype"))) { if (Request.Params.Get("searchtype").Trim() != "") { where += "and Commodity_TypeCode='" + Request.Params.Get("searchtype").Trim() + "'"; } } if (!String.IsNullOrEmpty(Request.Params.Get("searchparam"))) { if (Request.Params.Get("searchparam").Trim() != "") { where += "and Commodity_Name like '%" + Request.Params.Get("searchparam").Trim() + "%' or BarCode like '%" + Request.Params.Get("searchparam").Trim() + "%'"; } } } //获取总记录数 this.TotalRecordCount = SugarFactory.GetInstance().Ado.GetInt("select Count(*) from P_CommodityInfo where" + where); this.PageSize = 15; int allcount = this.TotalRecordCount; List <P_CommodityInfo> CommodityAll = SugarFactory.GetInstance().Queryable <P_CommodityInfo>().AddJoinInfo("P_CommodityType", "s2", "Commodity_TypeCode = s2.Type_Code").Select("P_CommodityInfo.*,s2.Type_Name").WhereIF(true, where).ToPageList(param.iDisplayStart / param.iDisplayLength + 1, this.PageSize, ref allcount); //转化数据格式 var result = from m in CommodityAll select new[] { m.Commodity_Code.ToString(), m.Commodity_Name, m.BarCode, m.Type_Name, m.PCSalePrice.Value.ToString(), m.RetailPrice.Value.ToString(), m.Specification, m.Commodity_Unit }; //返回json数据 return(Json( new { sEcho = param.sEcho, iTotalRecords = this.TotalRecordCount, iTotalDisplayRecords = this.TotalRecordCount, aaData = result } )); }
public ActionResult AjaxUserList(jQueryDataTableParamModel param) { //条件 string isExecutedSearch = Request.Params.Get("isExecutedSearch"); string where = " 1=1 "; if (isExecutedSearch != null && isExecutedSearch == "1") { if (!String.IsNullOrEmpty(Request.Params.Get("searchMname"))) { if (Request.Params.Get("searchMname").Trim() != "") { where += "and P_User.Merchant_Code='" + Request.Params.Get("searchMname").Trim() + "'"; } } if (!String.IsNullOrEmpty(Request.Params.Get("searchparam"))) { if (Request.Params.Get("searchparam").Trim() != "") { where += "and User_Accounts like '%" + Request.Params.Get("searchparam").Trim() + "%' or User_Name like '%" + Request.Params.Get("searchparam").Trim() + "%' or User_Phone like '%" + Request.Params.Get("searchparam").Trim() + "%'"; } } } //获取总记录数 this.TotalRecordCount = SugarFactory.GetInstance().Ado.GetInt("select Count(*) from P_User where" + where); this.PageSize = 5; int allcount = this.TotalRecordCount; List <P_User> UserAll = SugarFactory.GetInstance().Queryable <P_User>().AddJoinInfo("P_MerchantInfo", "s2", "P_User.Merchant_Code = s2.Merchant_Code").AddJoinInfo("P_SystemRoles", "s3", "User_Roles_Code=s3.Role_Code").Select("P_User.*,s2.Merchant_Name,s3.Role_Name").WhereIF(true, where).ToPageList(param.iDisplayStart / param.iDisplayLength + 1, this.PageSize, ref allcount); //转化数据格式 var result = from m in UserAll select new[] { m.User_Code.ToString(), m.User_Accounts, m.User_Name, m.User_Sex, m.User_Phone, m.User_Address, m.Merchant_Name, m.Role_Name }; //返回json数据 return(Json( new { sEcho = param.sEcho, iTotalRecords = this.TotalRecordCount, iTotalDisplayRecords = this.TotalRecordCount, aaData = result } )); }
public ActionResult DeleteMerchantInfo(string code) { int rcount = SugarFactory.GetInstance().Deleteable <P_MerchantInfo>().Where(it => it.Merchant_Code == Guid.Parse(code)).ExecuteCommand(); if (rcount > 0) { return(Json(TipHelper.JsonData("删除成功!", "", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.RefreshThisPage)));; } else { return(Json(TipHelper.JsonData("删除失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction))); } }
public ActionResult AddType(string code) { AdminPanel.CodeModels.P_CommodityType CommInfo = new P_CommodityType(); if (!String.IsNullOrEmpty(code)) { CommInfo = SugarFactory.GetInstance().Queryable <P_CommodityType>().InSingle(code); } else { CommInfo.Type_Code = Guid.NewGuid(); //CommInfo.Creator = ContextConfig.GetUser().User_Code.ToString(); CommInfo.Creator = "admin"; CommInfo.Creation_Time = DateTime.Now; } return(View(CommInfo)); }
public ActionResult SaveRoles(FormCollection f, P_SystemRoles info) { int count = 0; if (info.Role_Id > 0) { count = SugarFactory.GetInstance().Updateable <P_SystemRoles>(info).ExecuteCommand(); } else { count = SugarFactory.GetInstance().Insertable <P_SystemRoles>(info).ExecuteCommand(); } SugarFactory.GetInstance().Deleteable <P_RolesToMenu>().Where(it => it.RTM_Roles_Code == info.Role_Code).ExecuteCommand(); if (!String.IsNullOrEmpty(info.MenuCodes)) { string[] strs = info.MenuCodes.TrimEnd(',').Split(','); foreach (string item in strs) { P_RolesToMenu rtm = new P_RolesToMenu(); rtm.RTM_Menu_Code = Guid.Parse(item); rtm.RTM_Roles_Code = info.Role_Code; SugarFactory.GetInstance().Insertable <P_RolesToMenu>(rtm).ExecuteCommand(); } } if (info.Role_Id == 0) { if (count > 0) { return(Json(TipHelper.JsonData("新增角色成功!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } else { return(Json(TipHelper.JsonData("新增角色失败!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } } else { if (count > 0) { return(Json(TipHelper.JsonData("更新角色成功!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } else { return(Json(TipHelper.JsonData("更新角色失败!", "", IsAlertTip.No, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.CloseDialogAndRefreshThisPage))); } } }
public ActionResult Save(FormCollection fc, P_User cm) { int rcount = 0; if (!String.IsNullOrEmpty(cm.User_Pwd)) { cm.User_Pwd = Encryption.GetMd5(cm.User_Pwd); } else { P_User pu = SugarFactory.GetInstance().Queryable <P_User>().InSingle(cm.User_Code); cm.User_Pwd = pu.User_Pwd; } if (Convert.ToInt32(fc["Id"]) > 0) { rcount = SugarFactory.GetInstance().Updateable <P_User>(cm).ExecuteCommand(); } else { rcount = SugarFactory.GetInstance().Insertable <P_User>(cm).ExecuteCommand(); } string formOperateType = fc["formOperateType"].ToString().ToLower(); if (formOperateType == "saveandnewnext") { if (rcount > 0) { return(Json(TipHelper.JsonData("新增用户信息成功", "", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.RefreshThisPage))); } else { return(Json(TipHelper.JsonData("新增用户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction))); } } else { if (rcount > 0) { return(Json(TipHelper.JsonData("保存用户信息成功!", "/UserInfo/UserList", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.ThisPageGoAnotherPage))); } else { //表单提交失败固定写法 return(Json(TipHelper.JsonData("保存用户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction))); } } }
public void Init(DbType type) { Console.WriteLine("启动MappingTable.Init"); //单个设置 using (var db = SugarDao.GetInstance(type)) { var list = db.Queryable <V_Student>("Student").ToList();//查询的是 select * from student 而我的实体名称为V_Student } //全局设置 using (var db = SugarFactory.GetInstance(type)) { var list = db.Queryable <V_Student>().ToList();//查询的是 select * from student 而我的实体名称为V_Student } }
public ActionResult CreateMerchantInfo(string code, string type) { AdminPanel.CodeModels.P_MerchantInfo CommInfo = new P_MerchantInfo(); if (code != null) { CommInfo = SugarFactory.GetInstance().Queryable <P_MerchantInfo>().InSingle(code); } else { CommInfo.Merchant_Code = Guid.NewGuid(); //CommInfo.Creator = ContextConfig.GetUser().User_Code.ToString(); CommInfo.Creator = "admin"; CommInfo.Creation_Time = DateTime.Now; } ViewBag.type = type; return(View(CommInfo)); }
public ActionResult AddSalesDetail(P_ConsumptionInfo ci) { if (ci.Consumption_Money != null && ci.Consumption_Money != 0) { ci.Consumption_Code = Guid.NewGuid(); int count = SugarFactory.GetInstance().Insertable <P_ConsumptionInfo>(ci).ExecuteCommand(); if (count > 0) { Content("success"); } else { Content("faile"); } } return(Content("")); }
public ActionResult AddRoles(string code) { ISugarQueryable <P_SystemMenu> sql = SugarFactory.GetInstance().Queryable <P_SystemMenu>().Where(it => it.Menu_Parent != 0).OrderBy(it => it.Menu_Id, SqlSugar.OrderByType.Asc); P_SystemRoles sr = new P_SystemRoles(); if (String.IsNullOrEmpty(code)) { ViewBag.MenuList = sql.ToList(); } else { sr = SugarFactory.GetInstance().Queryable <P_SystemRoles>().Where(it => it.Role_Code == Guid.Parse(code)).Single(); List <P_SystemMenu> menulist = sql.AddJoinInfo("P_RolesToMenu", "rm", "rm.RTM_Menu_Code=Menu_Code and rm.RTM_Roles_Code='" + code + "'", JoinType.Left).Select("P_SystemMenu.*,RTM_Id").ToList(); ViewBag.MenuList = menulist; } return(View(sr)); }
public void Init() { Console.WriteLine("启动SerialNumber.Init"); using (SqlSugarClient db = SugarFactory.GetInstance())//开启数据库连接 { var dientityValue = db.Insert <StudentEntity>(new StudentEntity() { }); var name = db.Queryable <StudentEntity>().Single(it => it.id == dientityValue.ObjToInt()).name; Console.WriteLine(name); var dientityValue2 = db.Insert <School>(new School() { }); var name2 = db.Queryable <School>().Single(it => it.id == dientityValue2.ObjToInt()).name; Console.WriteLine(name2);; } }
public ActionResult AddMerchantInfo(AdminPanel.CodeModels.P_MerchantInfo cm) { CodeModels.CallBackEntity <string> cbe = new CallBackEntity <string>(); cm.Merchant_Code = Guid.NewGuid(); int rcount = SugarFactory.GetInstance().Insertable <P_MerchantInfo>(cm).ExecuteCommand(); if (rcount > 0) { cbe.Status = 200; cbe.Data = cm.Merchant_Code.ToString(); cbe.Msg = "成功"; } else { cbe.Status = 400; cbe.Msg = "失败"; } return(Json(cbe)); }
public ActionResult AddMenu(string code) { P_SystemMenu sm = new P_SystemMenu(); if (String.IsNullOrEmpty(code)) { sm.Menu_Createtime = DateTime.Now; sm.Menu_Creator = "admin"; sm.Menu_Code = Guid.NewGuid(); } else { sm = SugarFactory.GetInstance().Queryable <P_SystemMenu>().Where(tb => tb.Menu_Code == Guid.Parse(code)).Single(); } ViewBag.ParentList = SugarFactory.GetInstance().Queryable <P_SystemMenu>().Where(it => it.Menu_Parent == 0).ToList(); return(View(sm)); }
public ActionResult AjaxList(jQueryDataTableParamModel param) { //条件 string isExecutedSearch = Request.Params.Get("isExecutedSearch"); string where = " 1=1 "; if (isExecutedSearch != null && isExecutedSearch == "1") { if (!String.IsNullOrEmpty(Request.Params.Get("searchparam"))) { if (Request.Params.Get("searchparam").Trim() != "") { where += "and Merchant_Name like '%" + Request.Params.Get("searchparam").Trim() + "%' or SevenCents_Code like '%" + Request.Params.Get("searchparam").Trim() + "%' or Merchant_Phone like '%" + Request.Params.Get("searchparam").Trim() + "%'"; } } } //获取总记录数 this.TotalRecordCount = SugarFactory.GetInstance().Ado.GetInt("select Count(*) from P_MerchantInfo where" + where); this.PageSize = 5; int allcount = this.TotalRecordCount; List <P_MerchantInfo> CommodityAll = SugarFactory.GetInstance().Queryable <P_MerchantInfo>().WhereIF(true, where).ToPageList(param.iDisplayStart / param.iDisplayLength + 1, this.PageSize, ref allcount); //转化数据格式 var result = from m in CommodityAll select new[] { m.Merchant_Code.ToString(), m.Merchant_Name, m.Ipay_Code, m.Merchant_Phone, m.Merchant_Address }; //返回json数据 return(Json( new { sEcho = param.sEcho, iTotalRecords = this.TotalRecordCount, iTotalDisplayRecords = this.TotalRecordCount, aaData = result } )); }
public ActionResult AddUser(string code, string type) { ViewBag.MerchantInfo = SugarFactory.GetInstance().Queryable <P_MerchantInfo>().ToList(); ViewBag.SystemRoles = SugarFactory.GetInstance().Queryable <P_SystemRoles>().ToList(); P_User CommInfo = new P_User(); if (code != null) { CommInfo = SugarFactory.GetInstance().Queryable <P_User>().InSingle(Guid.Parse(code)); CommInfo.User_Pwd = ""; } else { CommInfo.User_Code = Guid.NewGuid(); //CommInfo.Creator = ContextConfig.GetUser().User_Code.ToString(); CommInfo.Creator = "admin"; CommInfo.Creation_Time = DateTime.Now; } ViewBag.type = type; return(View(CommInfo)); }
public ActionResult Save(FormCollection fc, AdminPanel.CodeModels.P_MerchantInfo cm) { int rcount = 0; if (Convert.ToInt32(fc["Id"]) > 0) { rcount = SugarFactory.GetInstance().Updateable <P_MerchantInfo>(cm).ExecuteCommand(); } else { rcount = SugarFactory.GetInstance().Insertable <P_MerchantInfo>(cm).ExecuteCommand(); } string formOperateType = fc["formOperateType"].ToString().ToLower(); if (formOperateType == "saveandnewnext") { if (rcount > 0) { return(Json(TipHelper.JsonData("新增商户信息成功", "", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.RefreshThisPage))); } else { return(Json(TipHelper.JsonData("新增商户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction))); } } else { if (rcount > 0) { return(Json(TipHelper.JsonData("保存商户信息成功!", "/MerchantInfo/MerchantInfoList", IsAlertTip.Yes, TipType.Success, AlertTipPageType.ThisPage, OperateTypeAfterTip.ThisPageGoAnotherPage))); } else { //表单提交失败固定写法 return(Json(TipHelper.JsonData("保存商户信息失败!", "", IsAlertTip.Yes, TipType.Error, AlertTipPageType.ThisPage, OperateTypeAfterTip.NoAction))); } } }
public void Init() { Console.WriteLine("启动MappingTable.Init"); //单个设置 using (var db = SugarDao.GetInstance()) { var list = db.Queryable <V_Student>("Student").ToList();//查询的是 select * from student 而我的实体名称为V_Student } //全局设置 using (var db = SugarFactory.GetInstance()) { var list = db.Queryable <V_Student>().ToList();//查询的是 select * from student 而我的实体名称为V_Student db.SetMappingTables(null);//清空 db.AddMappingTable(new KeyValue() { Key = "", Value = "" }); } }
public ActionResult Left() { //ISugarQueryable<P_SystemMenu> sql = SugarFactory.GetInstance().Queryable<P_SystemMenu>().OrderBy(sm => sm.Menu_Id, OrderByType.Asc); //List<P_SystemMenu> menuAll2=sql.ToList(); ISugarQueryable <P_SystemMenu> sql = SugarFactory.GetInstance().Queryable <P_SystemMenu>().AddJoinInfo("P_RolesToMenu", "s2", "Menu_code=RTM_Menu_code and RTM_Roles_Code='" + ContextConfig.GetUser().User_Roles_Code + "'", JoinType.Inner).Select("P_SystemMenu.*").OrderBy("Menu_id asc"); List <P_SystemMenu> menuAll = sql.ToList(); ArrayList list = new ArrayList(); foreach (P_SystemMenu item in menuAll) { if (!list.Contains(item.Menu_Parent + "")) { list.Add(item.Menu_Parent + ""); } } string[] strs = (string[])list.ToArray(typeof(string)); List <P_SystemMenu> menuAll2 = SugarFactory.GetInstance().Queryable <P_SystemMenu>().In(it => it.Menu_Id, strs).OrderBy(sm => sm.Menu_Id, OrderByType.Asc).ToList(); menuAll.AddRange(menuAll2); ViewBag.LeftMenuTree = LeftMenuTree(menuAll); return(View()); }