Ejemplo n.º 1
0
        public ActionResult gjcqDetails(int gjid)
        {
            HTYGjSearchModel model = new HTYGjSearchModel {
                gjid = gjid
            };
            var Datas    = zjSvc.GetHTYGjData(model);
            var SubDatas = gjcqRep.GetByCondition(w => w.gjid == gjid);
            HTYGjcqDetailViewModel viewModel = new HTYGjcqDetailViewModel();

            if (Datas != null && Datas.Count > 0)
            {
                var Data              = Datas.First();
                var tjjdSysDict       = sysDictService.GetDictsByKey("TJJD");
                var jzmSysDict        = sysDictService.GetDictsByKey("JZM");
                var bsfsSysDict       = sysDictService.GetDictsByKey("BSFS");
                HTYGjDTOViewModel Dto = Data.ConvertTo <HTYGjDTOViewModel>();
                if (Data.tjjd.HasValue)
                {
                    Dto.tjjd = SysDictUtility.GetKeyFromDic(tjjdSysDict, Data.tjjd.ToString());
                }
                if (Data.jzm.HasValue)
                {
                    Dto.jzm = SysDictUtility.GetKeyFromDic(jzmSysDict, Data.jzm.ToString());
                }
                if (Data.bsfs.HasValue)
                {
                    Dto.bsfs = SysDictUtility.GetKeyFromDic(bsfsSysDict, Data.bsfs.ToString());
                }
                viewModel.Data     = Dto;
                viewModel.SubDatas = SubDatas;
            }

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        public ActionResult UnitBuildingQualify(int?id)
        {
            var model = new UnitQualifyUIModel();
            var tbOne = repOne.GetById(id);

            model.ID       = id.ToString();
            model.UnitName = tbOne.unitname;
            model.FRDB     = tbOne.name;

            var custom = repCustom.GetById(tbOne.unitCode);

            if (tbOne.type != "0")
            {
                model.YYJCZZ = custom.zzlbmc; //原有检测资质
            }

            var tbTwo = repTwo.GetByCondition(r => r.pid == id).FirstOrDefault();

            if (tbTwo != null)
            {
                model.OnesSb      = tbTwo.measnum; //计量认证编号
                model.MeasnumPath = tbTwo.measnumpath;
                model.sqjcyw      = tbTwo.sqjcyw;  //现有检测资质
            }

            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult Grid()
        {
            var sysDicts = rep.GetByCondition(r => r.Id > 0);

            string str = GetGridXmlString(sysDicts);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 4
0
        public ActionResult Grid(int id)
        {
            var    paths   = rep.GetByCondition(r => r.CategoryId == id);
            var    actions = actionRep.GetByCondition(ar => paths.Select(p => p.Id).ToList().Contains(ar.PathId));
            string str     = GetGridXmlString(paths, actions);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 5
0
        public ActionResult StatisUserCustomTree(int id)
        {
            var      userCustoms = userCustomrep.GetByCondition(r => r.UserId == id && r.UserCustomType == UserCustomType.UserLogCustom);
            XElement rootElem    = BuildInstAreaTree(checkUnitService, userCustoms.Select(uc => uc.CustomId).ToList());

            string str = rootElem.ToString(SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 6
0
        // GET: SysUser/Edit/5
        public ActionResult Edit(int id)
        {
            var user     = userRep.GetById(id);
            var userRole = userInRoleRep.GetByCondition(r => r.UserId == id);

            user.UserRoles = userRole;
            string str = user.ToJson();

            return(Content(str));
        }
Ejemplo n.º 7
0
        public List <t_bp_area> GetAllArea()
        {
            var cacheKey = PkPmCacheKeys.AllListArea;
            var areas    = cacheAllArea.Get(cacheKey);

            if (areas == null)
            {
                areas = rep.GetByCondition(t => t.PAREACODE != null);
                cacheAllArea.Remove(cacheKey);
                cacheAllArea.Put(cacheKey, areas);
            }
            return(areas);
        }
Ejemplo n.º 8
0
        public Role GetDefaultRole()
        {
            var roles = roleRep.GetByCondition(r => r.Code == pkpmConfigService.InstRoleCode);

            if (roles != null && roles.Count > 0)
            {
                return(roles.First());
            }
            else
            {
                return(roleRep.GetByCondition(r => true).First());
            }
        }
Ejemplo n.º 9
0
        public UserAsRole GetByWxOpenId(string openId)
        {
            List <WxUser> wxUsers = m_repWxUser.GetByCondition(r => r.OpenId == openId);

            if (wxUsers.Count == 0)
            {
                return(null);
            }
            else
            {
                return(userAsRoleRep.GetById(wxUsers[0].UserId));
            }
        }
Ejemplo n.º 10
0
        public ActionResult Roles(int id)
        {
            var userRole = userService.GetUserRole(id);
            var allRoles = roleRep.GetByCondition(r => r.Id > 0);

            DhtmlxForm dForm = new DhtmlxForm();

            dForm.AddDhtmlxFormItem(new DhtmlxFormLabel("角色"));
            dForm.AddDhtmlxFormItem(new DhtmlxFormSettings().AddStringItem("offsetLeft", "50"));
            foreach (var role in allRoles)
            {
                bool isChecked = false;
                if (userRole != null && userRole.Id == role.Id)
                {
                    isChecked = true;
                }
                if (isChecked)
                {
                    dForm.AddDhtmlxFormItem(new DhtmlxFormRadio("Role", role.Id.ToString(), role.Name, true));
                }
                else
                {
                    dForm.AddDhtmlxFormItem(new DhtmlxFormRadio("Role", role.Id.ToString(), role.Name, false));
                }
            }
            dForm.AddDhtmlxFormItem(new DhtmlxFormButton("Save", "确定"));

            string str = dForm.BuildDhtmlXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 11
0
        public List <UIArea> GetAllAreas()
        {
            string cacheKey = PkPmCacheKeys.AllAreasFromSysDict;
            var    areas    = cacheAreas.Get(cacheKey);

            if (areas == null)
            {
                List <SysDict> result       = new List <SysDict>();
                var            dictCategory = dictRep.GetByCondition(r => r.KeyValue == "CustomArea" && r.CategoryId == -1 && r.Status == 1);
                if (dictCategory != null && dictCategory.Count > 0)
                {
                    result = dictRep.GetByConditionSort(r => r.CategoryId == dictCategory[0].Id, new SortingOptions <SysDict>(r => new { r.OrderNo }));
                }
                areas = result.Where(e => e.KeyValue != "500100" || !e.Name.Contains("重庆市")).Select(r => new UIArea()
                {
                    AreaCode = r.KeyValue, AreaName = r.Name
                }).ToList();
                cacheAreas.Put(cacheKey, areas);
                return(areas);
            }
            else
            {
                return(areas);
            }
        }
Ejemplo n.º 12
0
        public ActionResult CheckUser(int id)
        {
            var user     = userRep.GetById(id);
            var userRole = userInRoleRep.GetByCondition(r => r.UserId == id);

            user.UserRoles = userRole;
            var custom = t_bp_customRep.GetByCondition(u => u.ID == user.CustomId).Select(u => u.NAME).FirstOrDefault();

            if (user.Email == null || user.Email == "")
            {
                user.Email = "空";
            }
            if (custom != null && custom != "")
            {
                user.CustomId = custom.ToString();
            }
            else
            {
                user.CustomId = "系统用户";
            }
            var usertype = sysDictService.GetDictsByKey("UserType").Where(u => u.KeyValue == user.Grade).Select(u => u.Name).FirstOrDefault();

            if (usertype != null && usertype != "")
            {
                user.Grade = usertype.ToString();
            }
            else
            {
                user.Grade = "检测中心用户";
            }
            string str = user.ToJson();

            return(Content(str));
        }
Ejemplo n.º 13
0
        public ActionResult GetSuperJob(string Id)
        {
            SupvisorJob Result = new SupvisorJob();
            var         model  = supvisorRep.GetByCondition(w => w.CustomId == Id && w.NeedApproveId == Id && w.ApproveType == ApproveType.STApproveEquip).OrderByDescending(o => o.CreateTime);

            return(View(model.FirstOrDefault()));
        }
Ejemplo n.º 14
0
        public ActionResult Details(int id)
        {
            ZNHTYFangAnViewModel model = new ZNHTYFangAnViewModel();
            var progData = HTYRep.GetById(id);

            if (!string.IsNullOrEmpty(progData.filepath))
            {
                progData.filepath = SymCryptoUtility.Encrypt(progData.filepath);
            }
            if (!string.IsNullOrEmpty(progData.hqfilepath))
            {
                progData.hqfilepath = SymCryptoUtility.Encrypt(progData.hqfilepath);
            }

            model.programme = progData;
            var projects = projectRep.GetByCondition(r => r.PROJECTNUM == model.programme.projectnum);//.GetById(id);

            if (projects != null && projects.Count > 0)
            {
                model.project       = projects.First();
                model.PLANSTARTDATE = model.project.PLANSTARTDATE.HasValue ? model.project.PLANSTARTDATE.Value.ToString("yyyy-MM-dd") : string.Empty;
            }

            model.date = (model.programme.planstartdate.HasValue ? model.programme.planstartdate.Value.ToString("yyyy-MM-dd") : string.Empty) + " - " + (model.programme.planenddate.HasValue ? model.programme.planenddate.Value.ToString("yyyy-MM-dd") : string.Empty);
            var allCustoms = checkUnitServce.GetAllCheckUnit();

            model.programme.unitcode = checkUnitServce.GetCheckUnitByIdFromAll(allCustoms, model.programme.unitcode);

            var peopleIds = progData.testingpeople;

            if (!peopleIds.IsNullOrEmpty())
            {
                var peoIds  = peopleIds.Split(',').ToList();
                var peoples = peopleRep.GetByCondition(w => peoIds.Contains(w.id.ToString()));
                model.people = peoples;
            }
            var equipIds = progData.testingequipment;

            if (!equipIds.IsNullOrEmpty())
            {
                var equIds = equipIds.Split(',').ToList();
                var equips = equipRep.GetByCondition(w => equIds.Contains(w.id.ToString()));
                model.EquipNums = equips.Select(s => s.equnum).Join(",");
            }
            return(View(model));
        }
Ejemplo n.º 15
0
        public List <TestType_BM> GetAllCompanyQualification()
        {
            var companyQualification = cacheQualification.Get(PkPmCacheKeys.CompanyQualification);

            if (companyQualification == null)
            {
                companyQualification = qualificationRep.GetByCondition(t => t.pid == 0 && t.FTestTypeName != "市政工程类" && t.FTestTypeName != "桥梁工程类" && t.FTestTypeName != "预拌商品混凝土");
                cacheQualification.Put(PkPmCacheKeys.CompanyQualification, companyQualification);
            }
            return(companyQualification);
        }
        // GET: ApplyQuakifySix
        public ActionResult Index(string id)
        {
            ViewBag.Id = id;
            var path     = sixFileRep.GetByCondition(r => r.pid == int.Parse(id)).FirstOrDefault();
            var filepath = string.Empty;

            if (path != null)
            {
                filepath = path.filepath;
            }

            return(View(filepath));
        }
Ejemplo n.º 17
0
        public List <Entity.Path> GetAllCategory()
        {
            var paths = cachePaths.Get(PkPmCacheKeys.CategoryPaths);

            if (paths != null)
            {
                return(paths);
            }
            else
            {
                paths = pathRep.GetByCondition(p => p.IsCategory && p.Status == 1);
                cachePaths.Put(PkPmCacheKeys.CategoryPaths, paths);
                return(paths);
            }
        }
        public ActionResult CreateQualifySixSearch(DetailQualifyFiveSearchModel model)
        {
            var instDicts       = checkUnitService.GetAllCheckUnit();
            var workStatus      = sysDictServcie.GetDictsByKey("workStatus");
            var personnelTitles = sysDictServcie.GetDictsByKey("personnelTitles");
            var personnelStatus = sysDictServcie.GetDictsByKey("personnelStatus");
            var unitcode        = repOne.GetById(model.pid);
            var peoples         = peopleRep.GetByCondition(r => r.Customid == unitcode.unitCode && r.Approvalstatus == "3");
            //var peoples = peopleRep.GetByCondition(r => r.Customid == "1900021");
            DhtmlxGrid grid       = new DhtmlxGrid();
            string     customname = string.Empty;
            int        pos        = model.posStart.HasValue ? model.posStart.Value : 0;
            int        index      = pos;

            foreach (var item in peoples)
            {
                customname = checkUnitService.GetCheckUnitByIdFromAll(instDicts, item.Customid);
                DhtmlxGridRow row = new DhtmlxGridRow(item.id.ToString());
                //勾选,序号,姓名,性别,年龄,学历,专业,身份证号,从事检测工作类别,从事检测工作年限,社会保险证号,岗位证书编号,职务,职称,在职状况,状态
                row.AddCell("");
                row.AddCell((++index).ToString());
                row.AddCell(item.Name);
                row.AddCell(item.Sex);
                row.AddCell(item.age);
                row.AddCell(item.Education);
                row.AddCell(item.Professional);
                //row.AddCell(customname);
                row.AddCell(item.SelfNum);
                row.AddCell(string.Empty);
                row.AddCell(item.gznx);
                row.AddCell(item.SBNum);
                row.AddCell(item.PostNum);
                row.AddCell(item.zw);
                row.AddCell(SysDictUtility.GetKeyFromDic(personnelTitles, item.Title));
                row.AddCell(SysDictUtility.GetKeyFromDic(workStatus, item.iscb));
                row.AddCell(SysDictUtility.GetKeyFromDic(personnelStatus, item.Approvalstatus));
                row.AddCell(item.educationpath);
                row.AddCell(item.titlepath);
                row.AddCell(item.selfnumPath);
                row.AddCell(item.PostPath);
                row.AddCell(new DhtmlxGridCell("查看", false).AddCellAttribute("title", "查看"));
                grid.AddGridRow(row);
            }

            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 19
0
        public List <UserInArea> GetUserAreas(int userId)
        {
            string cacheKey = PkPmCacheKeys.UserInAreByUserIdFmt.Fmt(userId);
            var    areas    = cacheUserInArea.Get(cacheKey);

            if (areas == null)
            {
                areas = userInAreaRep.GetByCondition(r => r.UserId == userId);
                cacheUserInArea.Put(cacheKey, areas);
                return(areas);
            }
            else
            {
                return(areas);
            }
        }
Ejemplo n.º 20
0
        //private  string defaultInst = pkpmConfigService.DefaultInst; //System.Configuration.ConfigurationManager.AppSettings["SysDefaultInst"];
        // private static string defaultInpsect = System.Configuration.ConfigurationManager.AppSettings["SysDefaultInspect"];

        public List <t_sys_region> GetAllArea()
        {
            var cacheKey = PkPmCacheKeys.AllArea;
            var allArea  = areaCache.Get(cacheKey);

            if (allArea != null)
            {
                return(allArea);
            }
            else
            {
                var areas = areaRep.GetByCondition(t => true);
                areaCache.Add(cacheKey, areas);
                return(areas);
            }
        }
        public List <STCheckPeopleChangeModel> CheckPeopleChange(int id)
        {
            List <STCheckPeopleChangeModel> CheckPeopleChanges = new List <STCheckPeopleChangeModel>();
            var peoChange = peoChangeRep.GetByCondition(r => r.PeopleId == id);

            for (int i = 0; i < peoChange.Count; i++)
            {
                var change = peoChange[i];
                STCheckPeopleChangeModel CheckPeopleChange = new STCheckPeopleChangeModel();
                CheckPeopleChange.Number     = i + 1;
                CheckPeopleChange.ChaDate    = change.ChaDate.HasValue ? change.ChaDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                CheckPeopleChange.ChaContent = change.ChaContent;
                CheckPeopleChange.Id         = change.Id.ToString();
                CheckPeopleChange.PeopleId   = change.PeopleId.ToString();
                CheckPeopleChanges.Add(CheckPeopleChange);
            }
            return(CheckPeopleChanges);
        }
        public List <STCheckPeopleAwardsModel> CheckPeopleAwards(int id)
        {
            List <STCheckPeopleAwardsModel> CheckPeopleAwards = new List <STCheckPeopleAwardsModel>();
            var peoAward = peoAwardRep.GetByCondition(r => r.PeopleId == id);

            for (int i = 0; i < peoAward.Count; i++)
            {
                var peoAwa = peoAward[i];
                STCheckPeopleAwardsModel model = new STCheckPeopleAwardsModel();
                model.Number     = (i + 1).ToString();
                model.AwaDate    = peoAwa.AwaDate.HasValue ? peoAwa.AwaDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                model.AwaContent = peoAwa.AwaContent;
                model.AwaUnit    = peoAwa.AwaUnit;
                model.Id         = peoAwa.Id.ToString();
                model.PeopleId   = peoAwa.PeopleId.ToString();
                CheckPeopleAwards.Add(model);
            }
            return(CheckPeopleAwards);
        }
        public List <STCheckPeoplePunishModel> CheckPeoplePunish(int id)
        {
            var CheckPeoplePunishs = new List <STCheckPeoplePunishModel>();
            var punish             = punishRep.GetByCondition(r => r.PeopleId == id);

            for (int i = 0; i < punish.Count; i++)
            {
                var pu = punish[i];
                STCheckPeoplePunishModel CheckPeoplePunish = new STCheckPeoplePunishModel();
                CheckPeoplePunish.Number     = (i + 1).ToString();
                CheckPeoplePunish.PunDate    = pu.PunDate.HasValue ? pu.PunDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                CheckPeoplePunish.PunName    = pu.PunName;
                CheckPeoplePunish.PunUnit    = pu.PunUnit;
                CheckPeoplePunish.PunContent = pu.PunContent;
                CheckPeoplePunish.Id         = pu.Id.ToString();
                CheckPeoplePunish.PeopleId   = pu.PeopleId.ToString();
                CheckPeoplePunishs.Add(CheckPeoplePunish);
            }
            return(CheckPeoplePunishs);
        }
        public List <STCheckPeopleEducationModel> CheckPeopleEducation(int id)
        {
            List <STCheckPeopleEducationModel> CheckPeopleEducations = new List <STCheckPeopleEducationModel>();
            var education = eduRep.GetByCondition(r => r.PeopleId == id);

            for (int i = 0; i < education.Count; i++)
            {
                var edu = education[i];
                STCheckPeopleEducationModel CheckPeopleEducation = new STCheckPeopleEducationModel();
                CheckPeopleEducation.Number       = i + 1;
                CheckPeopleEducation.TrainDate    = edu.TrainDate.HasValue ? edu.TrainDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                CheckPeopleEducation.TrainContent = edu.TrainContent;
                CheckPeopleEducation.TrainUnit    = edu.TrainUnit;
                CheckPeopleEducation.TestDate     = edu.TestDate.HasValue ? edu.TestDate.Value.ToString("yyyy-MM-dd") : string.Empty;
                CheckPeopleEducation.Id           = edu.Id.ToString();
                CheckPeopleEducation.PeopleId     = edu.PeopleId.ToString();
                CheckPeopleEducations.Add(CheckPeopleEducation);
            }
            return(CheckPeopleEducations);
        }
Ejemplo n.º 25
0
        public List <SysDict> GetDictsByKey(string key)
        {
            string cachekey     = PkPmCacheKeys.SysDictByKeyFmt.Fmt(key);
            var    dictCategory = cache.Get(cachekey);

            if (dictCategory != null)
            {
                return(dictCategory);
            }
            else
            {
                List <SysDict> result = new List <SysDict>();
                dictCategory = rep.GetByCondition(r => r.KeyValue == key && r.CategoryId == -1 && r.Status == 1);
                if (dictCategory != null && dictCategory.Count > 0)
                {
                    result = rep.GetByConditionSort(r => r.CategoryId == dictCategory[0].Id, new SortingOptions <SysDict>(r => new { r.OrderNo }));
                }
                cache.Remove(cachekey);
                cache.Add(cachekey, result);
                return(result);
            }
        }
Ejemplo n.º 26
0
        public ItemShortInfos GetAllItemName()
        {
            var data = cacheItem.Get(PkPmCacheKeys.AllItemName);

            if (data == null)
            {
                using (var db = dbFactory.Open())
                {
                    //var dicData = db.Dictionary<string, string>("   select itemTableName,itemChName from uv_t_bp_itemList_view");
                    var allItems = checkItemTypeRep.GetByCondition(r => true);

                    Dictionary <string, string> dicData = new Dictionary <string, string>();
                    foreach (var item in allItems)
                    {
                        string itemKey = "{0}{1}".Fmt(item.CheckItemName, item.CheckItemCode);
                        if (item.CheckItemCode.Contains("MA"))
                        {
                            dicData[itemKey] = item.CheckItemName + "(房建)(" + item.CheckItemCode + ")";
                        }
                        else if (item.CheckItemCode.Contains("MB"))
                        {
                            dicData[itemKey] = item.CheckItemName + "(市政)(" + item.CheckItemCode + ")";
                        }
                        else if (item.CheckItemCode.Contains("MN"))
                        {
                            dicData[itemKey] = item.CheckItemName + "(现场)(" + item.CheckItemCode + ")";
                        }
                        else
                        {
                            dicData[itemKey] = item.CheckItemName + "(房建专项)(" + item.CheckItemCode + ")";
                        }
                    }

                    data = ItemShortInfos.FromDictonary(dicData);
                }
                cacheItem.Put(PkPmCacheKeys.AllItemName, data);
            }
            return(data);
        }
Ejemplo n.º 27
0
        public List <User> GetSysExpertRoleUsers()
        {
            //string cacheKey = PkPmCacheKeys.SysExpertRoleUsers;
            //var role = cacheRole.Get(cacheKey);

            List <User> users = new List <User>();

            var role = roleRep.GetByCondition(r => r.Code == "ZJRY").FirstOrDefault();

            using (var db = dbFactory.Open())
            {
                var q = db.From <User>().Join <UserInRole>((u, ur) => u.Id == ur.UserId)
                        .Where <User, UserInRole>((u, ur) => ur.RoleId == role.Id)
                        .Select <User>(r => new { r.Id, r.CustomId, r.UserName, r.UserDisplayName, r.Sex, r.PhoneNumber, r.Email, r.photopath, r.UnitName });
                users = db.Select <User>(q.Limit(0, 10));
            }
            if (users == null || users.Count == 0)
            {
                return(new List <User>());
            }

            return(users);
        }
Ejemplo n.º 28
0
        public bool GetCheckItemChange(string value, out Dictionary <string, string> dicData)
        {
            dicData = new Dictionary <string, string>();
            try
            {
                using (var db = dbFactory.Open())
                {
                    var allItems = totalItemRep.GetByCondition(r => r.typecode == value);

                    foreach (var item in allItems)
                    {
                        string itemKey = "{0}{1}".Fmt(item.typecode, item.itemcode);
                        if (item.typecode.Contains("MA"))
                        {
                            dicData[itemKey] = item.ItemName + "(房建)(" + item.typecode + ")";
                        }
                        else if (item.typecode.Contains("MB"))
                        {
                            dicData[itemKey] = item.ItemName + "(市政)(" + item.typecode + ")";
                        }
                        else if (item.typecode.Contains("MN"))
                        {
                            dicData[itemKey] = item.ItemName + "(现场)(" + item.typecode + ")";
                        }
                        else
                        {
                            dicData[itemKey] = item.ItemName + "(房建专项)(" + item.typecode + ")";
                        }
                    }
                }
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Ejemplo n.º 29
0
        public ActionResult Menu(int id)
        {
            List <Entity.Path> rolePaths = userService.GetPersonaliztionPaths(id);

            var            menus    = menuRep.GetByCondition(m => m.Status == 1);
            DhtmlxTreeView treeView = new DhtmlxTreeView();

            foreach (var item in menus.Where(m => m.IsCategory))
            {
                DhtmlxTreeViewItem categoryItem = new DhtmlxTreeViewItem(item.Id.ToString(), item.Name, false, false, DhtmlxTreeViewCheckbox.hidden);
                foreach (var subItem in menus.Where(su => su.CategoryId == item.Id))
                {
                    bool hasPath = rolePaths.Exists(r => r.Id == subItem.Id);

                    DhtmlxTreeViewItem subTreeItem = new DhtmlxTreeViewItem(subItem.Id.ToString(), subItem.Name, false, hasPath, DhtmlxTreeViewCheckbox.NotSet);
                    categoryItem.AddTreeViewItem(subTreeItem);
                }
                treeView.AddTreeViewItem(categoryItem);
            }

            string str = treeView.BuildDhtmlXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }
Ejemplo n.º 30
0
        public ActionResult ParmDetails(string id)
        {
            var        parms = rep.GetByCondition(t => t.typecode == id);
            DhtmlxGrid grid  = new DhtmlxGrid();

            for (int i = 0; i < parms.Count; i++)
            {
                var           parm = parms[i];
                DhtmlxGridRow row  = new DhtmlxGridRow(parm.Id.ToString());
                row.AddCell((i + 1).ToString());
                row.AddCell(parm.typecode);
                row.AddCell(parm.itemcode);
                row.AddCell(parm.ItemName);
                row.AddCell(parm.itemtype);

                row.AddCell(new DhtmlxGridCell("编辑", false).AddCellAttribute("title", "编辑"));
                row.AddCell(new DhtmlxGridCell("删除", false).AddCellAttribute("title", "删除"));
                grid.AddGridRow(row);
            }

            string str = grid.BuildRowXml().ToString(System.Xml.Linq.SaveOptions.DisableFormatting);

            return(Content(str, "text/xml"));
        }