예제 #1
0
        public static string GetCurrentEmployeeIPaddress()
        {
            AppConfigs conf     = AppConfigs.Load();
            string     Username = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToLower();

            List <Employee> emp             = conf.Employees;
            Employee        CurrentEmployee = emp.Where(e => e.Username.ToLower() == Username).FirstOrDefault();

            if (CurrentEmployee != null)
            {
                return(CurrentEmployee.IPAddress);
            }

            return(null);
        }
        public static void Save(AppConfigs conf)
        {
            JavaScriptSerializer _serializer = new JavaScriptSerializer();

            AddOrUpdateAppSettings("AppConfigs", _serializer.Serialize(conf));
        }