Пример #1
0
        //对页面SysManage.aaspx的数据填充
        public Dictionary <string, object> GetDownList()
        {
            Dictionary <string, object> dic = new Dictionary <string, object>();

            dic.Add("DateFormat", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.DATE_DISPLAY_FORMAT)));              // 日期格式
            dic.Add("NumberFormat", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.NUMBER_DISPLAY_FORMAT)));          // 数字格式
            dic.Add("TimeFormat", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.TIME_DISPLAY_FORMAT)));              // 时间格式(正数)
            dic.Add("EmailType", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.EMAILTYPE)));
            dic.Add("Sex", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.SEX)));
            dic.Add("NameSuffix", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.NAME_SUFFIX)));

            //权限
            var Security_Level = new sys_security_level_dal().FindListBySql("select id,name from sys_security_level where delete_time=0");

            dic.Add("Security_Level", Security_Level);

            //地址
            var Position = new sys_organization_location_dal().FindListBySql("select id,name from sys_organization_location where delete_time=0");

            dic.Add("Position", Position);
            // Position
            dic.Add("Outsource_Security", new d_general_dal().GetDictionary(new d_general_table_dal().GetById((int)GeneralTableEnum.OUTSOURCE_SECURITY)));
            //var location=new sys_organization_location_dal()
            //Position
            return(dic);
        }
Пример #2
0
        /// <summary>
        /// 根据地址id获取时区//具体显示后期需要修改8-24
        /// </summary>
        /// <returns></returns>
        public string GetTime_zone(int id)
        {
            var location = new sys_organization_location_dal().FindById(id);

            if (location != null && location.time_zone_id != null)
            {
                var timezone = new d_time_zone_dal().FindById((int)location.time_zone_id);
                if (timezone != null)
                {
                    return(timezone.standard_name);
                }
            }
            return("");
        }
Пример #3
0
        /// <summary>
        /// 获取主要地址信息
        /// </summary>
        void GetlocationInfo(HttpContext context)
        {
            string locaName = string.Empty;
            string timeName = string.Empty;

            if (!string.IsNullOrEmpty(context.Request.QueryString["id"]))
            {
                var thisLoca = new sys_organization_location_dal().FindNoDeleteById(long.Parse(context.Request.QueryString["id"]));
                if (thisLoca != null)
                {
                    locaName = thisLoca.name; timeName = new DepartmentBLL().GetTime_zone((int)thisLoca.id);
                }
            }
            WriteResponseJson(new { locaName = locaName, timeName = timeName });
        }
Пример #4
0
        /// <summary>
        /// 区域管理
        /// </summary>
        public bool OrganizationManage(sys_organization_location location, long user_id)
        {
            sys_organization_location_dal solDal = new sys_organization_location_dal();


            var defaultLoca = GetDefaultOrganization();

            if (location.is_default == 1)
            {
                if (defaultLoca != null && defaultLoca.id != location.id)
                {
                    defaultLoca.is_default = 0;
                    OrganizationManage(defaultLoca, user_id);
                }
            }
            else
            {
                if (defaultLoca == null)
                {
                    return(false);
                }
            }
            if (location.id == 0)
            {
                location.id             = solDal.GetNextIdCom();
                location.create_time    = location.update_time = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                location.create_user_id = location.update_user_id = user_id;
                solDal.Insert(location);
            }
            else
            {
                var oldLocaton = GetOrganization(location.id);
                if (oldLocaton == null)
                {
                    return(false);
                }
                location.update_time    = Tools.Date.DateHelper.ToUniversalTimeStamp(DateTime.Now);
                location.update_user_id = user_id;
                solDal.Update(location);
            }

            return(true);
        }