Esempio n. 1
0
        public static void CreateNumberReport(DocumentViewer documentViewer, ObservableCollection <Book> Data)
        {
            try
            {
                ReportDocument reportDocument = new ReportDocument();

                StreamReader reader = new StreamReader(new FileStream(@"..\..\Assets\ReportTemplates\NumberReport\NumberReport.xaml", FileMode.Open, FileAccess.Read));
                reportDocument.XamlData      = reader.ReadToEnd();
                reportDocument.XamlImagePath = Path.Combine(Environment.CurrentDirectory, @"..\..\Assets\ReportTemplates\NumberReport\");
                reader.Close();

                ReportData data = new ReportData();

                data.ReportDocumentValues.Add("PrintDate", DateTime.Now);

                DataTable table = new DataTable("NumberReport");
                table.Columns.Add("Id", typeof(string));
                table.Columns.Add("ItemInfo", typeof(string));
                table.Columns.Add("IDCode", typeof(string));
                table.Columns.Add("Number", typeof(string));
                foreach (var item in Data)
                {
                    table.Rows.Add(new object[] { item.ID, string.Format("Tên sách: {0}\nTác giả: {1}\nThể loại: {2}", item.Name, item.AuthorsShortFormat, item.GenresShortFormat), string.Format("9001{0:00000000}", item.ID), string.Format("Tháng này: {0} quyển\nTháng trước: {1} quyển", item.Number, item.Tag) });
                }
                data.DataTables.Add(table);

                XpsDocument xps = reportDocument.CreateXpsDocument(data);
                documentViewer.Document = xps.GetFixedDocumentSequence();
            }
            catch (Exception ex)
            {
                WarningBox.Show("Thông báo...", "Xãy ra sự cố!", "Có vấn đề khi lập báo cáo với dữ liệu được tra!", false, ex.Message);
            }
        }
Esempio n. 2
0
        public static void CreateDebtorReport(DocumentViewer documentViewer, ObservableCollection <Customer> Data)
        {
            try
            {
                ReportDocument reportDocument = new ReportDocument();

                StreamReader reader = new StreamReader(new FileStream(@"..\..\Assets\ReportTemplates\DebtorReport\DebtorReport.xaml", FileMode.Open, FileAccess.Read));
                reportDocument.XamlData      = reader.ReadToEnd();
                reportDocument.XamlImagePath = System.IO.Path.Combine(Environment.CurrentDirectory, @"..\..\Assets\ReportTemplates\DebtorReport\");
                reader.Close();

                ReportData data = new ReportData();

                data.ReportDocumentValues.Add("PrintDate", DateTime.Now);

                DataTable table = new DataTable("DebtorReport");
                table.Columns.Add("ID", typeof(string));
                table.Columns.Add("Name", typeof(string));
                table.Columns.Add("Debt", typeof(string));
                table.Columns.Add("Phone", typeof(string));
                foreach (var item in Data)
                {
                    table.Rows.Add(new object[] { item.ID, item.Name, string.Format("Tháng này: {0}\nTháng trước: {1:#,###,##0} vnđ", item.DebtFormat, item.Tag), item.PhoneFormat });
                }
                data.DataTables.Add(table);

                XpsDocument xps = reportDocument.CreateXpsDocument(data);
                documentViewer.Document = xps.GetFixedDocumentSequence();
            }
            catch (Exception ex)
            {
                WarningBox.Show("Thông báo...", "Xãy ra sự cố!", "Có vấn đề khi lập báo cáo với dữ liệu được tra!", false, ex.Message);
            }
        }
Esempio n. 3
0
 public Error(string name, string content, bool isCrash = true, string exception = null)
 {
     if (!ErrorManager.Current.Ignore)
     {
         WarningBox = new WarningBox(ErrorManager.ErrorTitle, name, content, isCrash, exception);
     }
     LastCreatedError = this;
 }
Esempio n. 4
0
        // R o m   C h a n g e s   N o t i f i c a t i o n

        private void NotifyRomChangesAvailable(ref bool mute)
        {
            var  notifyMode     = Settings.General.RomChangedNotification;
            bool showWarningBox = notifyMode == NotificationMode.Infobox;

            // Show popup
            if (notifyMode == NotificationMode.Popup && !mute)
            {
                var tdinfo = new TaskDialogInfo()
                {
                    Title          = Form_Main_Resources.MsgBox_RomChanged_Title,
                    Header         = Form_Main_Resources.MsgBox_RomChanged_Title,
                    TaskDialogIcon = eTaskDialogIcon.Information,
                    Text           = Form_Main_Resources.MsgBox_RomChanged,
                    DialogButtons  = eTaskDialogButton.Yes | eTaskDialogButton.No
                };
                switch (TaskDialog.Show(tdinfo))
                {
                case eTaskDialogResult.Yes:
                    Controller.ReloadRom();
                    showWarningBox = false;
                    break;

                default:
                    showWarningBox = true;
                    mute           = true;
                    break;
                }
            }

            // Create WarningBox
            if (showWarningBox && WarningBox_RomChanged is null)
            {
                WarningBox_RomChanged = new WarningBox()
                {
                    Text               = Form_Main_Resources.WarningBox_RomChanged_Text,
                    OptionsText        = Form_Main_Resources.WarningBox_RomChanged_ReloadRom,
                    Dock               = DockStyle.Top,
                    CloseButtonVisible = false
                };
                WarningBox_RomChanged.OptionsClick += WarningBox_RomChanged_OptionsClick;
                WarningBox_RomChanged.CloseClick   += WarningBox_RomChanged_CloseClick;
            }

            // Set Warningbox size and add it
            if (WarningBox_RomChanged is object && showWarningBox)
            {
                if (!Panel1.Controls.Contains(WarningBox_RomChanged))
                {
                    Panel1.Controls.Add(WarningBox_RomChanged);
                }

                TabControl1.Top              += WarningBox_RomChanged.Height;
                TabControl1.Height           -= WarningBox_RomChanged.Height;
                WarningBox_RomChanged.Visible = true;
                WarningBox_RomChanged.BringToFront();
            }
        }
Esempio n. 5
0
 private void FormMain_Load(object sender, EventArgs e)
 {
     // Show the warning box at least once !
     if (!Properties.Settings.Default.LegalAcknowledged)
     {
         WarningBox wb = new WarningBox();
         wb.ShowDialog();
     }
     UserManagement.UpdateTitle(this);
 }
Esempio n. 6
0
    void Awake()
    {
        _satisfactionText = SatifactionInfo.GetComponentInChildren <Text>();
        _incidenText      = IncidentInfo.GetComponentInChildren <Text>();
        _officerText      = OfficerInfo.GetComponentInChildren <Text>();
        _turnText         = TurnInfo.GetComponentInChildren <Text>();
        _warningObject    = GameObject.Find("WarningPopup").GetComponent <WarningBox>();

        DisableAll();
    }
Esempio n. 7
0
        protected virtual void CurrentMatchChanged(ValueChangedEvent <TournamentMatch> match)
        {
            if (match.NewValue == null)
            {
                AddInternal(noMatchWarning = new WarningBox("Choose a match first from the brackets screen"));
                return;
            }

            noMatchWarning?.Expire();
            noMatchWarning = null;
        }
Esempio n. 8
0
        private void load()
        {
            Content.Add(new LadderEditorSettings
            {
                Anchor = Anchor.TopRight,
                Origin = Anchor.TopRight,
                Margin = new MarginPadding(5)
            });

            AddInternal(rightClickMessage = new WarningBox("Right click to place and link matches"));

            LadderInfo.Matches.CollectionChanged += (_, __) => updateMessage();
            updateMessage();
        }
Esempio n. 9
0
 public Error Call(string exception = null)
 {
     if (WarningBox != null)
     {
         WarningBox.ErrorException = exception;
         foreach (Window item in Application.Current.Windows)
         {
             if (item.IsActive)
             {
                 WarningBox.Owner = item;
                 break;
             }
         }
         WarningBox.ShowDialog();
     }
     return(this);
 }
        private void QuickPayDebtMoney(object sender, RoutedEventArgs e)
        {
            var control = sender as Button;
            var tag     = control.Tag as Customer;

            if (tag != null)
            {
                if (tag.Debt > 0)
                {
                    var uc = (tabPhieuThuTien)Bus.AppHandler.OpenTab((Tag as WPF.MDI.MdiChild).Tag as WPF.MDI.MdiContainer, typeof(tabPhieuThuTien), "Đòi nợ", false);
                    uc.CustomerTransfer = tag.ID;
                }
                else
                {
                    WarningBox.Show("Thông báo", "Không tồn tại nợ", "Khách hàng <" + tag.Name + "> không thiếu nợ!");
                }
            }
        }
        private void getData(object sender, RoutedEventArgs e)
        {
            var c = month.SelectedItem as ComboBoxItem;

            if (c != null)
            {
                if (int.TryParse((string)c.Tag, out Month) && int.TryParse(year.Text, out Year))
                {
                    if (Year < DateTime.Now.Year || (Year == DateTime.Now.Year && Month < DateTime.Now.Month))
                    {
                        Data = Bus.SearchData.GetDebtorReportData(Month, Year);
                        btnReport.Visibility = System.Windows.Visibility.Visible;
                    }
                    else
                    {
                        Data = null;
                        WarningBox.Show("Thông báo...", "Thời gian lập báo cáo không hợp lệ", "Thời gian lập báo cáo\nnên trước thời gian hiện tại ít nhất 1 tháng!");
                    }
                }
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Emit a warning about the user actions which may need to be performed.
        /// </summary>
        /// <returns>True if the operation should be performed, false if it is cancelled.</returns>
        /// <param name="debugging">If true warn about debugging, else warn about profiling.</param>
        /// <param name="doNotRepeat">Set to true of the warning should not be repeated.</param>
        internal bool EmitWarning(bool debugging, out bool doNotRepeat)
        {
            string warning;

            if (debugging)
            {
                warning  = "For a better debugging experience please consider doing the folowing actions:\n";
                warning += "- set `Tool > Options... > Debugging > General > Enable Just My Code' to `false' in Visual Studio\n";
            }
            else
            {
                warning = "Profiling is only supported on 64-bit machines with Visual Studio installed.\n"
                          + "The vertex will now be executed and profiled locally. This may take a significant amount of time.\n"
                          + "When the profiling is completed the result will be displayed in a new Visual Studio instance.";
            }

            WarningBox box = new WarningBox(warning);

            box.ShowDialog();
            doNotRepeat = box.DoNotShowAgain;
            return(!box.Cancelled);
        }
Esempio n. 13
0
 /// <summary>
 /// 显示错误信息
 /// </summary>
 /// <param name="info"></param>
 /// <param name="box"></param>
 public static void ShowError(string info, WarningBox box)
 {
     ShowWarningBox(info, box, "red");
 }
Esempio n. 14
0
 private void WarningBox_GotFocus(object sender, RoutedEventArgs e)
 {
     WarningBox.SelectAll();
 }
Esempio n. 15
0
 /// <summary>
 /// 显示提示信息
 /// </summary>
 /// <param name="info"></param>
 /// <param name="box"></param>
 public static void ShowInfo(string info, WarningBox box)
 {
     ShowWarningBox(info, box, "green");
 }
Esempio n. 16
0
 private void Awake()
 {
     _warningPopup = GameObject.Find("WarningPopup").GetComponent <WarningBox>();
 }
Esempio n. 17
0
 /// <summary>
 /// 显示提示信息
 /// </summary>
 /// <param name="info"></param>
 /// <param name="box"></param>
 /// <param name="second">存在时长 等于0时,则永不消失。 单位(秒)</param>
 public static void ShowWarningBox(string info, WarningBox box, string color)
 {
     box.Text    = "  <font color='" + color + "'>" + info + "</font>";
     box.Visible = true;
 }