コード例 #1
0
ファイル: ViewModel.cs プロジェクト: MuthusamyPonraj/WPF
        /// <summary>
        /// Gets the orders details.
        /// </summary>
        /// <returns></returns>
        public ObservableCollection <OrderInfo> GetOrdersDetails()
        {
            ObservableCollection <OrderInfo> orderinfo = new ObservableCollection <OrderInfo>();

            if (!LayoutControl.IsInDesignMode)
            {
                string connectionString = LayoutControl.FindFile("Northwind.sdf");
                northWind = new Northwind(connectionString);
                var order = northWind.Orders.Take(50);

                foreach (var o in order)
                {
                    OrderInfo or = new OrderInfo();
                    or.CustomerID                  = o.CustomerID;
                    or.OrderID                     = o.OrderID;
                    or.Customers                   = new CustomerInfo();
                    or.Customers.Address           = o.Customers.Address;
                    or.Customers.City              = o.Customers.City;
                    or.Customers.CompanyName       = o.Customers.CompanyName;
                    or.ShippersInfo                = new ShipperDetails[1];
                    or.ShippersInfo[0]             = new ShipperDetails();
                    or.ShippersInfo[0].CompanyName = o.Shippers.CompanyName;
                    or.ShippersInfo[0].ShipperID   = o.Shippers.ShipperID;

                    orderinfo.Add(or);
                }
            }
            return(orderinfo);
        }
コード例 #2
0
        /// <summary>
        /// Gets the product info.
        /// </summary>
        /// <returns></returns>
        public List <ProductDetails> GetProductInfo()
        {
            var productInfo = new List <ProductDetails>();

            if (!LayoutControl.IsInDesignMode)
            {
                northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
                var ords = northWind.Products.Take(500);
                foreach (var em in ords)
                {
                    var product = new ProductDetails();
                    em.SupplierID += 1000;
                    em.ProductID  += 10000;

                    product.CategoryID      = (int)em.CategoryID;
                    product.Discontinued    = em.Discontinued;
                    product.EnglishName     = em.EnglishName;
                    product.ProductID       = em.ProductID;
                    product.ProductName     = em.ProductName;
                    product.QuantityPerUnit = em.QuantityPerUnit;
                    product.ReorderLevel    = (short)em.ReorderLevel;
                    product.SupplierID      = (int)em.SupplierID;
                    product.UnitPrice       = (decimal)em.UnitPrice;
                    product.UnitsInStock    = (short)em.UnitsInStock;
                    product.UnitsOnOrder    = (short)em.UnitsOnOrder;
                    productInfo.Add(product);
                }
            }
            return(productInfo);
        }
コード例 #3
0
        /// <summary>
        /// Populates the data.
        /// </summary>
        private void PopulateData()
        {
            if (!LayoutControl.IsInDesignMode)
            {
                Random    r     = new Random();
                Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));

                foreach (OrderDetails orderDet in north.OrderDetails.Take(200))
                {
                    OrderInfo orderInfo = new OrderInfo();

                    orderInfo.OrderID       = orderDet.OrderID;
                    orderInfo.CustomerID    = orderDet.Orders.CustomerID;
                    orderInfo.ProductName   = orderDet.Products.ProductName;
                    orderInfo.UnitPrice     = (double)orderDet.UnitPrice;
                    orderInfo.OrderDate     = (DateTime)orderDet.Orders.OrderDate;
                    orderInfo.Quantity      = orderDet.Quantity;
                    orderInfo.ContactNumber = r.Next(999111234, 999111239).ToString();
                    orderInfo.ShipAddress   = orderDet.Orders.ShipAddress;
                    orderInfo.IsAvailable   = orderInfo.UnitPrice % 2 == 0;
                    _orderList.Add(orderInfo);
                    if (!_comboBoxItemsSource.Contains(orderDet.Products.ProductName))
                    {
                        _comboBoxItemsSource.Add(orderDet.Products.ProductName);
                    }
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// Populates the data.
        /// </summary>
        private void PopulateData()
        {
            if (!LayoutControl.IsInDesignMode)
            {
                Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));

                foreach (OrderDetails orderDet in north.OrderDetails.Take(600))
                {
                    OrderInfo orderInfo = new OrderInfo();
                    orderInfo.OrderID     = orderDet.OrderID;
                    orderInfo.CustomerID  = orderDet.Orders.CustomerID;
                    orderInfo.ProductName = orderDet.Products.ProductName;
                    orderInfo.OrderDate   = DateTime.Today.AddDays(r.Next(-100, 1));
                    if (orderInfo.OrderID % 2 == 0)
                    {
                        orderInfo.IsShipped = true;
                    }
                    else
                    {
                        orderInfo.IsShipped = false;
                    }
                    orderInfo.ShipName    = orderDet.Orders.ShipName;
                    orderInfo.ShipAddress = orderDet.Orders.ShipAddress;
                    _orderList.Add(orderInfo);
                }
            }
        }
