Esempio n. 1
0
        private async void Delete(int?obj)
        {
            try
            {
                dc = new DialogContent()
                {
                    Content = "Bạn muốn xóa vận chuyển này ?", Tilte = "Thông Báo"
                };
                var dialogYS = new DialogYesNo()
                {
                    DataContext = dc
                };
                var result = (bool)await DialogHost.Show(dialogYS, DialogHostId);

                if (result)
                {
                    if (obj != null)
                    {
                        if (await log_repo.Remove((int)obj))
                        {
                            ListLog.Remove(ListLog.SingleOrDefault(t => t.LogID == (int)obj));
                            dc = new DialogContent()
                            {
                                Content = "Xóa Thành Công", Tilte = "Thông Báo"
                            };
                            dialog = new DialogOk()
                            {
                                DataContext = dc
                            };
                            await DialogHost.Show(dialog, DialogHostId);
                        }
                        else
                        {
                            dc = new DialogContent()
                            {
                                Content = "Xóa Thất Bại", Tilte = "Thông Báo"
                            };
                            dialog = new DialogOk()
                            {
                                DataContext = dc
                            };
                            await DialogHost.Show(dialog, DialogHostId);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 2
0
        private async void LoadData(int?obj)
        {
            if (obj != null)
            {
                var i = ListLog.SingleOrDefault(t => t.LogID == (int)obj);
                if (i != null)
                {
                    LogID = i.LogID.ToString();
                    Name  = i.Name;
                    Fee   = i.Fee.ToString();
                }

                await DialogHost.Show(new LogisticProfile(), DialogHostId);
            }
        }