public ChangePasswordControl()
        {
            currentEmployee = Util.ValidateUser();
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);
        }
        public ChangePasswordControl()
        {
            currentEmployee = Util.ValidateUser();
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);
        }
コード例 #3
0
        public PurchaseOrderControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            InventoryEntities inventory = new InventoryEntities();

            supplierBroker      = new SupplierBroker(inventory);
            itemBroker          = new ItemBroker(inventory);
            purchaseOrderBroker = new PurchaseOrderBroker(inventory);
            itemPriceBroker     = new ItemPriceBroker(inventory);
            employeeBroker      = new EmployeeBroker(inventory);

            //reorderList = GetReorderItemList();
            purchaseOrder             = new PurchaseOrder();
            purchaseOrder.Id          = purchaseOrderBroker.GetPurchaseOrderId();
            purchaseOrder.CreatedBy   = Util.GetEmployee(employeeBroker);
            purchaseOrder.CreatedDate = DateTime.Now;
            purchaseOrder.Status      = Converter.objToInt(Constants.VISIBILITY_STATUS.SHOW);

            poDetailList  = new List <PurchaseOrderDetail>();
            addedItemList = new Dictionary <Item, List <double> >();
            //purchaseOrderDetailList = new System.Data.Objects.DataClasses.EntityCollection<PurchaseOrderDetail>();

            // need to load reorder quantity
            // need to load unfulfilled quantity
            supplierColumn = new DataColumn[] { new DataColumn(supplierColumnName[0]), new DataColumn(supplierColumnName[1]) };
            dataColumn     = new DataColumn[] { new DataColumn(columnName[0]),
                                                new DataColumn(columnName[1]),
                                                new DataColumn(columnName[2]),
                                                new DataColumn(columnName[3]),
                                                new DataColumn(columnName[4]) };
        }
        public PurchaseOrderControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            InventoryEntities inventory = new InventoryEntities();
            supplierBroker = new SupplierBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            purchaseOrderBroker = new PurchaseOrderBroker(inventory);
            itemPriceBroker = new ItemPriceBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            //reorderList = GetReorderItemList();
            purchaseOrder = new PurchaseOrder();
            purchaseOrder.Id = purchaseOrderBroker.GetPurchaseOrderId();
            purchaseOrder.CreatedBy = Util.GetEmployee(employeeBroker);
            purchaseOrder.CreatedDate = DateTime.Now;
            purchaseOrder.Status = Converter.objToInt(Constants.VISIBILITY_STATUS.SHOW);

            poDetailList = new List<PurchaseOrderDetail>();
            addedItemList = new Dictionary<Item, List<double>>();
            //purchaseOrderDetailList = new System.Data.Objects.DataClasses.EntityCollection<PurchaseOrderDetail>();

            // need to load reorder quantity
            // need to load unfulfilled quantity
            supplierColumn = new DataColumn[] { new DataColumn(supplierColumnName[0]), new DataColumn(supplierColumnName[1])};
            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4])};
        }
        private void init()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            inventory       = new InventoryEntities();

            retrievalBroker  = new RetrievalBroker(inventory);
            employeeBroker   = new EmployeeBroker(inventory);
            itemBroker       = new ItemBroker(inventory);
            departmentBroker = new DepartmentBroker(inventory);
        }
コード例 #6
0
 /// <summary>
 ///     Get an employee object from the current employee inside the session using the same context
 /// </summary>
 /// <param name="employeeBroker"></param>
 /// <returns></returns>
 public static Employee GetEmployee(IEmployeeBroker employeeBroker)
 {
     if (GetEmployee() != null)
     {
         Employee employee = new Employee();
         employee.Id = GetEmployee().Id;
         return(employeeBroker.GetEmployee(employee));
     }
     return(null);
 }
        /// <summary>
        ///     To show the Current Temporary Department Head
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public AssignTemporaryDepartmentHeadControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            temporaryDepartmentHead = new Employee();
            temporaryDepartmentHead.Role = new Role();
            temporaryDepartmentHead.Role.Id = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_HEAD);
            temporaryDepartmentHead.Department = currentEmployee.Department;

            temporaryDepartmentHead = employeeBroker.GetEmployee(temporaryDepartmentHead);
        }
        /// <summary>
        ///     To show the Current Temporary Department Head
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public AssignTemporaryDepartmentHeadControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            temporaryDepartmentHead            = new Employee();
            temporaryDepartmentHead.Role       = new Role();
            temporaryDepartmentHead.Role.Id    = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_HEAD);
            temporaryDepartmentHead.Department = currentEmployee.Department;

            temporaryDepartmentHead = employeeBroker.GetEmployee(temporaryDepartmentHead);
        }