コード例 #5
0
 /// <summary>
 /// Gets the supplier info.
 /// </summary>
 /// <returns></returns>
 public ObservableCollection <SalesByYear> GetSalesInfo()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}",
                                                 LayoutControl.FindFile("AdventureWorksExt.sdf"));
         var sales = new ObservableCollection <SalesByYear>();
         using (var c = new SqlCeConnection(connectionString))
         {
             c.Open();
             using (var com = new SqlCeCommand("SELECT *  FROM Sales_QuarterSalesProductView", c))
             {
                 var reader = com.ExecuteReader();
                 int i      = 1;
                 while (reader.Read() && i < 30)
                 {
                     sales.Add(new SalesByYear()
                     {
                         Name  = reader["Name"].ToString(),
                         QS1   = reader["QS1"].ToString() != "" ? double.Parse(reader["QS1"].ToString()) :480000.00,
                         QS2   = reader["QS2"].ToString() != "" ? double.Parse(reader["QS2"].ToString()) : 10000.00,
                         QS3   = reader["QS3"].ToString() != "" ? double.Parse(reader["QS3"].ToString()) : 10000.00,
                         QS4   = reader["QS4"].ToString() != "" ? double.Parse(reader["QS4"].ToString()) : 10000.00,
                         Total = double.Parse(reader["Total"].ToString()),
                         Year  = Int32.Parse(reader["Year"].ToString()),
                     });
                     i++;
                 }
             }
             c.Close();
         }
         return(sales);
     }
     return(null);
 }
