Example #1
0
        /// <summary>
        /// просморт/экспорт
        /// </summary>
        /// <param name="fName"></param>
        /// <param name="vr"></param>
        /// <param name="DT"></param>
        /// <param name="dpz"></param>
        /// <param name="fr"></param>
        /// <param name="objective"></param>
        public ShowEvents(string fName, byte[] vr, DateTime DT, Diapazon dpz, MainForm fr, ShowEventsObjective objective)
        {
            InitializeComponent();
            FileName = fName;
            Date     = DT;
            //WorkDir = WDir;

            Array.Copy(vr, vers, 4);

            // заголовок
            switch (dpz)
            {
            case Diapazon.Day:          // день
                lblCaption.Text = DT.ToShortDateString();
                ShowOneDay      = true;
                lblDate.Visible = false;
                break;

            case Diapazon.Month:        // месяц
                lblCaption.Text = month[DT.Month] + " " + DT.Year.ToString();
                ShowOneDay      = false;
                lblDate.Visible = true;
                break;

            default:                    // все события
                lblCaption.Text = "Список всех событий";
                ShowOneDay      = false;
                lblDate.Visible = true;
                break;
            }
            //pnlMain.Dispose();
            //panel4.Dispose();

            MnFrm = fr;
            obj   = objective;
            switch (objective)
            {
            case ShowEventsObjective.toExport:
                btnExpImpAdd.Text   = "Экспорт";
                btnExpImpAdd.Click += new EventHandler(btnExp_Click);
                btnDelete.Visible   = false;
                btnEdit.Visible     = false;
                break;

            case ShowEventsObjective.toImport:
                btnExpImpAdd.Text   = "Импорт";
                btnExpImpAdd.Click += new EventHandler(btnImp_Click);
                btnDelete.Visible   = false;
                btnEdit.Visible     = false;
                break;

            default:
                btnExpImpAdd.Click += new EventHandler(btnAdd_Click);
                break;
            }
        }
Example #2
0
 private void ButtonSelectingDiapazon_CheckedChanged(object sender, EventArgs e)
 {
     diapazon = (Diapazon)(sender as Control).Tag;
 }