コード例 #9
0
        /// <summary>
        ///     To get all the Employee with role name as "Temporary Department Representative"
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public AssignTemporaryDepartmentRepresentativeControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            temporaryDepartmentRepresentative      = new Employee();
            temporaryDepartmentRepresentative.Role = new Role();
            //  temporaryDepartmentRepresentative.Role.Id = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_REPRESENTATIVE);
            //  temporaryDepartmentRepresentative.Department = currentEmployee.Department;

            //  temporaryDepartmentRepresentative = employeeBroker.GetEmployee(temporaryDepartmentRepresentative);
        }
        /// <summary>
        ///     To get all the Employee with role name as "Temporary Department Representative"
        ///     Created By: SanLaPyaye 
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public AssignTemporaryDepartmentRepresentativeControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            temporaryDepartmentRepresentative = new Employee();
            temporaryDepartmentRepresentative.Role = new Role();
              //  temporaryDepartmentRepresentative.Role.Id = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_REPRESENTATIVE);
              //  temporaryDepartmentRepresentative.Department = currentEmployee.Department;

              //  temporaryDepartmentRepresentative = employeeBroker.GetEmployee(temporaryDepartmentRepresentative);
        }
        /// <summary>
        ///     The usage of this method is to show the Requisitions List.
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>

        public ApproveRejectRequisitionControl()
        {
            currentEmployee           = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            requisitionDetailsControl = new commonController.RequisitionDetailsControl();
            InventoryEntities inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            employeeBroker    = new EmployeeBroker(inventory);

            pendingRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.PENDING, currentEmployee.Department);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]) };
        }
        public ManageCollectionPointControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory = new InventoryEntities();

            collectionPointBroker = new CollectionPointBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            allCollectionPoint = collectionPointBroker.GetAllCollectionPoint();

            dataColumn = new DataColumn[] { new DataColumn(columnName[2]),
                                            new DataColumn(columnName[0]) };

            dataColumnList = new DataColumn[] { new DataColumn(columnName[2]),
                                                new DataColumn(columnName[0]),
                                                new DataColumn(columnName[1]) };
        }
        /// <summary>
        ///     The usage of this method is to show the Requisitions List.
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public ApproveRejectRequisitionControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            requisitionDetailsControl = new commonController.RequisitionDetailsControl();
            InventoryEntities inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            pendingRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.PENDING, currentEmployee.Department);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]) };
        }
コード例 #14
0
        public static Constants.DB_STATUS Assign(IEmployeeBroker employeeBroker, int employeeId, Constants.EMPLOYEE_ROLE role)
        {
            Constants.DB_STATUS status = Constants.DB_STATUS.UNKNOWN;

            Employee employee = new Employee();
            employee.Id = employeeId;
            employee = employeeBroker.GetEmployee(employee);

            Role assignRole = new Role();
            assignRole.Id = Converter.objToInt(role);
            assignRole = employeeBroker.GetRole(assignRole);
            employee.Role = assignRole;

            status = employeeBroker.Update(employee);

            return status;
        }
        public ReceiveOrderControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            InventoryEntities inventory = new InventoryEntities();

            purchaseOrderBroker = new PurchaseOrderBroker(inventory);
            itemBroker          = new ItemBroker(inventory);
            employeeBroker      = new EmployeeBroker(inventory);

            purchaseOrderList = purchaseOrderBroker.GetAllPurchaseOrder();

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]) };
            detailColumn = new DataColumn[] { new DataColumn(detail[0]),
                                              new DataColumn(detail[1]), new DataColumn(detail[2]), new DataColumn(detail[3]) };
        }
        public ManageCollectionPointControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory       = new InventoryEntities();

            collectionPointBroker = new CollectionPointBroker(inventory);
            employeeBroker        = new EmployeeBroker(inventory);

            allCollectionPoint = collectionPointBroker.GetAllCollectionPoint();

            dataColumn = new DataColumn[] { new DataColumn(columnName[2]),
                                            new DataColumn(columnName[0]) };

            dataColumnList = new DataColumn[] { new DataColumn(columnName[2]),
                                                new DataColumn(columnName[0]),
                                                new DataColumn(columnName[1]) };
        }
        public CreateStationeryRetrievalListControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            inventory = new InventoryEntities();

            retrievalBroker = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            //retrievalList = retrievalBroker.GetAllRetrieval();
            requisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(Constants.COLLECTION_STATUS.NEED_TO_RETRIEVE);

            collectionDataColumn = new DataColumn[] { new DataColumn(collectionColumnName[0]),
                                                      new DataColumn(collectionColumnName[1]),
                                                      new DataColumn(collectionColumnName[2]),
                                                      new DataColumn(collectionColumnName[3]) };
        }
        public CreateStationeryRetrievalListControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            inventory       = new InventoryEntities();

            retrievalBroker             = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            itemBroker     = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            //retrievalList = retrievalBroker.GetAllRetrieval();
            requisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(Constants.COLLECTION_STATUS.NEED_TO_RETRIEVE);

            collectionDataColumn = new DataColumn[] { new DataColumn(collectionColumnName[0]),
                                                      new DataColumn(collectionColumnName[1]),
                                                      new DataColumn(collectionColumnName[2]),
                                                      new DataColumn(collectionColumnName[3]) };
        }
        public UpdateStationeryRetrievalControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            inventory = new InventoryEntities();
            collectionMissedBroker      = new CollectionMissedBroker(inventory);
            employeeBroker              = new EmployeeBroker(inventory);
            retrievalBroker             = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);

            //collectionList = requisitionCollectionBroker.GetAllRequisitionCollection();

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]),
                                            new DataColumn(columnName[5]) };
        }
        public UpdateStationeryRetrievalControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            inventory = new InventoryEntities();
            collectionMissedBroker = new CollectionMissedBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);
            retrievalBroker = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);

            //collectionList = requisitionCollectionBroker.GetAllRequisitionCollection();

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]),
                                            new DataColumn(columnName[5]) };
        }