コード例 #6
0
        /// <summary>
        /// Populates the zip codes.
        /// </summary>
        public void PopulateZipCodes()
        {
            if (!LayoutControl.IsInDesignMode)
            {
                connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("ZipCodes.sdf"));
                using (SqlCeConnection c = new SqlCeConnection(connectionString))
                {
                    c.Open();

                    using (SqlCeCommand com = new SqlCeCommand("SELECT ZipCodes.*, States.StateAbbereviation,States.StateName, Class.Description FROM(ZipCodes INNER JOIN States ON ZipCodes.StateCode = States.StateCode) INNER JOIN Class ON ZipCodes.Class = Class.Class", c))
                    {
                        SqlCeDataReader reader = com.ExecuteReader();
                        int             i      = 0;
                        while (reader.Read() && i < 50)
                        {
                            i++;
                            this._zipCodes.Add(new ZipCodeInfo()
                            {
                                ZipCode            = reader["ZipCode"].ToString(),
                                Class              = reader["Class"].ToString(),
                                StateCode          = reader["StateCode"].ToString(),
                                Latitude           = reader["Latitude"].ToString(),
                                Longitude          = reader["Longitude"].ToString(),
                                City               = reader["City"].ToString(),
                                StateName          = reader["StateName"].ToString(),
                                StateAbbereviation = reader["StateAbbereviation"].ToString(),
                            });
                        }
                    }
                    c.Close();
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// Populates the data.
        /// </summary>
        private void PopulateData()
        {
            if (!LayoutControl.IsInDesignMode)
            {
                Random    r     = new Random();
                Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));

                foreach (OrderDetails orderDet in north.OrderDetails.Take(150))
                {
                    OrderInfo orderInfo = new OrderInfo();

                    orderInfo.OrderID        = orderDet.OrderID;
                    orderInfo.CustomerID     = orderDet.Orders.CustomerID;
                    orderInfo.ProductName    = orderDet.Products.ProductName;
                    orderInfo.UnitPrice      = (double)orderDet.UnitPrice;
                    orderInfo.Quantity       = orderDet.Quantity;
                    orderInfo.Discount       = Math.Round(orderDet.Discount, 2);
                    orderInfo.Freight        = (double)orderDet.Orders.Freight;
                    orderInfo.OrderDate      = (DateTime)orderDet.Orders.OrderDate;
                    orderInfo.ShippedDate    = (DateTime)orderDet.Orders.ShippedDate;
                    orderInfo.ShipPostalCode = orderDet.Orders.ShipPostalCode;
                    orderInfo.ShipAddress    = orderDet.Orders.ShipAddress;
                    orderInfo.IsClosed       = r.Next() % 2 == 0 ? true : false;
                    orderInfo.ContactNumber  = r.Next(999111, 999119).ToString();
                    orderInfo.DeliveryDelay  = orderInfo.ShippedDate - orderInfo.OrderDate;
                    if (!_comboBoxItemsSource.Contains(orderDet.Products.ProductName))
                    {
                        _comboBoxItemsSource.Add(orderDet.Products.ProductName);
                    }
                    _orderList.Add(orderInfo);
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// Gets the data table.
        /// </summary>
        /// <returns></returns>
        public DataTable GetDataTable()
        {
            DataSet ds = new DataSet();

            if (!LayoutControl.IsInDesignMode)
            {
                connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
                using (SqlCeConnection con = new SqlCeConnection(connectionString))
                {
                    con.Open();
                    SqlCeDataAdapter sda = new SqlCeDataAdapter("SELECT * FROM Suppliers", con);
                    sda.Fill(ds, "Suppliers");
                }

                using (SqlCeConnection con1 = new SqlCeConnection(connectionString))
                {
                    con1.Open();
                    SqlCeDataAdapter sda1 = new SqlCeDataAdapter("SELECT * FROM Products", con1);
                    sda1.Fill(ds, "Products");
                }
                ds.Relations.Add(new DataRelation("Supplier_Product", ds.Tables[0].Columns["Supplier ID"], ds.Tables[1].Columns["Supplier ID"]));
            }
            if (ds.Tables.Count > 0)
            {
                return(ds.Tables[0]);
            }
            else
            {
                return(null);
            }
        }
コード例 #9
0
        /// <summary>
        /// Called when [execute de serialize].
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="System.Windows.Input.ExecutedRoutedEventArgs"/> instance containing the event data.</param>
        private static void OnExecuteDeSerialize(object sender, ExecutedRoutedEventArgs args)
        {
            GridTreeControl GTC = args.Source as GridTreeControl;

            GTC.InternalGrid.CurrentCell.Deactivate();
            GTC.InternalGrid.Deserialize(LayoutControl.FindFile("Default.xml"));
            GTC.ExpandAllNodes();
        }
コード例 #10
0
 /// <summary>
 /// Populates the data.
 /// </summary>
 private void PopulateData()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
         this.OrderList = new ObservableCollection <Orders>(north.Orders.Take(150));
     }
 }
コード例 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewModel"/> class.
 /// </summary>
 public ViewModel()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("AdventureWorksExt.sdf"));
         SupplierDetails  = this.Get_Suppliers().ToList <DataModel>().GetRange(0, 60);
     }
 }
コード例 #12
0
ファイル: ViewModel.cs プロジェクト: dmonjeau/wpf-demos
 /// <summary>
 /// Populates the data.
 /// </summary>
 private void PopulateData()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
         var       order = north.Orders.Take(100);
         foreach (var o in order)
         {
             OrderList.Add(o);
         }
     }
 }
コード例 #13
0
 public Order()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
         northWind = new Northwind(connectionString);
         var order = northWind.Orders.Skip(0).Take(100).ToList();
         foreach (var o in order)
         {
             this.Add(o);
         }
     }
 }
コード例 #14
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
 public Order()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = LayoutControl.FindFile("Northwind.sdf");
         var    nw     = new Northwind(connectionString);
         var    orders = nw.Orders;
         foreach (var o in orders)
         {
             this.Add(o);
         }
     }
 }
