Пример #1
0
        private void OnDeleteCTable()
        {
            if (UpdatingCTable != null)
            {
                MessageBoxResult result = MessageBox.Show(Properties.Resources.WarningMsgBoxDeleteCTable, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OKCancel);
                switch (result)
                {
                case MessageBoxResult.OK:
                    int r = CTableController.DeleteCTable(UpdatingCTable);
                    if (r == 201)
                    {
                        MessageBox.Show(Properties.Resources.CTableDeleted, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OK);
                    }
                    else
                    {
                        MessageBox.Show(Properties.Resources.ErrorMsg, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OK);
                    }
                    Back();
                    break;

                case MessageBoxResult.Cancel:
                    break;
                }
            }
            else
            {
                MessageBox.Show(Properties.Resources.WarningMsgBoxChooseOneProduct, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OK);
            }
        }
Пример #2
0
        private void OnEditCTable()
        {
            if (IsValid())
            {
                MessageBoxResult result = MessageBox.Show(Properties.Resources.WarningMsgBoxEdit, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OKCancel);
                switch (result)
                {
                case MessageBoxResult.OK:

                    int r = CTableController.EditCTable(UpdatingCTable);
                    if (r == 201)
                    {
                        MessageBox.Show(Properties.Resources.CTableUpdated, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OK);
                    }
                    else
                    {
                        MessageBox.Show(Properties.Resources.ErrorMsg, Properties.Resources.WarningMsgBoxTitle, MessageBoxButton.OK);
                    }
                    Back();
                    break;

                case MessageBoxResult.Cancel:
                    break;
                }
            }
        }
        public void UpdateCTablesList()
        {
            if (CTables.Count > 0)
            {
                CTables.Clear();
            }
            if (ListOfCTables.Count > 0)
            {
                ListOfCTables.Clear();
            }
            CTableController.GetCTablesJSON();

            CTables       = CTableController.GetCTablesList();
            ListOfCTables = new ObservableCollection <CTable>(CTables);
            //Customers = CustomerController.DeserializeCustomers();
        }