예제 #1
0
 partial void DeleteBranch(Branch instance);
예제 #2
0
 partial void InsertBranch(Branch instance);
예제 #3
0
 partial void UpdateBranch(Branch instance);
예제 #4
0
        private void NextButton_Click(object sender, RoutedEventArgs e)
        {
            string uid = (sender as Button).Uid;
            if (uid == "CurrencyState") {
                if(ValidateBranch()) {
                    Branch = new Branch();
                    Branch.parentId = "000001";
                    Branch.code = BranchCode.Text;
                    Branch.name = BranchName.Text;
                    Branch.location = Location.Text;
                    Branch.series = Series.Text;
                    Branch.parentId = "000001";
                    Branch.updatedAt = DateTime.Now;
                    Branch.createdAt = DateTime.Now;
                    Branch.region = string.Empty;
                    Branch.city = string.Empty;
                    VisualStateManager.GoToElementState(LayoutRoot, "CurrencyState", true);
                    wizardProgressBar.Progress += stepValue;
                }
            } else if(uid == "ItemState") {
                if(BranchMoney.Count > 0 && cbPrimaryCurrency.SelectedIndex >= 0) {
                    BranchPrimaryCurreny = cbPrimaryCurrency.SelectedItem as AppSetting;
                    wizardProgressBar.Progress += stepValue;

                    ItemNextButton.Visibility = Visibility.Hidden;
                    ProgCancelItem.Visibility = Visibility.Hidden;
                    string path = AppDomain.CurrentDomain.BaseDirectory + ITEM_TEMPLATE;
                    ImportExcel_Item(path);

                    VisualStateManager.GoToElementState(LayoutRoot, "ItemState", true);
                }
            } else if(uid == "JewelryState") {

                VisualStateManager.GoToElementState(LayoutRoot, "JewelryState", true);
                wizardProgressBar.Progress += stepValue;

                JewelryNextButton.Visibility = Visibility.Hidden;
                ProgCancelGold.Visibility = Visibility.Hidden;
                ProgCancelStone.Visibility = Visibility.Hidden;
                ImportExcel_Gold(AppDomain.CurrentDomain.BaseDirectory + GOLD_TEMPLATE);
                ImportExcel_Stone(AppDomain.CurrentDomain.BaseDirectory + STONE_TEMPLATE);

            } else if(uid == "FinalState") {
                VisualStateManager.GoToElementState(LayoutRoot, "FinalState", true);
                wizardProgressBar.Progress += stepValue;
                Task.Run(() => {
                    for (int i = 0; i < ItemCategories.Count; i++) {
                        ItemCategories[i].parentId = "000001";
                        ItemCategories[i].createdAt = DateTime.Now;
                        ItemCategories[i].updatedAt = DateTime.Now;
                    }
                }).ContinueWith((gld) => {
                    for (int i = 0; i < GoldList.Count; i++) {
                        GoldList[i].parentId = "000001";
                        GoldList[i].createdAt = DateTime.Now;
                        GoldList[i].updatedAt = DateTime.Now;
                    }
                }).ContinueWith((gld) => {
                    for (int i = 0; i < StoneList.Count; i++) {
                        StoneList[i].parentId = "000001";
                        StoneList[i].createdAt = DateTime.Now;
                        StoneList[i].updatedAt = DateTime.Now;
                    }
                }).ContinueWith((sve) => SaveSetUp());
            } else if (uid == "SetState") {
                Dispose();
                MainWindow main = Application.Current.MainWindow as MainWindow;
                main.IsLogin(sender, e);
            }
        }