コード例 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CategorySource"/> class.
 /// </summary>
 public CategorySource()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
         northWind = new Northwind(connectionString);
         var ship = northWind.Products.Select(o => o.CategoryID).Distinct().ToList();
         foreach (int s in ship)
         {
             this.Add(s.ToString());
         }
     }
 }
コード例 #16
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
 /// <summary>
 /// Gets the orders.
 /// </summary>
 void GetOrders()
 {
     OrderDetails = new List <Orders>();
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
         northWind = new Northwind(connectionString);
         var order = northWind.Orders.Skip(0).Take(50);
         foreach (var o in order)
         {
             OrderDetails.Add(o);
         }
     }
 }
コード例 #17
0
 /// <summary>
 /// Gets the product info.
 /// </summary>
 /// <returns></returns>
 public List<Products> GetProductInfo()
 {
     List<Products> productInfo = new List<Products>();
     if (!LayoutControl.IsInDesignMode)
     {
         northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
         var ords = northWind.Products.Take(500);
         foreach (var em in ords)
         {
             productInfo.Add(em);
         }
     }
     return productInfo;
 }      
コード例 #18
0
ファイル: Window1.xaml.cs プロジェクト: war-man/wpf-demos
        private void InitGrid()
        {
            var model = this.grid.Model;

            model.RowCount            = 30;
            model.ColumnCount         = 12;
            model.TableStyle.CellType = "Static";
            var nw        = new Northwind(string.Format("Data Source={0}", LayoutControl.FindFile("Northwind.sdf")));
            var customers = nw.Customers.Skip(0).Take(30).ToList();

            model[0, 1].CellValue  = "CustomerID";
            model[0, 2].CellValue  = "ContactName";
            model[0, 3].CellValue  = "ContactTitle";
            model[0, 4].CellValue  = "CompanyName";
            model[0, 5].CellValue  = "City";
            model[0, 6].CellValue  = "Country";
            model[0, 7].CellValue  = "Address";
            model[0, 8].CellValue  = "Phone";
            model[0, 9].CellValue  = "ContactName";
            model[0, 10].CellValue = "Orders";
            model[0, 11].CellValue = "Fax";

            for (int i = 1; i < model.RowCount; i++)
            {
                var customer = customers[i - 1];
                model[i, 1].CellValue  = customer.CustomerID;
                model[i, 3].CellValue  = customer.ContactTitle;
                model[i, 4].CellValue  = customer.CompanyName;
                model[i, 5].CellValue  = customer.City;
                model[i, 6].CellValue  = customer.Country;
                model[i, 7].CellValue  = customer.Address;
                model[i, 8].CellValue  = customer.Phone;
                model[i, 9].CellValue  = customer.ContactName;
                model[i, 10].CellValue = customer.Fax;
                model.RowHeights[i]    = 30;

                int j     = 2;
                var style = model[i, j];
                style.ShowTooltip = true;
                style.CellValue   = customer.ContactName;
                style.Background  = new SolidColorBrush(Colors.NavajoWhite);

                style.CellValue2         = customer.Phone.Length > 0 ? customer.Phone : "None";
                style.TooltipTemplateKey = "templateTooltip";
            }

            model.ColumnWidths[0] = 30;
            model.ColumnWidths[2] = 150;
            model.ResizeColumnsToFit(GridRangeInfo.Cols(3, 5), GridResizeToFitOptions.NoShrinkSize);
        }
コード例 #19
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
 /// <summary>
 /// Gets the data.
 /// </summary>
 /// <returns></returns>
 public IQueryable <Orders> GetData()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("NorthwindGrid.sdf"));
         EntityConnectionStringBuilder entityBuilder = new EntityConnectionStringBuilder();
         entityBuilder.Metadata = "res://*/Model.NorthWind.csdl|res://*/Model.NorthWind.ssdl|res://*/Model.NorthWind.msl";
         entityBuilder.Provider = "System.Data.SqlServerCe.3.5";
         entityBuilder.ProviderConnectionString = connectionString;
         NorthwindGridEntities northwind = new NorthwindGridEntities(entityBuilder.ToString());
         return(northwind.Orders);
     }
     return(null);
 }