コード例 #21
0
        public static Constants.DB_STATUS Assign(IEmployeeBroker employeeBroker, int employeeId, Constants.EMPLOYEE_ROLE role)
        {
            Constants.DB_STATUS status = Constants.DB_STATUS.UNKNOWN;

            Employee employee = new Employee();

            employee.Id = employeeId;
            employee    = employeeBroker.GetEmployee(employee);

            Role assignRole = new Role();

            assignRole.Id = Converter.objToInt(role);
            assignRole    = employeeBroker.GetRole(assignRole);
            employee.Role = assignRole;

            status = employeeBroker.Update(employee);

            return(status);
        }
        public ReceiveOrderControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            InventoryEntities inventory = new InventoryEntities();

            purchaseOrderBroker = new PurchaseOrderBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            purchaseOrderList = purchaseOrderBroker.GetAllPurchaseOrder();

            dataColumn = new DataColumn[]{ new DataColumn(columnName[0]),
                                           new DataColumn(columnName[1])

                                          };
            detailColumn = new DataColumn[]{new DataColumn(detail[0]),
                new DataColumn(detail[1]),new DataColumn(detail[2]),new DataColumn(detail[3])};
        }
        public RequestStationeryControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.EMPLOYEE);
            InventoryEntities inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            itemBroker        = new ItemBroker(inventory);
            employeeBroker    = new EmployeeBroker(inventory);

            requisition            = new Requisition();
            requisition.CreatedBy  = Util.GetEmployee(employeeBroker);
            requisition.Department = requisition.CreatedBy.Department;
            requisition.Status     = Converter.objToInt(Constants.REQUISITION_STATUS.PENDING);
            requisition.Id         = requisitionBroker.GetRequisitionId(requisition);

            itemAdded = 0;

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]) };
        }
        public RequestStationeryControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.EMPLOYEE);
            InventoryEntities inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            requisition = new Requisition();
            requisition.CreatedBy = Util.GetEmployee(employeeBroker);
            requisition.Department = requisition.CreatedBy.Department;
            requisition.Status = Converter.objToInt(Constants.REQUISITION_STATUS.PENDING);
            requisition.Id = requisitionBroker.GetRequisitionId(requisition);

            itemAdded = 0;

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]) };
        }
        public SubmitRequestToStoreControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            Employee employee = new Employee();
            employee.Id = currentEmployee.Id;
            employee = employeeBroker.GetEmployee(employee);

            requisitionCollection = new RequisitionCollection(requisitionCollectionBroker.GetRequisitionCollectionId(), employee.Department, employee.Department.CollectionPoint, DateTime.Now, employee, Converter.objToInt(Constants.COLLECTION_STATUS.NEED_TO_COLLECT));

            approvedRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.APPROVED, currentEmployee.Department);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]) };
        }
        //private DataColumn[] collectionDataColumn; // for drop down list
        public GenerateDisbursementControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            inventory = new InventoryEntities();
            retrievalBroker = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            requisitionBroker = new RequisitionBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            retrievalList = retrievalBroker.GetAllRetrieval();

            requisitionCollectionList = new Dictionary<RequisitionCollection, DateTime>();

            dataColumn = new DataColumn[]{ new DataColumn(columnName[0]),
                                           new DataColumn(columnName[1]),
                                           new DataColumn(columnName[2]),
                                           new DataColumn(columnName[3]) };

            //collectionDataColumn = new DataColumn[] { new DataColumn(collectionColumnName[0]),
            //                                          new DataColumn(collectionColumnName[1]) };
        }
