public Order_Edit(ICustomerData customerData, IEmployeeData employeeData, IStatusData statusData, Order order) { Order = order; Customers = customerData.GetAll(); Employees = employeeData.GetAll(); Statuses = statusData.GetAll(); }
public Order_Edit(ICustomerData customerDb, IEmployeeData employeeDb, IStatusData statusDb, IOrderData orderDb, int id) : this(customerDb, employeeDb, statusDb, orderDb.Get(id)) { if (Order == null) { throw new NotFoundInDatabaseException(); } }
public OrderController(ICustomerData customerDb, IEmployeeData employeeDb, IImageData imageListDb, IOrderData orderDb, IPartData partDb, IOrderPartData OrderPartDb, IStatusData statusDb) { this.customerDb = customerDb; this.employeeDb = employeeDb; this.imageListDb = imageListDb; this.orderDb = orderDb; this.partDb = partDb; this.OrderPartDb = OrderPartDb; this.statusDb = statusDb; }
public Employee_Returner(IEmployeeData data, int employeeId) { Employee employee = data.Get(employeeId); if (employee == null) { throw new NotFoundInDatabaseException(); } Name = employee.Name; PayPerHour = ("" + employee.PayPerHour).Replace(",", "."); }
public MainViewModel(IEmployeeData _employeeData, TaskManager taskManager) { EmployeeData = _employeeData; TaskManager = taskManager; PayStartDate = DateTime.Now.StartOfWeek(DayOfWeek.Sunday).ToShortDateString(); PayEndDate = DateTime.Now.StartOfWeek(DayOfWeek.Sunday).AddDays(13).ToShortDateString(); TaskManager.RunInBackground(() => { AllEmployees = EmployeeData.GetAllEmployees().OrderBy(x => x.EmployeeNumber).ToList(); BuildUI(); }); }
public Order_Detail(IEmployeeData employeeData, ICustomerData customerData, IStatusData statusData, IOrderData orderData, int orderId) : base() { Order order = orderData.Get(orderId); if (order == null) { throw new NotFoundInDatabaseException(); } Employee employee = employeeData.Get(order.EmployeeId); IEnumerable <Status> statuses = statusData.GetAll(); Construtor(employee, customerData, statuses, order); }
/// <summary> /// Validates the input employee for save /// </summary> /// <param name="employee"></param> /// <returns></returns> public IList <string> GetErrors(IEmployeeData employee) { var errors = new List <string>(); if (employee.FirstName == null || employee.FirstName.Trim() == "" || employee.LastName == null || employee.LastName.Trim() == "") { errors.Add(Resources.Employee.NameRequiredError); } if (employee.Dependents != null && employee.Dependents.Any(d => d.FirstName == null || d.FirstName.Trim() == "" || d.LastName == null || d.LastName.Trim() == "")) { errors.Add(Resources.Employee.DependentNameRequiredError); } return(errors); }
public StockType(IEmployeeData _employeeData, IStockProductData _stockProductData, IStockWineData _stockWineData) { Field(_ => _.Id); Field(_ => _.Quantity); Field(_ => _.Warehouse); Field(_ => _.EmployeeId); Field(_ => _.EntryDate); Field <EmployeeType>( "employee", resolve: context => _employeeData.GetAsync(context.Source.EmployeeId)); Field <ListGraphType <StockProductType> >( "stockProduct", resolve: context => _stockProductData.GetProductsAsync(context.Source.Id)); Field <ListGraphType <StockWineType> >( "stockWine", resolve: context => _stockWineData.GetWinesAsync(context.Source.Id)); }
/// <summary> /// Creates a new Employee object using input data /// </summary> /// <param name="data">Employee related data</param> /// <returns>The newly created Employee object</returns> public async Task <int> Create(IEmployeeData data) { var newEmployee = new Employee { FirstName = data.FirstName, LastName = data.LastName }; if (data.Dependents != null) { newEmployee.Dependents = data.Dependents.Select(d => new Dependent { FirstName = d.FirstName, LastName = d.LastName }).ToList(); } _dbContext.Employees.Add(newEmployee); await _dbContext.SaveChangesAsync(); return(newEmployee.EmployeeId); }
public StepType(IEmployeeData _employeeData, ITaskData _taskData, IProductData _productData) { Field(_ => _.Id); Field(_ => _.Desc); Field(_ => _.Status); Field(_ => _.Quantity); Field(_ => _.StartedAt); Field(_ => _.EndedAt); Field(_ => _.EmployeeId); Field(_ => _.TaskId); // Field(_ => _.ProductId); Field <EmployeeType>( "employee", resolve: context => _employeeData.GetAsync(context.Source.EmployeeId)); Field <TaskType>( "task", resolve: context => _taskData.GetAsync(context.Source.TaskId)); // Field<ProductType>( // "product", // resolve: context => _productData.GetAsync(context.Source.ProductId)); }
public Order_FullDetails(ICustomerData customerData, IEmployeeData employeeData, IImageData imageData, IOrderData orderData, IPartData partData, IOrderPartData OrderPartData, IStatusData statusData, int orderId) { Order order = orderData.Get(orderId); if (order == null) { throw new NotFoundInDatabaseException(); } Employee employee = employeeData.Get(order.EmployeeId); Details = new Order_Detail(employee, customerData, statusData, order); this.OrderParts = new List <OrderPart_Detail>(); EmployeePayPerHour = employee.PayPerHour; IEnumerable <OrderPart> OrderParts = OrderPartData.Get(orderId); foreach (OrderPart OrderPart in OrderParts) { OrderPart_Detail newDetail = new OrderPart_Detail(partData, OrderPart); this.OrderParts = this.OrderParts.Concat(new[] { newDetail }); } Images = imageData.GetOrderImages(orderId); }
public Entities.Concrete.Employee.Employee GetEmployeeByCompanyID(long prmCompanyID) { IEmployeeData employeeData = FactoryData.CreateEmployeeData(); return(employeeData.GetEmployeeByCompanyID(prmCompanyID)); }
public List <Entities.Concrete.Employee.Employee> GetAllEmployees() { IEmployeeData employeeData = FactoryData.CreateEmployeeData(); return(employeeData.GetAllEmployees()); }
public EmployeesApiController(IEmployeeData employeeData) { _employeeData = employeeData ?? throw new ArgumentNullException(nameof(employeeData)); }
public EmployeeService() { _dataLayer = new EmployeeData(); }
public GetAllEmployeeService(IEmployeeData EmployeeData) { this.EmployeeData = EmployeeData; }
public EmployeeController(IEmployeeData db) { this.db = db; }
public bool DeleteEmployee(long prmCompanyID) { IEmployeeData employeeData = FactoryData.CreateEmployeeData(); return(employeeData.DeleteEmployee(prmCompanyID)); }
public bool UpdateEmployee(Entities.Concrete.Employee.Employee prmEmployee) { IEmployeeData employeeData = FactoryData.CreateEmployeeData(); return(employeeData.UpdateEmployee(prmEmployee)); }
public EmployeeOrderingService(IEmployeeData dataProvider) { this._dataProvider = dataProvider; }
public bool ValidateEmployee(long prmCompanyID, string prmUserName, bool prmIsUpdated) { IEmployeeData employeeData = FactoryData.CreateEmployeeData(); return(employeeData.ValidateEmployee(prmCompanyID, prmUserName, prmIsUpdated)); }
public EmployeeOperations(IEmployeeData employeeData) { _employeeData = employeeData; }
public EmployeeController(IMapper mapper, IEmployeeData repository) { _mapper = mapper; _repository = repository; }
public RootQuery(IEmployeeData _employeeData, IRoleData _roleData, IPermissionData _permissionData, ITaskData _taskData, ICategoryData _categoryData, IStockData _stockData, IStepData _stepData, IWineData _wineData, IProductData _productData) { //EMPLOYEES Field <ListGraphType <EmployeeType> >("employees", resolve: context => { return(_employeeData.GetAllAsync()); }); Field <EmployeeType>("employee", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_employeeData.GetAsync(id)); }); Field <EmployeeType>("employeeEmail", arguments: new QueryArguments { new QueryArgument <StringGraphType> { Name = "email" }, new QueryArgument <StringGraphType> { Name = "password" } }, resolve: context => { string email = context.GetArgument <string>("email"); string password = context.GetArgument <string>("password"); return(_employeeData.GetByEmailPasswordAsync(email, password)); }); //ROLES Field <ListGraphType <RoleType> >("roles", resolve: context => { return(_roleData.GetAllAsync()); }); Field <RoleType>("role", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_roleData.GetAsync(id)); }); //PERMISSIONS Field <ListGraphType <PermissionType> >("permissions", resolve: context => { return(_permissionData.GetAllAsync()); }); Field <PermissionType>("permission", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_permissionData.GetAsync(id)); }); // TASKS Field <ListGraphType <TaskType> >("tasks", resolve: context => { return(_taskData.GetAllAsync()); }); Field <TaskType>("task", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_taskData.GetAsync(id)); }); // CATEGORIES Field <ListGraphType <CategoryType> >("categories", resolve: context => { return(_categoryData.GetAllAsync()); }); Field <CategoryType>("category", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_categoryData.GetAsync(id)); }); // STOCKS Field <ListGraphType <StockType> >("stocks", resolve: context => { return(_stockData.GetAllAsync()); }); Field <StockType>("stock", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { // try{ int id = context.GetArgument <int>("id"); Console.WriteLine("entrou"); return(_stockData.GetAsync(id)); // } catch (Exception error) { // Console.WriteLine(error); // return null; // } }); // STEPS Field <ListGraphType <StepType> >("steps", resolve: context => { return(_stepData.GetAllAsync()); }); Field <StepType>("step", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_stepData.GetAsync(id)); }); // WINES Field <ListGraphType <WineType> >("wines", resolve: context => { return(_wineData.GetAllAsync()); }); Field <WineType>("wine", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_wineData.GetAsync(id)); }); // PRODUCTS Field <ListGraphType <ProductType> >("products", resolve: context => { return(_productData.GetAllAsync()); }); Field <ProductType>("product", arguments: new QueryArguments { new QueryArgument <IntGraphType> { Name = "id" } }, resolve: context => { int id = context.GetArgument <int>("id"); return(_productData.GetAsync(id)); }); }
public HomeController(IEmployeeData restaurantData) { _employeeDataData = restaurantData; }
// public RootMutation(IWineData wineData) // { // Field<WineType>( // "addWine", // arguments: new QueryArguments // { // new QueryArgument<InputWineType>(){ Name = "wine"} // }, // resolve: context => // { // var wine = context.GetArgument<Wine>("wine"); // wineData.AddWine(wine); // return null; // } // ); // } public RootMutation(IEmployeeData employeeData, IRoleData roleData, IPermissionData permissionData, ITaskData taskData, ICategoryData categoryData, IStockData stockData, IStepData stepData, IWineData wineData, IProductData productData, IStockProductData stockProductData, IStockWineData stockWineData) { // EMPLOYEE Field <EmployeeType>( "addEmployee", arguments: new QueryArguments { new QueryArgument <InputEmployeeType>() { Name = "employee" } }, resolve: context => { var employee = context.GetArgument <Employee>("employee"); return(employeeData.AddEmployee(employee)); } ); Field <EmployeeType>( "updateEmployee", arguments: new QueryArguments { new QueryArgument <InputEmployeeType>() { Name = "employee" } }, resolve: context => { var employee = context.GetArgument <Employee>("employee"); return(employeeData.Update(employee)); } ); Field <EmployeeType>( "deleteEmployee", arguments: new QueryArguments { new QueryArgument <InputEmployeeType>() { Name = "employee" } }, resolve: context => { var employee = context.GetArgument <Employee>("employee"); employeeData.Delete(employee); return(employee); } ); // ROLE Field <RoleType>( "addRole", arguments: new QueryArguments { new QueryArgument <InputRoleType>() { Name = "role" } }, resolve: context => { var role = context.GetArgument <Role>("role"); return(roleData.AddRole(role)); } ); Field <RoleType>( "updateRole", arguments: new QueryArguments { new QueryArgument <InputRoleType>() { Name = "role" } }, resolve: context => { var role = context.GetArgument <Role>("role"); return(roleData.Update(role)); } ); Field <RoleType>( "deleteRole", arguments: new QueryArguments { new QueryArgument <InputRoleType>() { Name = "role" } }, resolve: context => { var role = context.GetArgument <Role>("role"); roleData.Delete(role); return(role); } ); // PERMISSION Field <PermissionType>( "addPermission", arguments: new QueryArguments { new QueryArgument <InputPermissionType>() { Name = "permission" } }, resolve: context => { var permission = context.GetArgument <Permission>("permission"); return(permissionData.AddPermission(permission)); } ); Field <PermissionType>( "updatePermission", arguments: new QueryArguments { new QueryArgument <InputPermissionType>() { Name = "permission" } }, resolve: context => { var permission = context.GetArgument <Permission>("permission"); return(permissionData.Update(permission)); } ); Field <PermissionType>( "deletePermission", arguments: new QueryArguments { new QueryArgument <InputPermissionType>() { Name = "permission" } }, resolve: context => { var permission = context.GetArgument <Permission>("permission"); permissionData.Delete(permission); return(permission); } ); // TASK Field <TaskType>( "addTask", arguments: new QueryArguments { new QueryArgument <InputTaskType>() { Name = "task" } }, resolve: context => { var task = context.GetArgument <Task>("task"); return(taskData.AddTask(task)); } ); Field <TaskType>( "updateTask", arguments: new QueryArguments { new QueryArgument <InputTaskType>() { Name = "task" } }, resolve: context => { var task = context.GetArgument <Task>("task"); return(taskData.Update(task)); } ); Field <TaskType>( "deleteTask", arguments: new QueryArguments { new QueryArgument <InputTaskType>() { Name = "task" } }, resolve: context => { var task = context.GetArgument <Task>("task"); taskData.Delete(task); return(task); } ); // CATEGORY Field <CategoryType>( "addCategory", arguments: new QueryArguments { new QueryArgument <InputCategoryType>() { Name = "category" } }, resolve: context => { var category = context.GetArgument <Category>("category"); return(categoryData.AddCategory(category)); } ); Field <CategoryType>( "updateCategory", arguments: new QueryArguments { new QueryArgument <InputCategoryType>() { Name = "category" } }, resolve: context => { var category = context.GetArgument <Category>("category"); return(categoryData.Update(category)); } ); Field <CategoryType>( "deleteCategory", arguments: new QueryArguments { new QueryArgument <InputCategoryType>() { Name = "category" } }, resolve: context => { var category = context.GetArgument <Category>("category"); categoryData.Delete(category); return(category); } ); // STOCK Field <StockType>( "addStock", arguments: new QueryArguments { new QueryArgument <InputStockType>() { Name = "stock" } }, resolve: context => { var stock = context.GetArgument <Stock>("stock"); return(stockData.AddStock(stock)); } ); Field <StockType>( "updateStock", arguments: new QueryArguments { new QueryArgument <InputStockType>() { Name = "stock" } }, resolve: context => { var stock = context.GetArgument <Stock>("stock"); return(stockData.Update(stock)); } ); Field <StockType>( "deleteStock", arguments: new QueryArguments { new QueryArgument <InputStockType>() { Name = "stock" } }, resolve: context => { var stock = context.GetArgument <Stock>("stock"); stockData.Delete(stock); return(stock); } ); // STEP Field <StepType>( "addStep", arguments: new QueryArguments { new QueryArgument <InputStepType>() { Name = "step" } }, resolve: context => { var step = context.GetArgument <Step>("step"); return(stepData.AddStep(step)); } ); Field <StepType>( "updateStep", arguments: new QueryArguments { new QueryArgument <InputStepType>() { Name = "step" } }, resolve: context => { var step = context.GetArgument <Step>("step"); return(stepData.Update(step)); } ); Field <StepType>( "deleteStep", arguments: new QueryArguments { new QueryArgument <InputStepType>() { Name = "step" } }, resolve: context => { var step = context.GetArgument <Step>("step"); stepData.Delete(step); return(step); } ); // WINE Field <WineType>( "addWine", arguments: new QueryArguments { new QueryArgument <InputWineType>() { Name = "wine" } }, resolve: context => { var wine = context.GetArgument <Wine>("wine"); return(wineData.AddWine(wine)); } ); Field <WineType>( "updateWine", arguments: new QueryArguments { new QueryArgument <InputWineType>() { Name = "wine" } }, resolve: context => { var wine = context.GetArgument <Wine>("wine"); return(wineData.Update(wine)); } ); Field <WineType>( "deleteWine", arguments: new QueryArguments { new QueryArgument <InputWineType>() { Name = "wine" } }, resolve: context => { var wine = context.GetArgument <Wine>("wine"); wineData.Delete(wine); return(wine); } ); // PRODUCT Field <ProductType>( "addProduct", arguments: new QueryArguments { new QueryArgument <InputProductType>() { Name = "product" } }, resolve: context => { var product = context.GetArgument <Product>("product"); return(productData.AddProduct(product)); } ); Field <ProductType>( "updateProduct", arguments: new QueryArguments { new QueryArgument <InputProductType>() { Name = "product" } }, resolve: context => { var product = context.GetArgument <Product>("product"); return(productData.Update(product)); } ); Field <ProductType>( "deleteProduct", arguments: new QueryArguments { new QueryArgument <InputProductType>() { Name = "product" } }, resolve: context => { var product = context.GetArgument <Product>("product"); productData.Delete(product); return(product); } ); // StockProduct Field <StockProductType>( "addStockProduct", arguments: new QueryArguments { new QueryArgument <InputStockProductType>() { Name = "stockProduct" } }, resolve: context => { var stockProduct = context.GetArgument <StockProduct>("stockProduct"); return(stockProductData.AddStockProduct(stockProduct)); } ); Field <StockProductType>( "updateStockProduct", arguments: new QueryArguments { new QueryArgument <InputStockProductType>() { Name = "stockProduct" } }, resolve: context => { var stockProduct = context.GetArgument <StockProduct>("stockProduct"); return(stockProductData.Update(stockProduct)); } ); Field <StockProductType>( "deleteStockProduct", arguments: new QueryArguments { new QueryArgument <InputStockProductType>() { Name = "stockProduct" } }, resolve: context => { var stockProduct = context.GetArgument <StockProduct>("stockProduct"); stockProductData.Delete(stockProduct); return(stockProduct); } ); // StockWine Field <StockWineType>( "addStockWine", arguments: new QueryArguments { new QueryArgument <InputStockWineType>() { Name = "stockWine" } }, resolve: context => { var stockWine = context.GetArgument <StockWine>("stockWine"); return(stockWineData.AddStockWine(stockWine)); } ); Field <StockWineType>( "updateStockWine", arguments: new QueryArguments { new QueryArgument <InputStockWineType>() { Name = "stockWine" } }, resolve: context => { var stockWine = context.GetArgument <StockWine>("stockWine"); return(stockWineData.Update(stockWine)); } ); Field <StockWineType>( "deleteStockWine", arguments: new QueryArguments { new QueryArgument <InputStockWineType>() { Name = "stockWine" } }, resolve: context => { var stockWine = context.GetArgument <StockWine>("stockWine"); stockWineData.Delete(stockWine); return(stockWine); } ); }
public EmployeeManager(IEmployeeData _employeeData) { employeeData = _employeeData; }
public EmployeeController(IEmployeeData employeeService) { _employeeService = employeeService; }
public EmployeeBusiness() { _EmployeesData = new EmployeeData(); }
public EmployeeController(IEmployeeData employeeData) { employeeData1 = employeeData; }
public EmployeeController(IEmployeeData employeeData) { _employeeData = employeeData; }
public EmployeeController(IEmployeeData employeeData, IDepartmentData departmentData) { _employeeData = employeeData; _departmentData = departmentData; }