Exemplo n.º 1
0
 private void departmentDataGridView_RowLeave(object sender, DataGridViewCellEventArgs e)
 {
     Cursor = Cursors.WaitCursor;
     try
     {
         if (departmentDataGridView.Rows.Count > 0)
         {
             if (departmentDataGridView.IsCurrentRowDirty == true)
             {
                 this.Validate();
                 ((Department)departmentBindingSource.Current).EditedBy = SUserName;
                 ((Department)departmentBindingSource.Current).EditedOn = DateTime.Now;
                 departmentBindingSource.EndEdit();
                 int iResult = ActionClass.SaveDepartment((Department)departmentBindingSource.Current);
                 if (iResult > 0)
                 {
                     Console.WriteLine(iResult.ToString());
                     toolStripStatusLabel1.Text         = "Saved.";
                     departmentBindingSource.DataSource = ActionClass.FillDepartments();
                     Thread.Sleep(500);
                 }
             }
         }
         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 LoadDepartments()
        {
            comboBoxDepartment.Items.Clear();
            List <Department> listDepartment = ActionClass.FillDepartments();

            foreach (var department in listDepartment)
            {
                comboBoxDepartment.Items.Add(department);
            }
            comboBoxDepartment.DisplayMember = "DepartmentName";
            comboBoxDepartment.ValueMember   = "DepartmentId";
            comboBoxDepartment.Items.Insert(0, "--- All Depatments ---");
            comboBoxDepartment.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        private void InitComponents()
        {
            Cursor.Current = Cursors.WaitCursor;
            this.Invoke((MethodInvoker) delegate
            {
                departmentBindingSource.DataSource = ActionClass.FillDepartments();
                positionsBindingSource.DataSource  = ActionClass.FillPostions();
                settingBindingSource.DataSource    = ActionClass.FillSettings();

                //enrolleeBindingSource.DataSource = ActionClass.FillEnrollees();
            });

            if (labelCompanyName.InvokeRequired)
            {
                labelCompanyName.BeginInvoke(new MethodInvoker(delegate() { labelCompanyName.Text = SCompanyName; }));
            }
            Cursor.Current = Cursors.Default;
        }
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;
        }