public void delete( int id) { var db = new SQLiteConnection(dbPath); var newDepartments = new Departments(); newDepartments.Id = id; db.Delete(newDepartments); // db.Execute(""); }
public void Insert(string FullNamee) { var db = new SQLiteConnection(dbPath); var newDepartments = new Departments(); newDepartments.FullName = FullNamee; db.Insert(newDepartments); }
public Employee(int iD,string firstName,string lastName,Departments department,decimal salary) :base(iD,firstName,lastName) { this.Salary = salary; this.Department = department; }
public Developer(int p1, string p2, string p3, Departments departments, int p4, Projects.Project project) { // TODO: Complete member initialization this.p1 = p1; this.p2 = p2; this.p3 = p3; this.departments = departments; this.p4 = p4; this.project = project; }
public static Departments ModelToEnity(this DepartmentsModel model, bool virtualActive = false) { Departments entity = new Departments() { Name = model.Name, Id = model.Id, IsActive = model.IsActive }; if (virtualActive) { entity.GroupsOfEmployee = model.GroupsOfEmployee; } return entity; }
/// <summary> /// Gives All Departments /// </summary> /// <returns> List of Department Objects</returns> public List<Departments> GetAllDepartments() { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); DataSet ds; int i = 0; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetAllDepartments", SQLTextType.Stored_Proc); List<Departments> lstDepartment = new List<Departments>(); foreach (DataRow rows in ds.Tables[0].Rows) { Departments objDepartment = new Departments(); objDepartment.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objDepartment.Name = (ds.Tables[0].Rows[i][1]).ToString(); lstDepartment.Add(objDepartment); i++; } return lstDepartment; } }
public Employee(string id, string fn, string ln, double sal, Departments dep) : base(id, fn, ln) { this.Salary = sal; this.Department = dep; }
public Developer(string firstName, string lastName, int id, Departments department, decimal salary) : base(firstName, lastName, id, department, salary) { this.Projects = new List<IProject>(); }
public SalesEmployee(string id, string firstName, string lastName, decimal salary, Departments department) : base(id, firstName, lastName, salary, department) { }
public int Add(Departments _Department) { return(_DepartmentRepository.AddDepartment(_Department)); }
public List <Department> GetDepartments() { return(Departments.Where(a => a.IsDeleted == false).ToList()); }
public Manager(string firstName, string lastName, int id, Departments department, decimal salary) : base(firstName, lastName, id, department, salary) { this.EmployeesManaged = new List <IEmployee>(); }
private void ExcuteAppendPerson() { bool flag = false; if (Department != null && Department.DepartmentId != 0 && PersonName != "" && PersonName != null) { try { using (var db = new DataModel()) { if (db.Persons.Where(p => p.PersonName == PersonName).Count() > 0) { MessageBoxResult messageBoxResult = MessageBox.Show($"已经存在姓名为{PersonName}的人员,确定还要添加同名人员到部门:{Department.DepartmentName}中?" , "添加人员提示", MessageBoxButton.YesNo, MessageBoxImage.Information); if (messageBoxResult == MessageBoxResult.Yes) { Person person = new Person() { PersonName = PersonName, DepId = Department.DepartmentId }; db.Persons.Add(person); flag = true; db.SaveChanges(); } } else { MessageBoxResult messageBoxResult = MessageBox.Show($"添加姓名为{PersonName}的人员到部门:{Department.DepartmentName}中?" , "添加人员提示", MessageBoxButton.YesNo, MessageBoxImage.Information); if (messageBoxResult == MessageBoxResult.Yes) { Person person = new Person() { PersonName = PersonName, DepId = Department.DepartmentId }; db.Persons.Add(person); flag = true; db.SaveChanges(); } } } if (flag) { int tempid = 0; if (QueryDepartment != null) { tempid = QueryDepartment.DepartmentId; } Inital(); PersonName = ""; QueryDepartment = Departments.Where(d => d.DepartmentId == tempid).FirstOrDefault(); ExcuteCbChangeCommand(); } } catch (Exception) { } } else { MessageBox.Show($"请检查待添加人员信息是否正确" , "信息提示", MessageBoxButton.OK, MessageBoxImage.Information); } }
public Developer(int id, string firstName, string lastName, decimal salary, Departments department) : base(id, firstName, lastName, salary, department) { }
public Manager(uint id, string fname, string lname, uint salary, Departments deparment) : base(id, fname, lname, salary, deparment) { this.employees = new List<Employee>(); }
public Manager(string firstName, string lastName, int id, Departments department, decimal salary) : base(firstName, lastName, id, department, salary) { this.EmployeesManaged = new List<IEmployee>(); }
public Developer(string id, string firstName, string lastName, double salary, Departments departments, Project project) : base(id, firstName, lastName, salary, departments) { Project = project; }
public Developer(string firstName, string lastName, long id, decimal salary, Departments department,List<Project>projects) : base(firstName, lastName, id, salary, department) { this.Projects = projects; }
public RegularEmployee(string firstName, string lastName, long id, decimal salary, Departments department) : base(firstName, lastName, id, salary, department) { }
public bool deleteDepartment(Departments dep) { return(_departmentsRepository.deleteDepartment(dep.depId)); }
public Employee(string id, string firstName, string lastName, decimal salary, Departments department) : base(id, firstName, lastName) { this.Salary = salary; this.department = department; }
public Employee(long id, string firstName, string lastName, double salary, Departments department) : base(id, firstName, lastName) { this.Salary = salary; this.Department = department; }
private void Button_Click_1(object sender, RoutedEventArgs e) { var dep = context.DepartmentsBase.Where(s => s.Name == _event.Name) as Departments; var emp = context.EmployeesBase.Where(w => w.Name == _event.Employee) as Employees; var chief = context.EmployeesBase.Where(q => q.Name == _event.Chief) as Employees; if (dep != null) { if (emp != null) { dep.Employees.Add(emp); } else { var new_emp = new Employees() { Name = _event.Employee }; // context.EmployeesBase.Add(new_emp); dep.Employees.Add(new_emp); } if (chief != null) { dep.Chief = chief; } else { var new_chief = new Employees() { Name = _event.Chief }; context.EmployeesBase.Add(new_chief); dep.Chief = new_chief; } context.DepartmentsBase.Add(dep); } else { var new_dep = new Departments(); new_dep.Name = _event.Name; if (emp != null) { new_dep.Employees.Add(emp); } else { var new_emp = new Employees() { Name = _event.Employee }; // context.EmployeesBase.Add(new_emp); new_dep.Employees = new List <Employees>() { new_emp }; } if (chief != null) { new_dep.Chief = chief; } else { new_dep.Chief = emp; } context.DepartmentsBase.Add(new_dep); } context.SaveChanges(); MessageBox.Show("ADDED"); this.Close(); }
public Employee(string id, string firstName, string lastName, double salary, Departments departments) : base(id, firstName, lastName) { Salary = salary; Department = departments; }
public HttpResponseMessage AddDep([FromBody] Departments dep) => AddEntity(dep);
public RegularEmployee(string firstName, string lastName, int id, Departments department, decimal salary) : base(firstName, lastName, id, department, salary) { }
/// <summary> /// Find department with specified ID /// </summary> /// <param name="deptID">Department ID</param> /// <returns> /// Department with specified ID /// null if a department with such ID does not exist /// </returns> public IDepartmentDTO Department(uint deptID) { return(Departments.Find(d => d.DeptID == deptID)); }
public SalesEmployee(string firstName, string lastName, long id, decimal salary, Departments department,List<Sale>sales) : base(firstName, lastName, id, salary, department) { this.Sales = sales; }
public void InsertDepartment(Departments Department) { _dbContext.Add(Department); Save(); }
public Manager(string firstName, string lastName, long id, decimal salary, Departments department, List<Employee> employees) : base(firstName, lastName, id, salary, department) { this.Employees = employees; }
protected RegularEmployee(int iD,string firstName,string lastName,Departments department,decimal salary) : base(iD,firstName,lastName,department,salary) { }
public RegularEmployee(string id, string firstName, string lastName, double salary, Departments departments) : base(id, firstName, lastName, salary, departments) { }
public void Seed() { if (_context.Departments.Any() || _context.Seller.Any() || _context.SalesRecord.Any()) { return; // DB has been seeded } Departments d1 = new Departments(1, "Computers"); Departments d2 = new Departments(2, "Electronics"); Departments d3 = new Departments(3, "Fashion"); Departments d4 = new Departments(4, "Books"); Seller s1 = new Seller(1, "Bob Brown", "*****@*****.**", new DateTime(1998, 4, 21), 1000.0, d1); Seller s2 = new Seller(2, "Maria Green", "*****@*****.**", new DateTime(1979, 12, 31), 3500.0, d2); Seller s3 = new Seller(3, "Alex Grey", "*****@*****.**", new DateTime(1988, 1, 15), 2200.0, d1); Seller s4 = new Seller(4, "Martha Red", "*****@*****.**", new DateTime(1993, 11, 30), 3000.0, d4); Seller s5 = new Seller(5, "Donald Blue", "*****@*****.**", new DateTime(2000, 1, 9), 4000.0, d3); Seller s6 = new Seller(6, "Alex Pink", "*****@*****.**", new DateTime(1997, 3, 4), 3000.0, d2); SalesRecord r1 = new SalesRecord(1, new DateTime(2018, 09, 25), 11000.0, SaleStatus.Billed, s1); SalesRecord r2 = new SalesRecord(2, new DateTime(2018, 09, 4), 7000.0, SaleStatus.Billed, s5); SalesRecord r3 = new SalesRecord(3, new DateTime(2018, 09, 13), 4000.0, SaleStatus.Canceled, s4); SalesRecord r4 = new SalesRecord(4, new DateTime(2018, 09, 1), 8000.0, SaleStatus.Billed, s1); SalesRecord r5 = new SalesRecord(5, new DateTime(2018, 09, 21), 3000.0, SaleStatus.Billed, s3); SalesRecord r6 = new SalesRecord(6, new DateTime(2018, 09, 15), 2000.0, SaleStatus.Billed, s1); SalesRecord r7 = new SalesRecord(7, new DateTime(2018, 09, 28), 13000.0, SaleStatus.Billed, s2); SalesRecord r8 = new SalesRecord(8, new DateTime(2018, 09, 11), 4000.0, SaleStatus.Billed, s4); SalesRecord r9 = new SalesRecord(9, new DateTime(2018, 09, 14), 11000.0, SaleStatus.Pending, s6); SalesRecord r10 = new SalesRecord(10, new DateTime(2018, 09, 7), 9000.0, SaleStatus.Billed, s6); SalesRecord r11 = new SalesRecord(11, new DateTime(2018, 09, 13), 6000.0, SaleStatus.Billed, s2); SalesRecord r12 = new SalesRecord(12, new DateTime(2018, 09, 25), 7000.0, SaleStatus.Pending, s3); SalesRecord r13 = new SalesRecord(13, new DateTime(2018, 09, 29), 10000.0, SaleStatus.Billed, s4); SalesRecord r14 = new SalesRecord(14, new DateTime(2018, 09, 4), 3000.0, SaleStatus.Billed, s5); SalesRecord r15 = new SalesRecord(15, new DateTime(2018, 09, 12), 4000.0, SaleStatus.Billed, s1); SalesRecord r16 = new SalesRecord(16, new DateTime(2018, 10, 5), 2000.0, SaleStatus.Billed, s4); SalesRecord r17 = new SalesRecord(17, new DateTime(2018, 10, 1), 12000.0, SaleStatus.Billed, s1); SalesRecord r18 = new SalesRecord(18, new DateTime(2018, 10, 24), 6000.0, SaleStatus.Billed, s3); SalesRecord r19 = new SalesRecord(19, new DateTime(2018, 10, 22), 8000.0, SaleStatus.Billed, s5); SalesRecord r20 = new SalesRecord(20, new DateTime(2018, 10, 15), 8000.0, SaleStatus.Billed, s6); SalesRecord r21 = new SalesRecord(21, new DateTime(2018, 10, 17), 9000.0, SaleStatus.Billed, s2); SalesRecord r22 = new SalesRecord(22, new DateTime(2018, 10, 24), 4000.0, SaleStatus.Billed, s4); SalesRecord r23 = new SalesRecord(23, new DateTime(2018, 10, 19), 11000.0, SaleStatus.Canceled, s2); SalesRecord r24 = new SalesRecord(24, new DateTime(2018, 10, 12), 8000.0, SaleStatus.Billed, s5); SalesRecord r25 = new SalesRecord(25, new DateTime(2018, 10, 31), 7000.0, SaleStatus.Billed, s3); SalesRecord r26 = new SalesRecord(26, new DateTime(2018, 10, 6), 5000.0, SaleStatus.Billed, s4); SalesRecord r27 = new SalesRecord(27, new DateTime(2018, 10, 13), 9000.0, SaleStatus.Pending, s1); SalesRecord r28 = new SalesRecord(28, new DateTime(2018, 10, 7), 4000.0, SaleStatus.Billed, s3); SalesRecord r29 = new SalesRecord(29, new DateTime(2018, 10, 23), 12000.0, SaleStatus.Billed, s5); SalesRecord r30 = new SalesRecord(30, new DateTime(2018, 10, 12), 5000.0, SaleStatus.Billed, s2); _context.Departments.AddRange(d1, d2, d3, d4); _context.Seller.AddRange(s1, s2, s3, s4, s5, s6); _context.SalesRecord.AddRange( r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30 ); _context.SaveChanges(); }
public Developer(int id, string firstName, string lastName, double salary, Departments department, HashSet<Project> projects) : base(id, firstName, lastName, salary, department) { Projects = projects; }
/// <summary> /// Добавление ведомства в департамент-родитель /// </summary> /// <param name = "subdivision" > Ведомство </ param > public void AddDepartment(Department subdivision) { subdivision.ParentDepartment = this; Departments.Add(subdivision); }
public SalesEmployee(string id, string firstName, string lastName, double salary, Departments departments, Sale sale) : base(id, firstName, lastName, salary, departments) { Sale = sale; }
public Employee(Department EmployeeDepartment) { _employeeDepartment = EmployeeDepartment; }
public bool Update(Departments departments, int old_departmentId) { DepartmentsDAC departmentsComponent = new DepartmentsDAC(); return(departmentsComponent.UpdateDepartments(departments.OrganizationId, departments.DepartmentName, departments.DepartmentDescription, departments.Phone1, departments.Phone2, departments.Fax1, departments.Fax2, departments.AddressLine1, departments.AddressLine2, old_departmentId)); }
public int CountEmployees() => Departments.Sum(d => d.CountEmployees());
public List <Departments> SaveDepartment(Departments departments) { _context.Departments.Add(departments); _context.SaveChanges(); return(_context.Departments.ToList()); }
public override int GetHashCode() { unchecked { return(((Name != null ? Name.GetHashCode() : 0) * 397) ^ (Departments != null ? Departments.GetHashCode() : 0)); } }
public Developer(string id, string fn, string ln, double sal, Departments dep, List<Project> p) : base(id, fn, ln, sal, dep) { this.Projects = p; }
public RegularEmployee(string id, string fn, string ln, double sal, Departments dep) : base(id, fn, ln, sal, dep) { }
public void Create(Departments obj) { departmentRepository.Add(obj); }
public void SelectDepartment(string id) { SelectedDepartment = Departments.Find(d => d.Id == id); }
public void Update(Departments obj) { departmentRepository.Update(obj); }
private void UpdateSelectedDepartment() { ucDepartments1.txtDepartmentName.Text = Departments.GetInstance().departmentName; ucDepartments1.txtShiftId.Text = Departments.GetInstance().shiftId.ToString(); }
public void AddDepartment(Departments department) { _departmentRepository.Add(department); }
/// <summary> /// Returns root department of organization /// </summary> /// <returns>Root department</returns> public IDepartmentDTO RootDepartment() { BaseDepartment dept = Departments.Find(d => d.ParentDeptID == 0); return(dept); }
public void UpdateDepartment(Departments department) { _departmentRepository.Update(department); }
public decimal AlreadyExitName(Departments _Department) { return(_DepartmentRepository.AlreadyExitName(_Department)); }
public Manager(int id, string firstName, string lastName, Departments department, decimal salary, List <IEmployee> employeesManagers) : base(id, firstName, lastName, salary, department) { this.EmployeeManagers = employeesManagers; }
public SalesEmployee(int id, string firstname, string lastname, decimal salary, Departments department, IList <Sale> sales) : base(id, firstname, lastname, salary, department) { this.Sales = sales; }
public Manager(int id, string firstName, string lastName, Departments department, decimal salary, IEmployee employeeManagers) : this(id, firstName, lastName, department, salary, new List <IEmployee> { employeeManagers }) { }
public void UpdateDepartment(Departments Department) { _dbContext.Entry(Department).State = EntityState.Modified; Save(); }
public Employee(int id, string firstName, string lastName, decimal salary, Departments department) : base(id, firstName, lastName) { Salary = salary; Department = department; }
public Developer(int id, string firstName, string lastName, Departments department, decimal salary, IProject project) : this(id, firstName, lastName, department, salary, new List <IProject>() { project }) { }
public SalesEmployee(int id, string firstName, string lastName, double salary, Departments department, HashSet<Sale> sales) : base(id, firstName, lastName, salary, department) { this.Sales = sales; }
public Developer(int id, string firstName, string lastName, Departments department, decimal salary, List <IProject> projects) : base(id, firstName, lastName, department, salary) { this.Projects = projects; }
public Manager(long id, string firstName, string lastName, double salary, Departments department) : base(id, firstName, lastName, salary, department) { }