Ejemplo n.º 1
0
        public editEmployee()
        {
            InitializeComponent();
            m_bs = new BindingSource();
            BusinessMetaLayer ml = BusinessMetaLayer.instance();

            m_employees     = ml.getEmployees();
            m_bs.DataSource = m_employees;
            m_bs.ResetBindings(false);
            this.dataEmployee.DataSource = m_bs.DataSource;
        }
Ejemplo n.º 2
0
        private void lstEmployees_Click(object sender, EventArgs e)
        {
            BusinessMetaLayer ml = BusinessMetaLayer.instance();

            m_employees     = ml.getEmployees();
            m_bs.DataSource = m_employees;
            m_bs.ResetBindings(false);
            this.dgdInventoryWindow.DataSource         = m_bs.DataSource;
            this.dgdInventoryWindow.RowHeadersVisible  = false;
            this.dgdInventoryWindow.Columns[0].Visible = false;
        }
Ejemplo n.º 3
0
        public setTask()
        {
            InitializeComponent();

            //dtTaskDate.Format = DateTimePickerFormat.Custom;
            //dtTaskDate.CustomFormat = "dd-MM-yyyy";

            //Load Employee Combo Box
            m_em                    = new BindingSource();
            m_employees             = tl.getEmployees();
            m_em.DataSource         = m_employees;
            cmbEmployees.DataSource = m_em;
            //Load Task Type Combo Box
            m_tt                    = new BindingSource();
            m_taskTypes             = tl.getTaskTypes();
            m_tt.DataSource         = m_taskTypes;
            cmbTaskTypes.DataSource = m_tt;
            //Load Task Status Combo Box
            m_cr                = new BindingSource();
            m_crops             = tl.getCrops();
            m_cr.DataSource     = m_crops;
            cmbCrops.DataSource = m_cr;
            //Load Field Combo Box
            m_fd                 = new BindingSource();
            m_fields             = tl.getFields();
            m_fd.DataSource      = m_fields;
            cmbFields.DataSource = m_fd;
            //Load Vehicle Combo Box
            m_ve                   = new BindingSource();
            m_vehicles             = tl.getVehicles();
            m_ve.DataSource        = m_vehicles;
            cmbVehicles.DataSource = m_ve;
            //Load Storage Unit Combo Box
            m_su                      = new BindingSource();
            m_storageUnits            = tl.getStorageUnits();
            m_su.DataSource           = m_storageUnits;
            cmbStorageUnit.DataSource = m_storageUnits;

            m_dg            = new BindingSource();
            m_tasks         = tl.getTasks();
            m_dg.DataSource = m_tasks;
            m_dg.ResetBindings(true);
            this.dgdTasksList.DataSource         = m_dg.DataSource;
            this.dgdTasksList.RowHeadersVisible  = false;
            this.dgdTasksList.Columns[0].Visible = false;
        }
Ejemplo n.º 4
0
        private void btnEditEmp_Click(object sender, EventArgs e)
        {
            BusinessMetaLayer create = BusinessMetaLayer.instance();
            int success;

            String privilege;

            if (cboxEdPrivilege.Checked == true)
            {
                privilege = "Yes";
            }
            else
            {
                privilege = "No";
            }

            String Name        = txtEdEmpName.Text;
            String userName    = txtEdEmpUsern.Text;
            String password    = txtEdEmpPass.Text;
            String email       = txtEdEmpEmail.Text;
            String postcode    = txtEdEmpPost.Text;
            String phoneNumber = txtEdEmpPhone.Text;

            success = ml.EditEmployee(Id, postcode, phoneNumber, email, userName, password, privilege);

            if (success == 1)
            {
                MessageBox.Show("Account edited");
                m_bs            = new BindingSource();
                m_employees     = ml.getEmployees();
                m_bs.DataSource = m_employees;
                m_bs.ResetBindings(false);
                this.dataEmployee.DataSource = m_bs.DataSource;
                txtEdEmpName.Clear();
                txtEdEmpUsern.Clear();
                txtEdEmpPass.Clear();
                txtEdEmpEmail.Clear();
                txtEdEmpPost.Clear();
                txtEdEmpPhone.Clear();
                cboxEdPrivilege.Checked = false;
            }
        }