Esempio n. 1
0
        private void LoginUserLoaded(LoadOperation<User> result)
        {
            if (result.Error == null)
            {
                Login.LoginUser = null;
                foreach (User user in result.Entities)
                    Login.LoginUser = user;

                if (Login.LoginUser != null)
                {
                    SmartMap_DomainContext context = new SmartMap_DomainContext();
                    LoadOperation loadOp = context.Load(context.GetRolePermissionsQuery(Login.LoginUser.RoleID), PermissionsLoaded, null);
                }
                else
                {
                    if (_loadingAnm != null)
                        _loadingAnm.Visibility = Visibility.Collapsed;
                    MessageBox.Show("Incorrect Username or password.");
                }
            }
            else
            {
                if (_loadingAnm != null)
                    _loadingAnm.Visibility = Visibility.Collapsed;
                string msg = result.Error.Message;
                if (result.Error.InnerException != null)
                    msg += ("Inner: \n" + result.Error.InnerException.Message);
                MessageBox.Show("Custom Error Handler:\n"+ msg);
            }
        }
Esempio n. 2
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            if(_loadingAnm != null)
                _loadingAnm.Visibility = Visibility.Visible;

            SmartMap_DomainContext context = new SmartMap_DomainContext();
            LoadOperation loadOp = context.Load<User>(context.GetUserQuery(userNameBox.Text.Trim().ToLower(),passBox.Password),LoginUserLoaded,null);
        }
Esempio n. 3
0
        private void UserLaoded(LoadOperation<User> result)
        {
            Login.LoginUser = null;
            foreach (User user in result.Entities)
                Login.LoginUser = user;

            if (Login.LoginUser != null)
            {
                SmartMap_DomainContext context = new SmartMap_DomainContext();
                LoadOperation loadOp = context.Load(context.GetRolePermissionsQuery(Login.LoginUser.RoleID), PermissionsLoaded, null);
            }
        }
Esempio n. 4
0
        public App()
        {
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Tick += new EventHandler(Timer_Tick);
            timer.Start();
            string uri = this.Host.Source.ToString();

            uri = uri.Substring(0, uri.LastIndexOf("/") + 1) + "Configuration.xml";
            HttpWebRequest webRequest = WebRequest.Create(new Uri(uri)) as HttpWebRequest;

            if (webRequest != null)
                webRequest.BeginGetResponse(getResponse, webRequest);
            else
                MessageBox.Show("Error! Configuration Not Set.");

            if (Cookie.Read(Login.USER_COOKIE_KEY) != null)
            {
                cookieuserexist = true;
                SmartMap_DomainContext context = new SmartMap_DomainContext();
                context.Load<User>(context.GetUserWithoutPasswordQuery(Cookie.Read(Login.USER_COOKIE_KEY)), UserLaoded, null);
            }
        }
 private void LoadAllProductProvinceGroupings()
 {
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     context.Load<ProductProvinceGrouping>(context.GetAllProductProvinceGroupingQuery(), AllProductProvinceGroupings_Loaded, null);
 }
 private void DoneBtn_Click(object sender, RoutedEventArgs e)
 {
     if (SavingLoading != null)
         SavingLoading.Visibility = System.Windows.Visibility.Visible;
     if (DoneBtn != null)
         DoneBtn.IsEnabled = false;
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     if (_grouping == null)
     {
         List<int> list = new List<int>();
         foreach (int productMapId in GetSelectedProductsIds())
             list.Add(productMapId);
         context.PakKonAllProductProvinceGroups(list, ProductProvinceGroup_Deleted, null);
     }
     else
     {
         if (_grouping.Name != GroupingNameTbx.Text)
         {
             _grouping.Name = GroupingNameTbx.Text;
             context.Load<ProvinceGrouping>(context.GetProvinceGroupingByIdQuery(_grouping.ID), ChangedNameGrouping_Loaded, context);
         }
         else
         {
             context.PakKonAllProductProvinceGrouping(_grouping.ID, ProductProvinceGroup_Deleted, null);
         }
     }
 }
Esempio n. 7
0
        public static void Load_ProductMap_Table()
        {
            try
            {
                SmartMap_DomainContext context = new SmartMap_DomainContext();
                LoadOperation<ProductMap> loadOp = context.Load<ProductMap>(context.GetProductMapsQuery(), ProductMapTable_Loaded, null);
            }
            catch (Exception ex)
            {


                string msg = ex.Message;
                if (ex.InnerException != null)
                    msg += ("Inner: \n" + ex.InnerException.Message);
                System.IO.File.WriteAllText(@"C:\inetpub\wwwroot\snfgis\load_productmaptable1_error.txt", msg);
            }
        }
Esempio n. 8
0
 public static void LoadProvinceGroupView()
 {
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     LoadOperation<ProvinceGroupingView> loadOp = context.Load<ProvinceGroupingView>(context.GetProvinceGroupingViewQuery(), ProvinceGroupingView_Loaded ,null);
 }
Esempio n. 9
0
 public static void Load_SpecialObjectiveYears()
 {
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     LoadOperation<ObjectiveSpecialYear> loadOp = context.Load<ObjectiveSpecialYear>(context.GetSpecialObjectiveYearsQuery(), SpecialObjectiveYears_Loaded, null);
 }
Esempio n. 10
0
 public static void Load_ObjectiveNotations()
 {
     SmartMap_DomainContext context = new SmartMap_DomainContext();
     LoadOperation<ObjectiveNotation> loadOp = context.Load<ObjectiveNotation>(context.GetObjectiveTypeNotationsQuery(), ObjectiveTypeNotations_Loaded, null);
 }
Esempio n. 11
0
 private bool Start_Loading_UnloadedTehranPolygons()
 {
     _isLoadingTehranRegions = true;
     int polygonId = Get_Next_UnloadedTehranPolygonId();
     if (polygonId >= 0)
     {
         SmartMap_DomainContext context = new SmartMap_DomainContext();
         LoadOperation loadOp = context.Load(context.GetPointsQuery(polygonId), TehranCustomPoints_Loaded, Create_UserState(Polygons.TehranRegions, polygonId));
         return true;
     }
     else return false;
 }