コード例 #27
0
        //private DataColumn[] collectionDataColumn; // for drop down list

        public GenerateDisbursementControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            inventory                   = new InventoryEntities();
            retrievalBroker             = new RetrievalBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            requisitionBroker           = new RequisitionBroker(inventory);
            employeeBroker              = new EmployeeBroker(inventory);

            retrievalList = retrievalBroker.GetAllRetrieval();

            requisitionCollectionList = new Dictionary <RequisitionCollection, DateTime>();

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]) };

            //collectionDataColumn = new DataColumn[] { new DataColumn(collectionColumnName[0]),
            //                                          new DataColumn(collectionColumnName[1]) };
        }
コード例 #28
0
        public SubmitRequestToStoreControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory       = new InventoryEntities();

            requisitionBroker           = new RequisitionBroker(inventory);
            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            Employee employee = new Employee();

            employee.Id = currentEmployee.Id;
            employee    = employeeBroker.GetEmployee(employee);

            requisitionCollection = new RequisitionCollection(requisitionCollectionBroker.GetRequisitionCollectionId(), employee.Department, employee.Department.CollectionPoint, DateTime.Now, employee, Converter.objToInt(Constants.COLLECTION_STATUS.NEED_TO_COLLECT));

            approvedRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.APPROVED, currentEmployee.Department);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]) };
        }
        /// <summary>
        ///     The usage of this method to call GetEmployee() for show the Current Department Representative
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>
        public AssignDepartmentRepresentativeControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            departmentRepresentative = currentEmployee.Department.Representative;

            temporaryDepartmentRepresentative = new Employee();
            temporaryDepartmentRepresentative.Role = new Role();
            temporaryDepartmentRepresentative.Role.Id = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_REPRESENTATIVE);
            temporaryDepartmentRepresentative.Department = currentEmployee.Department;

            temporaryDepartmentRepresentative = employeeBroker.GetEmployee(temporaryDepartmentRepresentative);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]) };

            employeeDataColumn = new DataColumn[] { new DataColumn(employeeColumnName[0]),
                                                    new DataColumn(employeeColumnName[1]) };
        }
コード例 #30
0
        /// <summary>
        ///     The usage of this method to call GetEmployee() for show the Current Department Representative
        ///     Created By: SanLaPyaye
        ///     Created Date: 25/01/2012
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        ///     Modified By:
        ///     Modified Date:
        ///     Modification Reason:
        /// </summary>

        public AssignDepartmentRepresentativeControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_HEAD);
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);

            departmentRepresentative = currentEmployee.Department.Representative;

            temporaryDepartmentRepresentative            = new Employee();
            temporaryDepartmentRepresentative.Role       = new Role();
            temporaryDepartmentRepresentative.Role.Id    = Converter.objToInt(Constants.EMPLOYEE_ROLE.TEMPORARY_DEPARTMENT_REPRESENTATIVE);
            temporaryDepartmentRepresentative.Department = currentEmployee.Department;

            temporaryDepartmentRepresentative = employeeBroker.GetEmployee(temporaryDepartmentRepresentative);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]) };

            employeeDataColumn = new DataColumn[] { new DataColumn(employeeColumnName[0]),
                                                    new DataColumn(employeeColumnName[1]) };
        }
        public UpdateCollectionDetailsByRequisitionItemControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory = new InventoryEntities();

            requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
            requisitionCollectionItemBroker = new RequisitionCollectionItemBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            requisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(currentEmployee.Department, Constants.COLLECTION_STATUS.NEED_TO_COLLECT);
            //collectedRequisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(currentEmployee.Department, Constants.COLLECTION_STATUS.COLLECTED);

            collectionListDataColumn = new DataColumn[] { new DataColumn(collectionListColumnName[0]),
                                                          new DataColumn(collectionListColumnName[1]),
                                                          new DataColumn(collectionListColumnName[2]),
                                                          new DataColumn(collectionListColumnName[3]),
                                                          new DataColumn(collectionListColumnName[4]) };

            itemDetailDataColumn = new DataColumn[] { new DataColumn(itemDetailColumnName[0]),
                                                             new DataColumn(itemDetailColumnName[1]),
                                                             new DataColumn(itemDetailColumnName[2]),
                                                             new DataColumn(itemDetailColumnName[3]) };
        }
        //private string[] columnName = new string[] { "RequisitionID", "requisitionDate", "RequisitionBy", "remarks" };
        public CheckRequisitionControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.EMPLOYEE);
            inventory = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);
            // itemBroker = new ItemBroker(inventory);

            //pendingRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.PENDING);

            // pendingRequisitionList = requisitionBroker.GetAllRequisitionByStatus(Util.GetEmployee().Id);

            pendingRequisitionList = requisitionBroker.GetAllRequisitionByEmployee(Util.GetEmployee().Id);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]) };

            //requisitionList = new System.Data.Objects.DataClasses.EntityCollection<Requisition>();
            //requisitionList = requisitionBroker.GetAllRequisition();
        }
