Exemplo n.º 1
0
 private void holidayDataGridView_RowLeave(object sender, DataGridViewCellEventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     try
     {
         if (holidayDataGridView.Rows.Count > 0)
         {
             if (holidayDataGridView.IsCurrentRowDirty)
             {
                 this.Validate();
                 holidayBindingSource.EndEdit();
                 int iResult = ActionClass.SaveHoliday((Holiday)holidayBindingSource.Current);
                 if (iResult > 0)
                 {
                     Console.WriteLine(iResult.ToString());
                     toolStripStatusLabel1.Text = "Saved.";
                     Thread.Sleep(500);
                     holidayBindingSource.DataSource = ActionClass.FillHolidays();
                 }
             }
         }
         toolStripStatusLabel1.Text = "Ready...";
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error - " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         toolStripStatusLabel1.Text = "Error - " + ex.Message + ". Please refer to system administrator.";
         //throw;
     }
     Cursor = Cursors.Default;
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ReportParameter p1 = new ReportParameter("CompanyNamez", SCompanyName);

            this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1 });
            HolidayBindingSource.DataSource = ActionClass.FillHolidays();
            this.reportViewer1.RefreshReport();
        }
Exemplo n.º 3
0
        private void buttonPreview_Click(object sender, EventArgs e)
        {
            int             iMonth = comboBoxMonth.SelectedIndex + 1;
            int             iYear  = Convert.ToInt16(comboBoxYear.Text);
            ReportParameter p1     = new ReportParameter("CompanyNamez", SCompanyName);

            this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { p1 });
            HolidayBindingSource.DataSource = ActionClass.FillHolidays(iMonth, iYear);
            this.reportViewer1.RefreshReport();
        }
Exemplo n.º 4
0
        public void InitComponents()
        {
            departmentBindingSource.DataSource    = ActionClass.FillDepartments();
            miscellaneousBindingSource.DataSource = ActionClass.FillMiscellaneous();
            holidayBindingSource.DataSource       = ActionClass.FillHolidays();
            companyBindingSource.DataSource       = ActionClass.FillCompanies();
            checkBoxShowHourMinDTRPrint.Checked   =
                Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["PrintAll"]);
            // 1st IP Address
            textBoxIPAddress.Text = System.Configuration.ConfigurationManager.AppSettings["IPAddressNW1"];
            textBoxPortNo.Text    = System.Configuration.ConfigurationManager.AppSettings["IPortNW1"];
            textBoxSerialNo.Text  = ConfigurationManager.AppSettings["MachineSN_NW1"];
            textBoxKey.Text       = ConfigurationManager.AppSettings["MacKeyTempNW1"];
            if (System.Configuration.ConfigurationManager.AppSettings["ScreenTypeNW1"] == "CO")
            {
                radioButtonColored.Checked = true;
            }
            else
            {
                radioButtonBW.Checked = true;
            }

            // 2ns IP Address
            textBoxIP1.Text     = System.Configuration.ConfigurationManager.AppSettings["IPAddressNW2"];
            textBoxPort1.Text   = System.Configuration.ConfigurationManager.AppSettings["IPortNW2"];
            textBoxSerial1.Text = ConfigurationManager.AppSettings["MachineSN_NW2"];
            textBoxKey1.Text    = ConfigurationManager.AppSettings["MacKeyTempNW2"];
            if (System.Configuration.ConfigurationManager.AppSettings["ScreenType2"] == "CO")
            {
                radioButtonColor1.Checked = true;
            }
            else
            {
                radioButtonBW1.Checked = true;
            }


            labelCompanyName.Text = SCompanyName;
        }