Exemplo n.º 1
0
        private void ReLoad()
        {
            try
            {
                this.tlUserClient = new TLUSERClient();
                this.branchClient = new BranchClient();
                TLSYSROLEClient roleClient = new TLSYSROLEClient();
                LoadBranch();

                this.IsSingleData = true;

                roleClient.GetByTopTLSYSROLEAsync("", "", "");
                roleClient.GetByTopTLSYSROLECompleted += (s, e) =>
                {
                    ObservableCollection <TL_SYSROLE> tempRole;
                    if (e.Result != null && e.Result.Count > 0)
                    {
                        tempRole = e.Result;
                    }
                    else
                    {
                        tempRole = new ObservableCollection <TL_SYSROLE>();
                    }

                    tempRole.Add(new TL_SYSROLE()
                    {
                        ROLE_ID = CommonResource.lblAll
                    });
                    this.RoleData = tempRole;
                    this.OnPropertyChanged("RoleData");
                };

                this.AuthData = new List <ItemYesNo>()
                {
                    new ItemYesNo()
                    {
                        Id = "A", Name = CommonResource.lblApproved
                    },
                    new ItemYesNo()
                    {
                        Id = "U", Name = CommonResource.lblDisApprove
                    },
                    new ItemYesNo()
                    {
                        Id = "", Name = CommonResource.lblAll
                    }
                };

                this.tlUserClient.SearchTLUSERCompleted += new EventHandler <SearchTLUSERCompletedEventArgs>(searchTLUserCompleted);
                this.tlUserClient.DeleteTLUSERCompleted += new EventHandler <DeleteTLUSERCompletedEventArgs>(deletedCompleted);
            }
            catch (Exception ex)
            {
                this.messagePop.SetSingleError(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void Reload()
        {
            try
            {
                this.tluserClient = new TLUSERClient();
                this.branchClient = new BranchClient();
                //CMBRANCHClient branchClient = new CMBRANCHClient();
                TLSYSROLEClient roleClient = new TLSYSROLEClient();

                this.IsAuto     = Visibility.Collapsed.ToString();
                this.IsCustomer = Visibility.Visible.ToString();

                //LoadBranch();
                this.branchClient.GetByParentBranchIDAsync(CurrentSystemLogin.CurrentUser.TLSUBBRID);

                roleClient.GetByTopTLSYSROLEAsync("", "", "");
                roleClient.GetByTopTLSYSROLECompleted += (s, e) =>
                {
                    if (e.Result != null && e.Result.Count > 0)
                    {
                        this.RoleData = e.Result;
                    }
                    else
                    {
                        this.RoleData = new ObservableCollection <TL_SYSROLE>();
                    }
                };

                this.tluserClient.InsertTLUSERCompleted        += new EventHandler <InsertTLUSERCompletedEventArgs>(insertCompleted);
                this.tluserClient.UpdateTLUSERCompleted        += new EventHandler <UpdateTLUSERCompletedEventArgs>(updateCompleted);
                this.tluserClient.InsertAllTLUSERCompleted     += new EventHandler <InsertAllTLUSERCompletedEventArgs>(insertAllCompleted);
                this.branchClient.CM_BRANCH_LevelCompleted     += new EventHandler <CM_BRANCH_LevelCompletedEventArgs>(getBranchCompleted);
                this.tluserClient.ApproveTLUSERCompleted       += new EventHandler <ApproveTLUSERCompletedEventArgs>(approveComplete);
                this.branchClient.GetByParentBranchIDCompleted += new EventHandler <GetByParentBranchIDCompletedEventArgs>(getAllBranch);
                this.tluserClient.GetUserInfomationCompleted   += new EventHandler <GetUserInfomationCompletedEventArgs>(getUserInfoComplete);

                this.IsError = Visibility.Collapsed.ToString();
                this.IsOk    = Visibility.Collapsed.ToString();
            }
            catch (Exception ex)
            {
                this.messagePop.SetSingleError(ex.Message);
            }
        }
Exemplo n.º 3
0
        public MainPageViewModel()
        {
            try
            {                                

                this.IsChangeAccount = Visibility.Collapsed.ToString();
                
                this.userClient = new TLUSERClient();
                
                this.userClient.UpdateTLUSERCompleted += new EventHandler<UpdateTLUSERCompletedEventArgs>(changePassCompleted);                

                sessionClient = new SessionServiceClient();
                sessionClient.SetSessionCompleted += new EventHandler<SetSessionCompletedEventArgs>(setSessionCompleted);

                this.currentCulture = new ChangeCulture(this);
                this.currentUser = CurrentSystemLogin.CurrentUser;
                this.BranchId = this.currentUser.TLSUBBRID;
                this.RoleName = this.currentUser.RoleName;
                this.UserName = this.currentUser.TLNANME;
                

                DispatcherTimer time = new DispatcherTimer();
                time.Interval = TimeSpan.FromSeconds(1);
                time.Tick += new EventHandler(oneSecond);
                this.CurrentDate = DateTime.Now.ToShortDateString();
                this.CurrentTime = DateTime.Now.ToString("hh:mm:ss tt");
                time.Start();

                //DOI MAT KHAU NEU DANG NHAP LAN DAU TIEN
                //if (CurrentSystemLogin.CurrentUser.ISFIRSTTIME.Equals("1"))
                //{
                //    this.ChangePassShow();
                //    this.IsCancelVisi = Visibility.Collapsed.ToString();
                //    this.IsFirstTimeLogin = Visibility.Visible.ToString();
                //    this.OnPropertyChanged("IsCancelVisi");
                //    this.OnPropertyChanged("IsFirstTimeLogin");
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show("MainPageViewModel " + ex.Message);
            }
        }        
Exemplo n.º 4
0
        public MainPageViewModel()
        {
            try
            {
                this.IsChangeAccount = Visibility.Collapsed.ToString();

                this.userClient = new TLUSERClient();

                this.userClient.UpdateTLUSERCompleted += new EventHandler <UpdateTLUSERCompletedEventArgs>(changePassCompleted);

                sessionClient = new SessionServiceClient();
                sessionClient.SetSessionCompleted += new EventHandler <SetSessionCompletedEventArgs>(setSessionCompleted);

                this.currentCulture = new ChangeCulture(this);
                this.currentUser    = CurrentSystemLogin.CurrentUser;
                this.BranchId       = this.currentUser.TLSUBBRID;
                this.RoleName       = this.currentUser.RoleName;
                this.UserName       = this.currentUser.TLNANME;


                DispatcherTimer time = new DispatcherTimer();
                time.Interval    = TimeSpan.FromSeconds(1);
                time.Tick       += new EventHandler(oneSecond);
                this.CurrentDate = DateTime.Now.ToShortDateString();
                this.CurrentTime = DateTime.Now.ToString("hh:mm:ss tt");
                time.Start();

                //DOI MAT KHAU NEU DANG NHAP LAN DAU TIEN
                //if (CurrentSystemLogin.CurrentUser.ISFIRSTTIME.Equals("1"))
                //{
                //    this.ChangePassShow();
                //    this.IsCancelVisi = Visibility.Collapsed.ToString();
                //    this.IsFirstTimeLogin = Visibility.Visible.ToString();
                //    this.OnPropertyChanged("IsCancelVisi");
                //    this.OnPropertyChanged("IsFirstTimeLogin");
                //}
            }
            catch (Exception ex)
            {
                MessageBox.Show("MainPageViewModel " + ex.Message);
            }
        }
Exemplo n.º 5
0
        public ToolHeaderViewModel()
        {
            try
            {
                this.IsChangeAccount = Visibility.Collapsed.ToString();

                this.userClient = new TLUSERClient();

                this.userClient.UpdateTLUSERCompleted += new EventHandler <UpdateTLUSERCompletedEventArgs>(changePassCompleted);



                sessionClient = new SessionServiceClient();
                sessionClient.SetSessionCompleted += new EventHandler <SetSessionCompletedEventArgs>(setSessionCompleted);

                this.currentCulture = new ChangeCulture(this);
                this.currentUser    = CurrentSystemLogin.CurrentUser;
                this.BranchId       = this.currentUser.TLSUBBRID;
                this.RoleName       = this.currentUser.RoleName;
                this.UserName       = this.currentUser.TLNANME;

                ////DOI MAT KHAU NEU DANG NHAP LAN DAU TIEN
                //if (CurrentSystemLogin.CurrentUser.ISFIRSTTIME.Equals("1"))
                //{
                //    this.ChangePassShow();
                //    this.IsCancelVisi = Visibility.Collapsed.ToString();
                //    this.IsFirstTimeLogin = Visibility.Visible.ToString();
                //    this.OnPropertyChanged("IsCancelVisi");
                //    this.OnPropertyChanged("IsFirstTimeLogin");
                //}

                this.TimeLogin = CommonResource.lblTimeLogin + " " + appSettings["TimeLogin"].ToString();

                Messenger.Default.Register <bool>(this, ReciveClosePopup);
            }
            catch (Exception ex)
            {
                MessageBox.Show("ToolHeaderViewModel() " + ex.Message);
            }
        }
Exemplo n.º 6
0
        private void ReLoad()
        {
            try
            {
                this.tlUserClient = new TLUSERClient();
                this.branchClient = new BranchClient();
                TLSYSROLEClient roleClient = new TLSYSROLEClient();
                LoadBranch();

                this.IsSingleData = true;

                roleClient.GetByTopTLSYSROLEAsync("", "", "");
                roleClient.GetByTopTLSYSROLECompleted += (s, e) =>
                {
                    ObservableCollection<TL_SYSROLE> tempRole;
                    if (e.Result != null && e.Result.Count > 0)                    
                        tempRole = e.Result;                                           
                    else                    
                        tempRole = new ObservableCollection<TL_SYSROLE>();                        
                    
                    tempRole.Add(new TL_SYSROLE() { ROLE_ID = CommonResource.lblAll });
                    this.RoleData = tempRole;
                    this.OnPropertyChanged("RoleData");
                };                

                this.AuthData = new List<ItemYesNo>()
                {
                    new ItemYesNo(){Id="A", Name=CommonResource.lblApproved},
                    new ItemYesNo(){Id="U", Name=CommonResource.lblDisApprove},
                    new ItemYesNo(){Id="", Name=CommonResource.lblAll}
                };

                this.tlUserClient.SearchTLUSERCompleted += new EventHandler<SearchTLUSERCompletedEventArgs>(searchTLUserCompleted);
                this.tlUserClient.DeleteTLUSERCompleted += new EventHandler<DeleteTLUSERCompletedEventArgs>(deletedCompleted);
            }
            catch (Exception ex)
            {
                this.messagePop.SetSingleError(ex.Message);
            }
        }
Exemplo n.º 7
0
        public LoginSystemViewModel()
        {
            this.userClient = new TLUSERClient();
            sessionClient   = new SessionServiceClient();

            this.login = new LoginComman(this);
            ActionMenuButton.actionControl = new ActionMenuViewModel();
            ActionMenuButton.actionControl.SetEnterAction(login);

            string culture = IsolatedStorageSettings.ApplicationSettings["currentCulture"].ToString();

            if (culture.Equals("vi-VN"))
            {
                this.IsCheckedVN = true;
            }
            else
            {
                this.IsCheckedEL = true;
            }
            this.isCheckedVN = true;
            this.listUnit    = new List <ItemData>()
            {
                new ItemData()
                {
                    Id = "0", Name = SystemRoleResource.lblBachViet
                }
            };

            this.listClass = new List <ItemData>()
            {
                new ItemData()
                {
                    Id = "0", Name = "NVNH LOP 1"
                },
                new ItemData()
                {
                    Id = "1", Name = "NVNH LOP 2"
                },
                new ItemData()
                {
                    Id = "2", Name = "NVNH LOP 3"
                },
                new ItemData()
                {
                    Id = "3", Name = "NVNH LOP 4"
                },
                new ItemData()
                {
                    Id = "4", Name = "NVNH LOP 5"
                },
            };

            this.CurrentUnit  = "0";
            this.CurrentClass = "0";

            this.CaptchaItem = new CaptChaControl();

            this.userName            = "";
            this.IsChangePassVisible = Visibility.Visible.ToString();
            this.IsGetCodeVisible    = Visibility.Collapsed.ToString();
            this.OnPropertyChanged("IsChangePassVisible");
            this.OnPropertyChanged("IsGetCodeVisible");
            //this.userClient.CheckUserLoginCompleted += new EventHandler<CheckUserLoginCompletedEventArgs>(loginCompleted);
            //this.tillMasterClient.GetByTopTILMASTERCompleted += new EventHandler<GetByTopTILMASTERCompletedEventArgs>(getByTopTILMASTERCompleted);
            this.userClient.CheckLoginCompleted += new EventHandler <CheckLoginCompletedEventArgs>(userLoginCompleted);

            sessionClient.SetSessionCompleted         += new EventHandler <SetSessionCompletedEventArgs>(setSessionCompleted);
            this.userClient.SendCodeTLUSERCompleted   += new EventHandler <SendCodeTLUSERCompletedEventArgs>(sendCodeCompleted);
            this.userClient.ChangePassTLUSERCompleted += new EventHandler <ChangePassTLUSERCompletedEventArgs>(changePassCompleted);
            this.userClient.LoginADCompleted          += new EventHandler <LoginADCompletedEventArgs>(checkLoginADCompleted);
        }