示例#1
0
 public void refereshWin()
 {
     if (fatherWindow is StoreWindow)
     {
         StoreWindow win = fatherWindow as StoreWindow;
         win.GetComponent <StoreWindow> ().updateContent();
     }
 }
示例#2
0
    private void renameCallBack(string newName)
    {
        MaskWindow.UnlockUI();
        UserManager.Instance.self.nickname = newName;
        this.finishWindow();
        StoreWindow store = UiManager.Instance.getWindow <StoreWindow> ();

        if (store != null)
        {
            store.updateContent();
        }
    }
示例#3
0
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
         return;
     }
 }
 private void OnLogin()
 {
     User.Validate("login");
     if (User.IsValid)
     {
         var user        = UserService.GetUser(User);
         var storeWindow = new StoreWindow();
         var imageVM     = new ImagesViewModel();
         imageVM.ImageModels     = ImageService.GetImageModels(user);
         storeWindow.DataContext = new StoreViewModel(user, imageVM);
         CloseAction();
         storeWindow.Show();
     }
 }
        private void searchStore(string storeName)
        {
            string store = controler.SearchStore(storeName);

            if (store != null && !store.Equals(""))
            {
                // show in list and then click on the name open window
                StoreWindow storeWindow = new StoreWindow(store);
                storeWindow.Show();
                App.Current.MainWindow = storeWindow;
            }
            else
            {
                this.user.searchmsg = "insert name";
            }
        }
        private void About_Click(object sender, RoutedEventArgs e)
        {
            FurnitureStore fs = new FurnitureStore();
            var            s  = Project.Instance.Store;

            fs.ID        = s.ID;
            fs.Name      = s.Name;
            fs.Phone     = s.Phone;
            fs.Address   = s.Address;
            fs.Email     = s.Email;
            fs.Website   = s.Website;
            fs.CompanyNo = s.CompanyNo;
            fs.AccountNo = s.AccountNo;
            fs.Pib       = s.Pib;
            StoreWindow sw = new StoreWindow(fs);

            sw.Show();
        }
        public MainViewModel()
        {
            LoadedWindowCommand = new RelayCommand <Window>((p) => { return(true); }, (p) =>
            {
                Isloaded = true;
                if (p == null)
                {
                    return;
                }

                p.Hide();
                LoginWindow loginWindow = new LoginWindow();
                loginWindow.ShowDialog();

                if (loginWindow.DataContext == null)
                {
                    return;
                }
                var loginVM = loginWindow.DataContext as LoginViewModel;

                if (loginVM.IsLogin)
                {
                    p.Show();
                }
                else
                {
                    p.Close();
                }
            }
                                                            );

            LogoutCommand = new RelayCommand <object>((p) => { return(true); }, (p) => {
                System.Windows.Application.Current.Shutdown();
            });
            ProductCommand   = new RelayCommand <object>((p) => { return(true); }, (p) => { ProductDetailPage wd = new ProductDetailPage(); wd.ShowDialog(); });
            SettingsCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { SettingsWindow wd = new SettingsWindow(); wd.ShowDialog(); });
            EmployeeCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { NhanVienWindow wd = new NhanVienWindow(); wd.ShowDialog(); });
            KhuyenMaiCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { KhuyenMaiWindow wd = new KhuyenMaiWindow(); wd.ShowDialog(); });
            StoreCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { StoreWindow wd = new StoreWindow(); wd.ShowDialog(); });
            KhachHangCommand = new RelayCommand <object>((p) => { return(true); }, (p) => { KhachHangWindow wd = new KhachHangWindow(); wd.ShowDialog(); });
            ProducerCommand  = new RelayCommand <object>((p) => { return(true); }, (p) => { NSXWindow wd = new NSXWindow(); wd.ShowDialog(); });
            OrderCommand     = new RelayCommand <object>((p) => { return(true); }, (p) => { BillWindow wd = new BillWindow(); wd.ShowDialog(); });
        }
