コード例 #1
0
    public Boolean insertApplication(string applayDate, string name, string sex, string address, string birthDate, string education, string source, string state, string comment, double salary, int workHours, int mobilePhone, int phone, int familyPhone, string nationalID, byte[] image)
    {
        application   = new ApplicationForm();
        applicationDB = new ApplicationDB();
        sourceControl = new SourceControl();

        application.setName(name);
        application.setApplayDate(applayDate);
        application.setSex(sex);
        application.setAddress(address);
        application.setBirthDate(birthDate);
        application.setEducation(education);
        application.setSource(sourceControl.selectID(source));
        application.setState(state);
        application.setComment(comment);
        application.setSalary(salary);
        application.setWorkHours(workHours);
        application.setMobilePhone(mobilePhone);
        application.setPhone(phone);
        application.setFamilyPhone(familyPhone);
        application.setNationalID(nationalID);
        application.setImage(image);
        check = applicationDB.checkApplication(application);
        if (check == true)
        {
            return(false);
        }
        else
        {
            applicationDB.insert(application);
            return(true);
        }
    }
コード例 #2
0
    public void fillListViewForEvaluation(ListView listView, string sourceName, string dateFrom, string dateTo)
    {
        listView.Items.Clear();
        locationControl = new LocationControl();
        sourceControl   = new SourceControl();
        employee        = new Employee();
        employeeDB      = new EmployeeDB();
        connection      = new DBConnection();
        int sourceID = sourceControl.selectID(sourceName);

        employee.setSourceID(sourceID);
        employee.setDateFrom(dateFrom);
        employee.setDateTo(dateTo);
        SqlDataReader reader = employeeDB.fillListViewRelatedToSource(employee);

        while (reader.Read())
        {
            ListViewItem lvi = new ListViewItem(reader["ID"].ToString());
            lvi.SubItems.Add(reader["name"].ToString());
            lvi.SubItems.Add(reader["position"].ToString());
            int    locationID   = int.Parse(reader["locationID"].ToString());
            string locationName = locationControl.getLocationName(locationID);
            lvi.SubItems.Add(locationName);
            listView.Items.Add(lvi);
        }
        connection.close();
    }
コード例 #3
0
    public int countEmployeeNumbersRelatedToSource(string sourceName, string dateFrom, string dateTo)
    {
        sourceControl = new SourceControl();
        employee      = new Employee();
        employeeDB    = new EmployeeDB();
        int sourceID = sourceControl.selectID(sourceName);

        employee.setSourceID(sourceID);
        employee.setDateFrom(dateFrom);
        employee.setDateTo(dateTo);
        employeeDB.countEmployeeNumbersRelatedToSource(employee);
        return(employee.getNumberOfEmployee());
    }
コード例 #4
0
    public void insertEmployee(string nationalID, string employeeName, string date, string position, double salary, string locationName, string sourceName)
    {
        employee        = new Employee();
        employeeDB      = new EmployeeDB();
        locationControl = new LocationControl();
        sourceControl   = new SourceControl();
        employee.setNationalID(nationalID);
        employee.setName(employeeName);
        employee.setEmployDate(date);
        employee.setPosition(position);
        employee.setSalary(salary);
        int locationID = locationControl.getEmployeeLocationID(locationName);
        int sourceID   = sourceControl.selectID(sourceName);

        employee.setLocationID(locationID);
        employee.setSourceID(sourceID);
        employeeDB.insertEmployee(employee);
    }