コード例 #33
0
        //private string[] columnName = new string[] { "RequisitionID", "requisitionDate", "RequisitionBy", "remarks" };

        public CheckRequisitionControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.EMPLOYEE);
            inventory       = new InventoryEntities();

            requisitionBroker = new RequisitionBroker(inventory);
            employeeBroker    = new EmployeeBroker(inventory);
            // itemBroker = new ItemBroker(inventory);

            //pendingRequisitionList = requisitionBroker.GetAllRequisition(Constants.REQUISITION_STATUS.PENDING);

            // pendingRequisitionList = requisitionBroker.GetAllRequisitionByStatus(Util.GetEmployee().Id);

            pendingRequisitionList = requisitionBroker.GetAllRequisitionByEmployee(Util.GetEmployee().Id);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3]),
                                            new DataColumn(columnName[4]) };

            //requisitionList = new System.Data.Objects.DataClasses.EntityCollection<Requisition>();
            //requisitionList = requisitionBroker.GetAllRequisition();
        }
        public UpdateCollectionDetailsByRequisitionItemControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.DEPARTMENT_REPRESENTATIVE);
            inventory       = new InventoryEntities();

            requisitionCollectionBroker     = new RequisitionCollectionBroker(inventory);
            requisitionCollectionItemBroker = new RequisitionCollectionItemBroker(inventory);
            itemBroker     = new ItemBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);

            requisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(currentEmployee.Department, Constants.COLLECTION_STATUS.NEED_TO_COLLECT);
            //collectedRequisitionCollectionList = requisitionCollectionBroker.GetAllRequisitionCollection(currentEmployee.Department, Constants.COLLECTION_STATUS.COLLECTED);

            collectionListDataColumn = new DataColumn[] { new DataColumn(collectionListColumnName[0]),
                                                          new DataColumn(collectionListColumnName[1]),
                                                          new DataColumn(collectionListColumnName[2]),
                                                          new DataColumn(collectionListColumnName[3]),
                                                          new DataColumn(collectionListColumnName[4]) };

            itemDetailDataColumn = new DataColumn[] { new DataColumn(itemDetailColumnName[0]),
                                                      new DataColumn(itemDetailColumnName[1]),
                                                      new DataColumn(itemDetailColumnName[2]),
                                                      new DataColumn(itemDetailColumnName[3]) };
        }
        private void init()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            inventory = new InventoryEntities();

            retrievalBroker = new RetrievalBroker(inventory);
            employeeBroker = new EmployeeBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            departmentBroker = new DepartmentBroker(inventory);
        }
コード例 #36
0
        public LoginControl()
        {
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);
        }
コード例 #37
0
 /// <summary>
 ///     Get an employee object from the current employee inside the session using the same context
 /// </summary>
 /// <param name="employeeBroker"></param>
 /// <returns></returns>
 public static Employee GetEmployee(IEmployeeBroker employeeBroker)
 {
     if (GetEmployee() != null)
     {
         Employee employee = new Employee();
         employee.Id = GetEmployee().Id;
         return employeeBroker.GetEmployee(employee);
     }
     return null;
 }
コード例 #38
0
        public LoginControl()
        {
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);
        }