public void setData(BaseData data)
 {
     this.DataContext = data;
     OtherCost info = (OtherCost)data;
     DateTime nowDate = MainWindowViewModel.ins().ChooseDate;
     info.setDate(nowDate);
 }
        public void setData(BaseData data)
        {
            this.DataContext = data;
            info = (DailyConsumption)data;

            DateTime nowDate = MainWindowViewModel.ins().ChooseDate;
            info.setDate(nowDate);
            this.DateText.Text = info.DateString;

            ComboBoxItem item = null;
            foreach (Customer custom in MainWindowViewModel.ins().CustomerCollection)
            {
                item = new ComboBoxItem();
                item.Uid = custom.DBID.ToString();
                item.Content = custom.Name;
                this.CustomerNameBox.Items.Add(item);
            }

            foreach (Employee employee in MainWindowViewModel.ins().EmployeeCollection)
            {
                item = new ComboBoxItem();
                item.Uid = employee.DBID.ToString();
                item.Content = employee.Name;
                this.EmployeeNameBox.Items.Add(item);
                item = new ComboBoxItem();
                item.Uid = employee.DBID.ToString();
                item.Content = employee.Name;
                this.GoodsProviderAddBox.Items.Add(item);
                item = new ComboBoxItem();
                item.Uid = employee.DBID.ToString();
                item.Content = employee.Name;
                this.ServiceProviderAddBox.Items.Add(item);
            }

            foreach (Goods goods in MainWindowViewModel.ins().GoodsCollection)
            {
                item = new ComboBoxItem();
                item.Uid = goods.DBID.ToString();
                item.Content = goods.Name;
                this.ConsumerGoodsAddBox.Items.Add(item);
            }

            foreach (Service service in MainWindowViewModel.ins().ServiceCollection)
            {
                item = new ComboBoxItem();
                item.Uid = service.DBID.ToString();
                item.Content = service.Name;
                this.ServiceAddBox.Items.Add(item);
            }
        }
 public void setData(BaseData data)
 {
     this.DataContext = data;
     IInfo info = null;
     if (data is Customer)
     {
         info = new PersonInfo();
         infoList.Add(info);
         IInfo info2 = new CustomerInfo();
         infoList.Add(info2);
         info2.setData(data);
         ((PersonInfo)info).CustomFrame.Content = info2;
     }
     else if (data is Employee)
     {
         info = new PersonInfo();
         infoList.Add(info);
         IInfo info2 = new EmployeeInfo();
         infoList.Add(info2);
         info2.setData(data);
         ((PersonInfo)info).CustomFrame.Content = info2;
     }
     else if (data is Goods)
     {
         info = new GoodsInfo();
         infoList.Add(info);
     }
     else if (data is Service)
     {
         info = new ServiceInfo();
         infoList.Add(info);
     }
     else if (data is DailyConsumption)
     {
         info = new DailyConsumptionInfo();
         infoList.Add(info);
     }
     else if (data is OtherCost)
     {
         info = new OtherCostInfo();
         infoList.Add(info);
     }
     info.setData(data);
     this.PageFrame.Content = info;
 }
 public void setData(BaseData data)
 {
     this.DataContext = data;
 }