コード例 #20
0
        /// <summary>
        /// Populates the data.
        /// </summary>
        private void PopulateData()
        {
            if (!LayoutControl.IsInDesignMode)
            {
                Random    r     = new Random();
                Northwind north = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));

                foreach (OrderDetails orderDet in north.OrderDetails.Take(50))
                {
                    OrderInfo orderInfo = new OrderInfo();

                    orderInfo.ProductName = orderDet.Products.ProductName;
                    orderInfo.NoOfOrders  = discountcount + 6 / 100;
                    if (discountcount > 16)
                    {
                        discountcount = 7;
                    }
                    orderInfo.OrderDate = (DateTime)orderDet.Orders.OrderDate;
                    if (countrycount >= 21)
                    {
                        countrycount = 0;
                    }
                    orderInfo.Total              = 10;
                    orderInfo.SupplierID         = countrycount % 3 == 0 ? 1 : countrycount % 3;
                    orderInfo.CountryDescription = this.ShipCountry[countrycount];
                    if (countrycount % 3 == 0 || countrycount % 9 == 0)
                    {
                        orderInfo.ImageLink = "US.jpg";
                    }
                    else if (countrycount % 5 == 0 || countrycount % 17 == 0)
                    {
                        orderInfo.ImageLink = "Japan.jpg";
                    }
                    else
                    {
                        orderInfo.ImageLink = "UK.jpg";
                    }

                    countrycount++;
                    discountcount += 3;

                    if (!_comboBoxItemsSource.Contains(orderDet.Products.ProductName))
                    {
                        _comboBoxItemsSource.Add(orderDet.Products.ProductName);
                    }
                    _orderList.Add(orderInfo);
                }
            }
        }
コード例 #21
0
ファイル: OrderSource.cs プロジェクト: Abbas1546/WPF
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderSource"/> class.
 /// </summary>
 public OrderSource()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
         var ord = northWind.OrderDetails.Select(o => o.Products.EnglishName).Distinct().ToList();
         foreach (string em in ord)
         {
             this.Add(new BasicFilteringDemo.DataModel.OrderDetails()
             {
                 ID = em
             });
         }
     }
 }
コード例 #22
0
        /// <summary>
        /// Gets the product info.
        /// </summary>
        /// <returns></returns>
        public ObservableCollection <Orders> GetOrderInfo()
        {
            ObservableCollection <Orders> orderInfo = new ObservableCollection <Orders>();

            if (!LayoutControl.IsInDesignMode)
            {
                northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
                var ords = northWind.Orders.Take(50);
                foreach (var em in ords)
                {
                    orderInfo.Add(em);
                }
            }
            return(orderInfo);
        }
コード例 #23
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
        /// <summary>
        /// Gets the products.
        /// </summary>
        void GetProducts()
        {
            ProductDetails = new ObservableCollection <Products>();
            Northwind northWind;

            if (!LayoutControl.IsInDesignMode)
            {
                northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
                var ords = northWind.Products.Take(50);
                foreach (var em in ords)
                {
                    this.ProductDetails.Add(em);
                }
            }
        }
コード例 #24
0
        /// <summary>
        /// Gets the product info.
        /// </summary>
        /// <returns></returns>
        public List <Orders> GetOrderInfo()
        {
            List <Orders> OrderInfo = new List <Orders>();

            if (!LayoutControl.IsInDesignMode)
            {
                northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
                var ords = northWind.Orders.Take(200);
                foreach (var em in ords)
                {
                    OrderInfo.Add(em);
                }
            }
            return(OrderInfo);
        }
コード例 #25
0
        /// <summary>
        /// Gets the orders.
        /// </summary>
        private void GetOrders()
        {
            Northwind northWind;

            if (!LayoutControl.IsInDesignMode)
            {
                string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
                northWind = new Northwind(connectionString);
                var order = northWind.Orders.Skip(0).Take(100).Select(o => o);
                foreach (var o in order)
                {
                    _orderCollection.Add(o);
                }
            }
        }
コード例 #26
0
        public ObservableCollection <Orders> GetEmployeeInfo()
        {
            ObservableCollection <Orders> employeesInfo = new ObservableCollection <Orders>();

            if (!LayoutControl.IsInDesignMode)
            {
                northWind = new Northwind(string.Format(@"Data Source= {0}", LayoutControl.FindFile("Northwind.sdf")));
                var ords = northWind.Orders;//.First(x=> x.;
                foreach (var em in ords)
                {
                    employeesInfo.Add(em);
                }
            }
            return(employeesInfo);
        }
