Exemplo n.º 1
0
        public async void getTask()
        {
            string        url           = "https://localhost:5001/api/Task/get?routeId=" + route.RouteId;
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(List <Models.Task>));
            Client        client        = new Client();

            flowLayoutPanel_todo.Controls.Clear();
            try
            {
                HttpResponseMessage result = await client.Get(url);

                if (result.IsSuccessStatusCode)
                {
                    List <Models.Task> tasks = (List <Models.Task>)xmlSerializer.Deserialize(await result.Content.ReadAsStreamAsync());
                    foreach (Models.Task task in tasks)
                    {
                        UC_Todo cell = new UC_Todo(task, delegate_Get);
                        //添加到panel中
                        flowLayoutPanel_todo.Controls.Add(cell);
                    }
                }
                else
                {
                    using (Form_Tips tip = new Form_Tips("警告", "初始化信息失败"))
                    {
                        tip.ShowDialog();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 2
0
        public UC_SiteInfo()
        {
            InitializeComponent();
            UC_Todo uc_todo = new UC_Todo();

            AddControlsToPanel(uc_todo, TodoflowLayoutPanel1);
        }
Exemplo n.º 3
0
        public UC_SiteInfo(ChangePanel changePanel, long routeID = -1, bool isCreate = false)
        {
            InitializeComponent();
            this.routeID     = routeID;
            this.changePanel = changePanel;
            UC_Todo uc_todo = new UC_Todo();

            AddControlsToPanel(uc_todo, TodoflowLayoutPanel1);
        }