示例#8
0
    public override void DoClickEvent()
    {
        base.DoClickEvent();
        GuideManager.Instance.doFriendlyGuideEvent();

        PropSample sample = PropSampleManager.Instance.getPropSampleBySid(prop.sid);

        if (UserManager.Instance.self.getUserLevel() < prop.getUseLv() && sample.type != PropType.PROP_COMBAT_CHEST)
        {
            UiManager.Instance.openDialogWindow <MessageWindow>((window) => {
                window.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, LanguageConfigManager.Instance.getLanguage("s0331", prop.getUseLv().ToString()), null);
            });
            return;
        }
        if (sample.type == PropType.PROP_TYPE_CHEST)
        {
            //若果临时仓库有东西时,不能打开宝箱,并飘字提示玩家
            if (StorageManagerment.Instance.getAllTemp().Count > 0)
            {
                UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                });
                return;
            }
            //如果数量只有一个 则直接使用,不用去选择数量
            if (prop.getNum() == 1)
            {
                useProp(1);
                return;
            }

            GuideManager.Instance.doGuide();
            UiManager.Instance.openDialogWindow <BuyWindow> ((win) => {
                win.init(prop, prop.getNum(), 1, prop.getNum() > 50 ? 50 : prop.getNum(), 1, constResourcesPath.NONE, useBack);
            });
        }
        else if (sample.type == PropType.PROP_TYPE_LOCK_CHEST)            //带锁的宝箱打开界面
        {
            UiManager.Instance.openWindow <TreasureChestWindow> ((win) => {
                win.init(prop.sid);
            });
        }
        /** 使用改名卡 */
        else if (sample.type == PropType.PROP_RENAME)
        {
            UiManager.Instance.openDialogWindow <RoleRenameWindow>((win) => {
                win.sample = sample;
            });
        }
        else if (sample.type == PropType.PROP_HAFE_MONTH)
        {
            OpenGiftBagFport fport = FPortManager.Instance.getFPort("OpenGiftBagFport") as OpenGiftBagFport;
            fport.access(1, prop, () =>
            {
                NoticeMonthCardFPort sp = FPortManager.Instance.getFPort("NoticeMonthCardFPort") as NoticeMonthCardFPort;
                sp.access_get(() =>
                {
                    UiManager.Instance.openDialogWindow <MessageLineWindow>((winn) => {
                        winn.Initialize(LanguageConfigManager.Instance.getLanguage("month_hafe_add"));
                        StoreWindow store = UiManager.Instance.getWindow <StoreWindow>();
                        if (store != null)
                        {
                            store.updateContent();
                        }
                    });
                });


                //int[] monthCardDueDate=NoticeManagerment.Instance.monthCardDueDate;
                //if (monthCardDueDate == null || monthCardDueDate.Length == 0)
                //{
                //    int currentTime = ServerTimeKit.getSecondTime();
                //    DateTime time = TimeKit.getDateTime(currentTime + 1296000);
                //    NoticeManagerment.Instance.monthCardDueDate = new int[3]
                //    {
                //        time.Year,
                //        time.Month,
                //        time.Day
                //    };
                //    GameManager.Instance.monthTime = currentTime + 1296000;
                //}
                //else
                //{
                //    DateTime t = TimeKit.getDateTime(GameManager.Instance.monthTime + 1296000);
                //    NoticeManagerment.Instance.monthCardDueDate = new int[3]
                //    {
                //        t.Year,
                //        t.Month,
                //        t.Day
                //    };
                //}
            });
        }
        else if (sample.type == PropType.PROP_COMBAT_CHEST)
        {
            if (StorageManagerment.Instance.getAllTemp().Count > 0)
            {
                UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                    win.Initialize(LanguageConfigManager.Instance.getLanguage("storeFull_temp_tip"));
                });
                return;
            }
            useChest();
        }
    }