Пример #1
0
 public NewMalFunctionViewModel()
 {
     CustomerList     = CustomerModule.GetCustomerList();
     FabricList       = FabricModule.GetFabricList();
     FactoryList      = FactoryModule.GetFactoryList();
     ProcessOrderList = ProcessModule.GetProcessOrder();
 }
Пример #2
0
        public ProcessOrderPage()
        {
            InitializeComponent();

            ComboBoxStatus.ItemsSource = Enum.GetValues(typeof(ProcessOrderColorStatus)).Cast <ProcessOrderColorStatus>();
            DisplayAllOrder();
            DataGridProcessOrder.ItemsSource       = DataGridProcessOrderCollection;
            ComboBoxCustomer.ItemsSource           = CustomerModule.GetCustomerList();
            ComboBoxCustomerNameSearch.ItemsSource = CustomerModule.GetCustomerList();
            DataGridFactoryList.ItemsSource        = FactoryModule.GetFactoryList();
        }
Пример #3
0
        void AddFactoryClickExecute()
        {
            if (string.IsNullOrEmpty(Name))
            {
                MessageBox.Show("請輸入客戶名稱!!");
                return;
            }
            var customer = new Customer()
            {
                Name        = Name,
                PhoneNumber = PhoneNumber,
                CellPhone   = CellPhone,
                Fax         = Fax,
                Memo        = Memo,
                Address     = Address,
                Sort        = Sort
            };

            bool isContainCustomer = CustomerModule.GetCustomerList().Select(s => s.Name).Contains(customer.Name);

            if (isContainCustomer)
            {
                MessageBox.Show("此客戶已存在清單內!!");
                return;
            }
            bool success = CustomerModule.InsertCustomer(customer);

            if (success)
            {
                MessageBox.Show("新增成功!!");
                Name        = string.Empty;
                PhoneNumber = string.Empty;
                CellPhone   = string.Empty;
                Fax         = string.Empty;
                Address     = string.Empty;
                Memo        = string.Empty;
                Sort        = 0;
            }
            else
            {
                MessageBox.Show("新增失敗!!");
            }
        }