コード例 #27
0
        public Window1()
        {
            InitializeComponent();

            string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));

            northWind = new Northwind(connectionString);

            this.grid.Model.RowCount        = 35;
            this.grid.Model.ColumnCount     = 25;
            this.grid.Model.ColumnWidths[1] = 100d;
            this.grid.Model.ColumnWidths[2] = 200d;

            grid.Model[1, 1].Foreground          = Brushes.Black;
            grid.Model[1, 1].Background          = Brushes.LightBlue;
            grid.Model[1, 1].Font.FontSize       = 13;
            grid.Model[1, 1].HorizontalAlignment = HorizontalAlignment.Left;
            grid.Model[1, 1].Font.FontWeight     = FontWeights.Bold;

            grid.Model[6, 1].Foreground          = Brushes.Black;
            grid.Model[6, 1].Background          = Brushes.LightBlue;
            grid.Model[6, 1].Font.FontSize       = 13;
            grid.Model[6, 1].HorizontalAlignment = HorizontalAlignment.Left;
            grid.Model[6, 1].Font.FontWeight     = FontWeights.Bold;

            grid.Model[6, 1].Foreground          = Brushes.Black;
            grid.Model[6, 1].Background          = Brushes.LightBlue;
            grid.Model[6, 1].Font.FontSize       = 13;
            grid.Model[6, 1].HorizontalAlignment = HorizontalAlignment.Left;
            grid.Model[6, 1].Font.FontWeight     = FontWeights.Bold;

            grid.Model[12, 1].Foreground          = Brushes.Black;
            grid.Model[12, 1].Background          = Brushes.LightBlue;
            grid.Model[12, 1].Font.FontSize       = 13;
            grid.Model[12, 1].HorizontalAlignment = HorizontalAlignment.Left;
            grid.Model[12, 1].Font.FontWeight     = FontWeights.Bold;

            grid.Model[17, 1].Foreground          = Brushes.Black;
            grid.Model[17, 1].Background          = Brushes.LightBlue;
            grid.Model[17, 1].Font.FontSize       = 13;
            grid.Model[17, 1].HorizontalAlignment = HorizontalAlignment.Left;
            grid.Model[17, 1].Font.FontWeight     = FontWeights.Bold;

            this.AddComboBoxes();
            this.AddDropDownLists();
            this.AddComboBoxesChoiceList();
            this.AddDropDownWithoutValueMember();
        }
コード例 #28
0
ファイル: ViewModel.cs プロジェクト: Abbas1546/WPF
        /// <summary>
        /// Gets the orders info.
        /// </summary>
        /// <returns></returns>
        private List <Orders> GetOrdersInfo()
        {
            List <Orders> ordersInfo = new List <Orders>();

            if (!LayoutControl.IsInDesignMode)
            {
                string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
                northWind = new Northwind(connectionString);
                var order = northWind.Orders;
                foreach (var o in order)
                {
                    ordersInfo.Add(o);
                }
            }
            return(ordersInfo);
        }
コード例 #29
0
ファイル: CustomerSource.cs プロジェクト: Abbas1546/WPF
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerSource"/> class.
 /// </summary>
 public CustomerSource()
 {
     if (!LayoutControl.IsInDesignMode)
     {
         string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
         northWind = new Northwind(connectionString);
         var order = northWind.Orders;
         foreach (var o in order)
         {
             if (!this.Contains(o.CustomerID))
             {
                 this.Add(o.CustomerID);
             }
         }
     }
 }
コード例 #30
0
        /// <summary>
        /// Gets the employee info.
        /// </summary>
        /// <returns></returns>
        private ObservableCollection <Orders> GetOrdersDetails()
        {
            var ordersDetails = new ObservableCollection <Orders>();

            if (!LayoutControl.IsInDesignMode)
            {
                string connectionString = string.Format(@"Data Source = {0}", LayoutControl.FindFile("Northwind.sdf"));
                northWind = new Northwind(connectionString);
                var emp = northWind.Orders.Take(500).ToList();
                foreach (var o in emp)
                {
                    ordersDetails.Add(o);
                }
            }
            return(ordersDetails);
        }