예제 #1
0
        /// <summary>
        /// 获取大厦详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string GetDetails(string id)
        {
            var       info = new RoadFlow.Platform.BuildingsAndBuildingMonthInfoBLL().Get(Guid.Parse(id)); //大楼信息
            DataTable ep   = new RoadFlow.Platform.EnterpriseAndEnterpriseTaxBLL().GetAllByBuildingID(id); //入驻企业信息

            if (info == null)
            {
                return(string.Empty);
            }
            else
            {
                var dictionarys = new RoadFlow.Platform.DictionaryBLL().GetListAll();
                info.LYJBName   = dictionarys.Find(p => p.ID == info.LYJB.Value) == null ? "" : dictionarys.Find(p => p.ID == info.LYJB.Value).Title;
                info.LYLXName   = dictionarys.Find(p => p.ID == info.LYLX.Value) == null ? "" : dictionarys.Find(p => p.ID == info.LYLX.Value).Title;
                info.JSJDName   = dictionarys.Find(p => p.ID == info.JSJD.Value) == null ? "" : dictionarys.Find(p => p.ID == info.JSJD.Value).Title;
                info.SSJDName   = dictionarys.Find(p => p.ID == info.SSJD.Value) == null ? "" : dictionarys.Find(p => p.ID == info.SSJD.Value).Title;
                info.SY_ZJName  = dictionarys.Find(p => p.ID == info.SY_ZJ.Value) == null ? "" : dictionarys.Find(p => p.ID == info.SY_ZJ.Value).Title;
                info.SW_ZJName  = dictionarys.Find(p => p.ID == info.SW_ZJ.Value) == null ? "" : dictionarys.Find(p => p.ID == info.SW_ZJ.Value).Title;
                info.TCZSName   = dictionarys.Find(p => p.ID == info.TCZS.Value) == null ? "" : dictionarys.Find(p => p.ID == info.TCZS.Value).Title;
                info.ZYKTName   = dictionarys.Find(p => p.ID == info.ZYKT.Value) == null ? "" : dictionarys.Find(p => p.ID == info.ZYKT.Value).Title;
                info.LYCQQKName = dictionarys.Find(p => p.ID == info.LYCQQK.Value) == null ? "" : dictionarys.Find(p => p.ID == info.LYCQQK.Value).Title;
                //info = ConvertType(info);
                //ep = ConvertType(ep);
                Dictionary <string, string> columnName = new Dictionary <string, string>();
                return(new { info, ep, columnName }.ToJson());
            }
        }
예제 #2
0
        /// <summary>
        /// 编码转换
        /// </summary>
        /// <returns></returns>
        public static DataTable DictionaryIdToName(DataTable dt)
        {
            Dictionary <string, string> piName = new Dictionary <string, string>();
            var list = new RoadFlow.Platform.DictionaryBLL().GetAll();

            //编码转换
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    if (dt.Columns[j].ColumnName == "SW_ZJ" || dt.Columns[j].ColumnName == "SY_ZJ")
                    {
                    }
                    else
                    {
                        if (list.FindAll(x => x.Code == dt.Columns[j].ColumnName).Count > 0)
                        {
                            string temp = Convert.ToString(dt.Rows[i][j]);
                            RoadFlow.Data.Model.DictionaryModel dictionary = list.Find(p => p.ID.ToString().ToUpper() == temp.ToUpper());
                            if (dictionary != null)
                            {
                                dt.Rows[i][j] = dictionary.Title;
                            }
                            else
                            {
                                dt.Rows[i][j] = "已删除";
                            }
                        }
                    }
                }
            }
            return(dt);
        }
        /// <summary>
        /// 查询拥有权限。
        /// </summary>
        /// <returns></returns>
        private Dictionary <Guid, string> GetPermission(DataTable dt, ElementOrganizeType type)
        {
            Dictionary <Guid, string> permission = new Dictionary <Guid, string>(); //权限列表
            List <RoadFlow.Data.Model.DictionaryModel> dictionary = new RoadFlow.Platform.DictionaryBLL().GetListByCode("LPMC").ToList <RoadFlow.Data.Model.DictionaryModel>();
            List <string> list = new List <string>();

            foreach (DataRow dr in dt.Rows)
            {
                list.Clear();
                foreach (DataRow item in BLL.GetByTypeAndOrganizeID(type, (Guid)dr["ID"]).Rows)
                {
                    list.Add(dictionary.Find(p => p.ID == (Guid)item["ElementID"]).Title);
                }
                permission.Add((Guid)dr["ID"], string.Join(",", list));
            }

            return(permission);
        }
예제 #4
0
        /// <summary>
        /// 转换数据编码
        /// </summary>
        /// <param name="dt"></param>
        /// <returns></returns>
        public DataTable ConvertType(DataTable dt)
        {
            //取得编码字典
            var list = new RoadFlow.Platform.DictionaryBLL().GetAll();

            //编码转换
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    if (list.FindAll(x => x.Code == dt.Columns[j].ColumnName).Count > 0)
                    {
                        string temp = Convert.ToString(dt.Rows[i][j]);
                        dt.Rows[i][j] = list.Find(x => x.ID.ToString() == temp).Title;
                    }
                }
            }
            return(dt);
        }