Пример #1
0
        private void ShowLoadingDialog()
        {
            var TableUserControl = new TableUserControl();

            var result = DialogHost.Show(TableUserControl, "TableUserControl", delegate(object sender, DialogOpenedEventArgs args)
            {
                //ThreadStart start = delegate ()
                //{
                //    string url = $"https://api.bobdong.cn/time_manager/user/login?name={name}&pw={pw}";

                //    var ReturnDatastr = NetHelper.HttpCall(url, null, HttpEnum.Get);

                //    var ReturnDataObject = JsonHelper.Deserialize<ReturnData<User>>(ReturnDatastr);

                //    Mainthread.BeginInvoke((Action)delegate ()// 异步更新界面
                //    {

                //        args.Session.Close(false);
                //        if (ReturnDataObject.code != 0)
                //        {
                //            MessageTips(ReturnDataObject.message);
                //        }
                //        else
                //        {
                //            MainStaticData.AccessToken = ReturnDataObject.data.access_token;
                //            Close();
                //        }
                //        // 线程结束后的操作
                //    });

                //};

                //new Thread(start).Start(); // 启动线程
            });
        }
Пример #2
0
        /// <summary>
        /// The create ui.
        /// </summary>
        /// <param name="parameters">
        /// The parameters.
        /// </param>
        /// <returns>
        /// The <see cref="IDataTypeUI"/>.
        /// </returns>
        public IDataTypeUI <IDictionary <string, string> > CreateUI(IDictionary <string, string> parameters)
        {
            var parentControl = new Control();
            var tableControl  = new TableUserControl();

            ConfigureControl(tableControl, parentControl);
            var fieldUsercontrol = new FieldUserControl();

            ConfigureControl(fieldUsercontrol, parentControl);
            return(tableControl);
        }
Пример #3
0
 public ControlVM(SearchBannerUserControl search, DayWeatherUserControl todayWeather, TableUserControl Table, MapUserControl Map, ChartUserControl Chart)
 {
     this.Search       = search;
     this.TodayWeather = todayWeather;
     this.Table        = Table;
     this.Map          = Map;
     this.Chart        = Chart;
     //init
     WeatherDay("Jerusalem");
     TableWeather("Jerusalem");
     chartCity("Jerusalem");
 }
Пример #4
0
        private void ListBox_selectClike(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            // MessageBox.Show(DemoItemsListBox.SelectedValue.ToString());

            //UserControl u=  new UserControl1(DemoItemsListBox.SelectedValue.ToString()+"  "+ ((ListBox)sender).SelectedIndex);
            //u.Name = ;

            // GifUserControl u = new GifUserControl();
            TableUserControl t = new TableUserControl();
            UserControl1     u = new UserControl1(DemoItemsListBox.SelectedValue as Items);

            this.Cotent.Content = u;
        }
Пример #5
0
        public UserControl CreateElement(ReportElementVM element)
        {
            UserControl returningUserControl = null;
            string      type = element.Type;

            if (type.Equals("table"))
            {
                TableUserControl table   = new TableUserControl();
                TableVM          tableVm = new TableVM(element);
                table.DataContext    = tableVm;
                returningUserControl = table;
            }
            else if (type.Equals("linechart"))
            {
                LineChartUserControl lineChart   = new LineChartUserControl();
                LineChartVM          lineChartVm = new LineChartVM(element);
                lineChart.DataContext = lineChartVm;
                returningUserControl  = lineChart;
            }
            else if (type.Equals("piechart"))
            {
                PieChartUserControl pieChart   = new PieChartUserControl();
                PieChartVM          pieChartVm = new PieChartVM(element);
                pieChart.DataContext = pieChartVm;
                returningUserControl = pieChart;
            }
            else if (type.Equals("barchart"))
            {
                BarChartUserControl barChart   = new BarChartUserControl();
                BarChartVM          barChartVm = new BarChartVM(element);
                barChart.DataContext = barChartVm;
                returningUserControl = barChart;
            }
            else if (type.Equals("image"))
            {
                ImageUserControl image   = new ImageUserControl();
                ImageVM          imageVm = new ImageVM(element);
                image.DataContext    = imageVm;
                returningUserControl = image;
            }
            else if (type.Equals("text"))
            {
                TextUserControl text   = new TextUserControl();
                TextVM          textVM = new TextVM(element);
                text.DataContext     = textVM;
                returningUserControl = text;
            }
            return(returningUserControl);
        }
Пример #6
0
        public void PopulateTables()
        {
            POSDataContext db = new POSDataContext();

            panelKassa.Controls.Clear();
            var tables = from a in db.TableSeats where a.IsDelete == false select a;

            if (tables.Count() > 0)
            {
                int length        = panelKassa.Width;
                int totalRowTable = (length - 5) / 210;
                int index         = 0;
                int row           = 0;
                foreach (var table in tables)
                {
                    TableUserControl uc = new TableUserControl();

                    uc.LabelControl.MouseClick += new MouseEventHandler(LabelControl_MouseClick);

                    var orderName = Helper.GetOrderName(db, table.TableID);

                    if (!string.IsNullOrEmpty(orderName))
                    {
                        uc.TableControlTitle = string.Format("{0}: {1}", table.TableName, orderName);
                    }

                    else
                    {
                        uc.TableControlTitle = table.TableName;
                    }

                    uc.LabelControl.Tag = table;

                    panelKassa.Controls.Add(uc);

                    if (index == 0)
                    {
                        uc.Left = 5;
                    }
                    else
                    {
                        uc.Left = 5 + (index * 210);
                    }

                    uc.ConfigureBackground(table.TableStatus);

                    uc.Top = 10 + (row * 90);

                    index++;

                    if ((index + 1) > totalRowTable)
                    {
                        index = 0;
                        row++;
                    }
                }

                dataGridTables.DataSource = ctx.TableSeats.ToArray();
                cboTables.DataSource      = ctx.TableSeats.ToArray();
                //dataGridMenus.DataSource = ctx.MenuCard;
                List <MenuGroup> list = new List <MenuGroup>(ctx.MenuGroups.ToArray());

                MenuGroup g = new MenuGroup();
                g.id        = 0;
                g.GroupName = "ALL";
                list.Add(g);
                cboFilter.DataSource    = list;
                cboFilter.SelectedValue = 0;
            }
        }