コード例 #1
0
        private void ToolStripCheckOut_Click(object sender, EventArgs e)
        {
            //FIRST CHECK WHETHER THEY HAVE BEEN SAVED IF NOT DO NOT LOAD THE ASSET PAGE
            //GetEmployeesDetails();
            //get the personal no from Add employees form


            AddEmployee addEmloyee = new AddEmployee();
            var         emDet      = addEmloyee.txtFname.Text;
            var         personalno = addEmloyee.Controls.Find("txtpersonalNumber", true);

            if (CommonData.SelectedEmpId == null)
            {
                var results = MessageBox.Show("Checkout is only done to Employees who have been saved. would you like to Save this record first?",
                                              "Add Employee",
                                              MessageBoxButtons.OKCancel);

                if (results == DialogResult.Cancel)
                {
                }
                else
                {
                    SaveNewEmployee();
                }

                //if yes save records to database.
            }
            else
            {
                Checkout asset = new Checkout();

                asset.FillControls();
                asset.ShowDialog();
            }
        }
コード例 #2
0
        /// <summary>
        /// Executes the edit command
        /// </summary>
        public void EditUserExecute()
        {
            try
            {
                if (Employee != null)
                {
                    AddEmployee addEmployee = new AddEmployee(Employee);
                    addEmployee.ShowDialog();

                    EmployeeList        = service.GetAllEmployees().ToList();
                    AllInfoEmployeeList = service.GetAllEmployeesInfo().ToList();
                    UserList            = service.GetAllUsers().ToList();
                }
                if (Manager != null)
                {
                    AddManager addManager = new AddManager(Manager);
                    addManager.ShowDialog();

                    ManagerList        = service.GetAllManagers().ToList();
                    AllInfoManagerList = service.GetAllManagersInfo().ToList();
                    UserList           = service.GetAllUsers().ToList();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
コード例 #3
0
        private void addEmployeeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AddEmployee ob = new AddEmployee();

            ob.Show();
            this.Hide();
        }
コード例 #4
0
 public AddEmployeeViewModel(AddEmployee employeeView)
 {
     this.employeeView = employeeView;
     Employee          = new vwEmployee();
     EngagementList    = engagement.GetEngagements();
     GenderList        = genders.GetGenders();
 }
コード例 #5
0
ファイル: AdminDashboard.cs プロジェクト: jasleen996/BookBizz
        private void addEmployee_Click(object sender, EventArgs e)
        {
            this.Hide();
            AddEmployee addEmployee = new AddEmployee();

            addEmployee.Show();
        }
コード例 #6
0
        //public void  Delete(AddEmployee criteria)
        //{
        //    var deleted =  _ctx.Employees
        //                        .Include(e => e.Dependents)
        //                        .First(e => e.Id == criteria.Id);
        //    _ctx.Remove(deleted);
        //    _ctx.SaveChangesAsync();
        //}

        public int Add(AddEmployee emp)
        {
            try
            {
                _logger.LogInformation("Add new Employee");
                var result = new Entities.Employee
                {
                    FirstName  = emp.Employee.FirstName,
                    LastName   = emp.Employee.LastName,
                    Dependents = emp.Dependents.Select(ed => new Entities.Info
                    {
                        FirstName = ed.FirstName,
                        LastName  = ed.LastName
                    }).ToList()
                };
                _ctx.Add(result);
                _ctx.SaveChanges();
                return(result.Id);
            }
            catch (Exception ex)
            {
                _logger.LogError($"Failed to add employee: {ex}");
                return(0);
            }
        }
コード例 #7
0
 public MainWindow()
 {
     InitializeComponent();
     formAdd     = new AddEmployee(dataGridEmploes);
     DataContext = new ApplicationEmployeeControl(this, formAdd);
     dataGridEmploes.Items.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
 }
コード例 #8
0
 /// <summary>
 /// Constructor with the add employee info window opening
 /// </summary>
 /// <param name="addEmployeeOpen">opends the add employee window</param>
 public AddEmployeeViewModel(AddEmployee addEmployeeOpen)
 {
     employee    = new vwEmployee();
     addEmployee = addEmployeeOpen;
     //bgWorker.DoWork += WorkerOnDoWork;
     EmployeeList = service.GetAllEmployees().ToList();
 }
コード例 #9
0
 public AddEmployeeViewModel(AddEmployee addEmployeeOpen)
 {
     account         = new tblAccount();
     employee        = new tblEmployee();
     addEmployee     = addEmployeeOpen;
     engagementsList = service.GetAllEngagements();
 }
コード例 #10
0
        private void ButtonClick(object sender, EventArgs e)
        {
            string clickedButton = (sender as Button).Text;

            switch (clickedButton)
            {
            case "Add Employee":
                MVCForm.DisposeView(this.view);
                AddEmployee           addEmployeeDashboard  = new AddEmployee();
                AddEmployeeView       addEmployeeView       = new AddEmployeeView();
                AddEmployeeController addEmployeeController = new AddEmployeeController(addEmployeeDashboard, addEmployeeView, this.curForm);
                addEmployeeController.DisplayView();
                DisplayNavigation();
                break;

            case "Edit Employee":
                MVCForm.DisposeView(this.view);
                EditEmployee           editEmployeeDashboard  = new EditEmployee();
                EditEmployeeView       editEmployeeView       = new EditEmployeeView();
                EditEmployeeController editEmployeeController = new EditEmployeeController(editEmployeeDashboard, editEmployeeView, this.curForm);
                editEmployeeController.DisplayView();
                DisplayNavigation();
                break;

            case "Delete Employee":
                MVCForm.DisposeView(this.view);
                DeleteEmployee           deleteEmployeeDashboard  = new DeleteEmployee();
                DeleteEmployeeView       deleteEmployeeView       = new DeleteEmployeeView();
                DeleteEmployeeController deleteEmployeeController = new DeleteEmployeeController(deleteEmployeeDashboard, deleteEmployeeView, this.curForm);
                deleteEmployeeController.DisplayView();
                DisplayNavigation();
                break;
            }
        }
コード例 #11
0
 private void SaveExecute()
 {
     try
     {
         if (service.CheckCode(Code))
         {
             MessageBox.Show("Code correct. Please procced to completing yor manager registration.");
             AddManager addManager = new AddManager(AccountToView);
             addManager.ShowDialog();
             managerCode.Close();
         }
         else
         {
             counter--;
             if (counter > 0)
             {
                 MessageBox.Show("Code incorrect." + " " + counter.ToString() + " " + "attempts left");
             }
             else
             {
                 MessageBox.Show("Out of attempts. Proceed to completing registration as an employee.");
                 AddEmployee addEmployee = new AddEmployee(AccountToView);
                 addEmployee.ShowDialog();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
 }
コード例 #12
0
        public AddEmployeeViewModel(AddEmployee addEmployeeOpen)
        {
            eventObject = new EventClass();

            SelectedMenager = new ManagerDto();


            employee    = new tblEmployee();
            addEmployee = addEmployeeOpen;

            locationService = new LocationService();
            employeeService = new EmployeeService();

            sectorService = new SectorService();

            locationsInDb = locationService.GetAllLocations().ToList();

            LocationList    = ConvertLocationDtoList(locationsInDb);
            selctedLocation = LocationList.FirstOrDefault();
            LocationList.OrderByDescending(x => x.Location);
            LocationList.Reverse();



            managersInDb = employeeService.GetAllPotentialMenagers();

            PotentialMenagers = ConvertManagerListToDto(managersInDb);


            eventObject.ActionPerformed += ActionPerformed;
        }
コード例 #13
0
        private void addEmployeeButton_Click(object sender, RoutedEventArgs e)
        {
            AddEmployee addEmployee = new AddEmployee(PostNameList);

            addEmployee.Owner = this;
            addEmployee.Show();
        }
コード例 #14
0
        private void btnNewAdd_Click(object sender, EventArgs e)
        {
            Employee_info emp = new Employee_info();

            emp.EmployeeName = txtName.Text.Trim();
            emp.TelephoneNo  = txtTelpone.Text.Trim();
            emp.Email        = txtEmail.Text.Trim();
            emp.EducationId  = Convert.ToInt32((cmbEducation.SelectedValue));
            //emp.EmployeeId = int.Parse(txtID.Text.Trim());
            emp.SalLevelId = cmbPay.Text.Trim() == ""? 0: int.Parse(cmbPay.Text.Trim());
            emp.DeptId     = Convert.ToInt32(cmbDep.SelectedValue);
            emp.PositionId = Convert.ToInt32(cmbZwei.SelectedValue);

            if (rdbMan.Checked)
            {
                emp.Gender = true;
            }
            else
            {
                emp.Gender = false;
            }

            emp.HireDate = dateTimePicker1.Value;
            emp.Desc     = txtInformation.Text;
            AddEmployee emp1 = new AddEmployee();

            emp1.AddEmloy(emp);
            MessageBox.Show("数据插入成功");
        }
コード例 #15
0
 public AddEmployeeViewModel(AddEmployee addEmployeeOpen)
 {
     addEmployee     = addEmployeeOpen;
     serviceEmployee = new ServiceEmployee();
     serviceManager  = new ServiceManager();
     employee        = new vwEmployee();
     floorManager    = serviceManager.GetManagerFloor().ToList();
 }
コード例 #16
0
 public AddEmployeeController(AddEmployee model, AddEmployeeView view, Form curForm)
 {
     db                    = new LINQDataContext();
     this.model            = model;
     this.view             = view;
     this.curForm          = curForm;
     view.BtnCreate.Click += (sender, e) => btnCreate_Click(sender, e);
 }
コード例 #17
0
 /// <summary>
 /// Constructor with edit employee window opening
 /// </summary>
 /// <param name="addEmployeeOpen">opens the edit employee window</param>
 /// <param name="employeeEdit">gets the employee info that is being edited</param>
 public AddUserViewModel(AddEmployee addEmployeeOpen, vwEmployee employeeEdit)
 {
     employee            = employeeEdit;
     addEmployee         = addEmployeeOpen;
     AllInfoEmployeeList = service.GetAllEmployeesInfo().ToList();
     EmployeeList        = service.GetAllEmployees().ToList();
     UserList            = service.GetAllUsers().ToList();
 }
コード例 #18
0
 public AddEmployeeViewModel(AddEmployee employeeOpen)
 {
     view       = employeeOpen;
     service    = new HotelService();
     FloorsList = floors;
     User       = new tblUser();
     Employee   = new tblEmployee();
 }
コード例 #19
0
        private void addEmployeeButton_Click(object sender, RoutedEventArgs e)
        {
            AddEmployee add = new AddEmployee();

            add.Owner = this;
            add.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            add.Show();
            add.AddEmployeeInstance(this);
        }
コード例 #20
0
        private void btEmployeeAdd_Click(object sender, EventArgs e)
        {
            var addEmployee = new AddEmployee(repository);

            if (addEmployee.Perform())
            {
                filteredEmployees = gridLoader.GetAndLoadWith(filterParameters);
            }
        }
コード例 #21
0
        public AddEmployeeViewModel(AddEmployee addEmployeeOpen, tblEmployee employeeEdit)
        {
            employee       = employeeEdit;
            addEmployee    = addEmployeeOpen;
            worker.DoWork += worker_DoWork;

            LocationList = service.GetAllLocations();
            //  ManagerList = service.GetAllManagers(Employee.JMBG);
        }
コード例 #22
0
 //poziva pri otvaranju prozora AddEmployee ali pri editovanju nekog employee
 public AddEmployeeViewModel(AddEmployee addEmployeeOpen, vwEmployee EmployeeEdit)
 {
     employee    = EmployeeEdit;
     addEmployee = addEmployeeOpen;
     edited      = true;
     using (Service1Client wcf = new Service1Client())
     {
         BossList = wcf.GetAllBoss(null).ToList();
     }
 }
コード例 #23
0
 public async Task Dispatch(EmployeeHired evt, Guid employeeId)
 {
     var command = new AddEmployee
     {
         Salary       = evt.Salary,
         EmployeeId   = employeeId,
         EmployeeName = evt.Name
     };
     await mediator.Send(command);
 }
コード例 #24
0
        //poziva pri otvaranju prozora AddEmployee pri dodavanju novih employee
        public AddEmployeeViewModel(AddEmployee addEmployeeOpen)
        {
            employee    = new vwEmployee();
            addEmployee = addEmployeeOpen;

            using (Service1Client wcf = new Service1Client())
            {
                BossList = wcf.GetAllBoss(null).ToList();
            }
        }
コード例 #25
0
        public ActionResult Add(AddEmployee addEmployee)
        {
            if (this.ModelState.IsValid)
            {
                addEmployee.ExecuteNonQuery();
                return(Redirect("/Settings/Employee"));
            }

            return(View("FormPage", addEmployee));
        }
コード例 #26
0
 /// <summary>
 /// Constructor with the add employee info window opening
 /// </summary>
 /// <param name="addEmployeeOpen">opends the add employee window</param>
 public AddUserViewModel(AddEmployee addEmployeeOpen)
 {
     employee            = new vwEmployee();
     addEmployee         = addEmployeeOpen;
     AllInfoEmployeeList = service.GetAllEmployeesInfo().ToList();
     ManagerList         = service.GetAllManagers().ToList();
     EmployeeList        = service.GetAllEmployees().ToList();
     FloorNumberList     = service.GetAllFloorNumbers().ToList();
     UserList            = service.GetAllUsers().ToList();
 }
コード例 #27
0
        void ShowEditEmployeePage()
        {
            AddEmployee empl = new AddEmployee();

            var empno = this.dgvEmployee.CurrentRow.Cells["EMPNUMBER"].Value.ToString();

            empl.PopulateControls(empno);


            empl.ShowDialog();
        }
コード例 #28
0
        private void DgvEmployee_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            AddEmployee empl = new AddEmployee();

            var empno = this.dgvEmployee.CurrentRow.Cells["EMPNUMBER"].Value.ToString();

            empl.PopulateControls(empno);


            empl.ShowDialog();
        }
コード例 #29
0
 public void adminAddemployer()
 {
     newEmployee = new AddEmployee(this);
     adminHW.adminMainPanel1.Controls.Clear();
     newEmployee.TopLevel   = false;
     newEmployee.AutoScroll = true;
     adminHW.TopLevel       = true;
     adminHW.adminMainPanel1.Controls.Add(newEmployee);
     newEmployee.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     newEmployee.Show();
 }
コード例 #30
0
 /// <summary>
 /// Constructor with the add employee info window opening
 /// </summary>
 /// <param name="addEmployeeOpen">opends the add employee window</param>
 public AddUserViewModel(AddEmployee addEmployeeOpen)
 {
     employee            = new vwEmployee();
     addEmployee         = addEmployeeOpen;
     AllInfoEmployeeList = service.GetAllEmployeesInfo().ToList();
     EmployeeList        = service.GetAllEmployees().ToList();
     UserList            = service.GetAllUsers().ToList();
     AllInfoManagerList  = service.GetAllManagersInfo().ToList();
     PositionList        = service.GetAllPosition().ToList();
     SectorList          = service.GetAllSectors().ToList();
 }
コード例 #31
0
ファイル: UserDao.cs プロジェクト: smirsingh02/idpro-1
        public string addUser(SqlConnection conn, SqlTransaction trans, User user)
        {
            ConnectionDao connectionDao = new ConnectionDao();
            string returnString = IdProConstants.SUCCESS;
            Employee objEmployee = new Employee();
            SqlCommand cmd = null;
            SqlDataReader rs = null;
            AddEmployee obj = new AddEmployee();
              UserServices userService = new UserServices();
            string query = "INSERT INTO Users([username],[password],[role]) VALUES(@UserName,@Password,@Role)";
            try
            {

                cmd = connectionDao.getSqlCommand(query, conn, trans);

                SqlParameter param1 = new SqlParameter();
                param1.ParameterName = "@UserName";
                //param1.Value = HttpContext.Current.Session["useremp"];
                param1.Value = user.Username;
                cmd.Parameters.Add(param1);

                SqlParameter param2 = new SqlParameter();
                param2.ParameterName = "@Password";
                //param2.Value = userService.getHashPassword(HttpContext.Current.Session["useremp"].ToString ());
                param2.Value = userService.getHashPassword(user.Password);
                cmd.Parameters.Add(param2);

                SqlParameter param3 = new SqlParameter();
                param3.ParameterName = "@Role";
                //param3.Value = HttpContext.Current.Session["rol"];

                param3.Value = user.Role ;
                cmd.Parameters.Add(param3);

                cmd.ExecuteScalar();

            }
            catch (Exception exception)
            {
                System.Diagnostics.Trace.WriteLine("[UserDAO:addUser] Exception " + exception.StackTrace);
                returnString = IdProConstants.FAIL;
            }
            finally
            {
                connectionDao.closeDabaseEntities(cmd, rs);
            }

            return returnString;
        }