public CreateDiscrepencyReportControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);
            inventory = new InventoryEntities();

            discrepancyBroker = new DiscrepancyBroker(inventory);
            itemBroker = new ItemBroker(inventory);
            item = new Item();
            itemPriceBroker = new ItemPriceBroker(inventory);
            itemprice = new ItemPrice();

            discrepancy = new Discrepancy();
            discrepancy.Id = discrepancyBroker.GetDiscrepancyId();
            discrepancy.CreatedDate = DateTime.Now;
            discrepancy.CreatedBy = Util.GetEmployee(new EmployeeBroker(inventory));
            discrepancy.Status = Converter.objToInt(Constants.VISIBILITY_STATUS.SHOW);
               // discrepancyDetailList = new System.Data.Objects.DataClasses.EntityCollection<DiscrepancyDetail>();

            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 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 CollectionPoint(int id, String name, TimeSpan time, Employee clerk)
 {
     this.Id = id;
     this.Name = name;
     this.Time = time;
     this.Clerk = clerk;
 }
        public Constants.ACTION_STATUS SelectLogin(string username, string password)
        {
            Constants.ACTION_STATUS isLogin = Constants.ACTION_STATUS.UNKNOWN;

            User user = new User();
            user.UserName = username;
            user.Password = password;
            user = employeeBroker.GetUser(user); // get user object

            // if user is null means username and password is incorrect
            if (user != null)
            {
                Employee employee = new Employee();
                employee.User = user;
                employee = employeeBroker.GetEmployee(employee);

                Util.SetEmployee(employee); // put employee object to session for validating user later
                Util.PutSession("Uname", employee.Name);

                isLogin = Constants.ACTION_STATUS.SUCCESS;
            }
            else
            {
                isLogin = Constants.ACTION_STATUS.FAIL;
            }
            return isLogin;
        }
 public Discrepancy(int id, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public Retrieval(int id, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
        public ChangePasswordControl()
        {
            currentEmployee = Util.ValidateUser();
            InventoryEntities inventory = new InventoryEntities();

            employeeBroker = new EmployeeBroker(inventory);
        }
 public StockAdjustment(string id, Discrepancy disId, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.Discrepancy = disId;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public ItemPrice(string itemId, string supplierId, decimal price, DateTime createdDate, Employee createdBy, int status)
 {
     this.ItemId = itemId;
     this.SupplierId = supplierId;
     this.Price = price;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
 }
 public Role(int id, string name, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.Name = name;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public CollectionMissed(int id, Department departmentId, Employee createdBy, DateTime createdDate, int status)
 {
     this.Id = id;
     this.Department = departmentId;
     this.CreatedBy = createdBy;
     this.CreatedDate = createdDate;
     this.Status = status;
 }
 public RequisitionDetailsControl()
 {
     currentEmployee = Util.ValidateUser();
     InventoryEntities inventory = new InventoryEntities();
     requisitionBroker = new RequisitionBroker(inventory);
     requisitionCollectionBroker = new RequisitionCollectionBroker(inventory);
     RequisitionList = requisitionBroker.GetAllRequisition(currentEmployee.Department);
 }
 public Notification(int id, Employee employeeId, string message, DateTime createdDate, int status)
 {
     this.Id = id;
     this.Employee = employeeId;
     this.Message = message;
     this.CreatedDate = createdDate;
     this.Status = status;
 }
 public User(int id, string userName, string password, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.UserName = userName;
     this.Password = password;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public RequisitionCollectionItem(int id, RequisitionCollection requisition, Item itemId, int qty, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.RequisitionCollection = requisition;
     this.Item = itemId;
     this.Qty = qty;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public RequisitionCollection(int id, Department departmentId, CollectionPoint collectionPointId, DateTime createdDate,
     Employee createdBy, int status)
 {
     this.Id = id;
     this.Department = departmentId;
     this.CollectionPoint = collectionPointId;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public Requisition(string id,Department department,Employee employee,string remarks,Employee approvedBy, DateTime createDate,int status)
 {
     this.Id = id;
        this.Department = department;
        this.CreatedBy = employee;
        this.Remarks = remarks;
        this.ApprovedBy = approvedBy;
        this.CreatedDate = createDate;
        this.Status = status;
 }
        public NotificationControl()
        {
            currentEmployee = Util.ValidateUser();
            inventory = new InventoryEntities();

            notificationBroker = new NotificationBroker(inventory);

            notificationList = notificationBroker.GetAllNotification(currentEmployee);

            dataColumn = new DataColumn[] { new DataColumn(columnName[0]), new DataColumn(columnName[1]) };
        }
 public StockCardDetail(int id, Item itemId, string description, int qty, int balance, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.Item = itemId;
     this.Description = description;
     this.Qty = qty;
     this.Balance = balance;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 //  private DataColumn[] discrepancyItemListColumn;
 public IssueAdjustmentVoucherControl()
 {
     currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_SUPERVISOR);
     InventoryEntities inventoryEntities = new InventoryEntities();
     employeeBroker = new EmployeeBroker(inventoryEntities);
     discrepancyBroker = new DiscrepancyBroker(inventoryEntities);
     itemBroker = new ItemBroker(inventoryEntities);
     // discrepancyList = new System.Data.Objects.DataClasses.EntityCollection<Discrepancy>();
     listColumn = new DataColumn[]{new DataColumn(listColumnName[0]),new DataColumn(listColumnName[1]),new DataColumn(listColumnName[2]),new DataColumn(listColumnName[3])
     };
     detailColumn = new DataColumn[] { new DataColumn(detailColumnName[0]), new DataColumn(detailColumnName[1]), new DataColumn(detailColumnName[2]), new DataColumn(detailColumnName[3]), new DataColumn(detailColumnName[4]) };
 }
        public ViewStockCardControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            InventoryEntities inventory = new InventoryEntities();

            itemBroker = new ItemBroker(inventory);
            itemPriceBroker = new ItemPriceBroker(inventory);
            dataColumn = new DataColumn[] { new DataColumn(columnName[0]),
                                            new DataColumn(columnName[1]),
                                            new DataColumn(columnName[2]),
                                            new DataColumn(columnName[3])};
        }
        /// <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);
        }
 public Item(string id, int categoryId, string description, int reorderLevel, int reorderQty, decimal money,
     int UOM, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.ItemCategoryId = categoryId;
     this.Description = description;
     this.ReorderLevel = reorderLevel;
     this.ReorderQty = reorderQty;
     this.Cost = money;
     this.UnitOfMeasureId = UOM;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
 public Employee(int id, User userId, Role roleId, Department departmentId, string name, int designation,
     string email, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.User = userId;
     this.Role = roleId;
     this.Department = departmentId;
     this.Name = name;
     this.Designation = designation;
     this.Email = email;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
        /// <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);
        }
 public Department(string id, string name, Employee contactId, string phoneNumer, string faxNumer, Employee headId, CollectionPoint collectionPointId,
     Employee representativId, DateTime createdDate, Employee createdBy, int status)
 {
     this.Id = id;
     this.Name = name;
     this.Contact = contactId;
     this.PhoneNumber = phoneNumer;
     this.FaxNumber = faxNumer;
     this.Head = headId;
     this.CollectionPoint = collectionPointId;
     this.Representative = representativId;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.Status = status;
 }
        public ViewStationeryRetrievalListControl()
        {
            currentEmployee = Util.ValidateUser(Constants.EMPLOYEE_ROLE.STORE_CLERK);

            InventoryEntities inventory=new InventoryEntities();
            retrievalBroker=new RetrievalBroker(inventory);

            retrievalList = retrievalBroker.GetAllRetrieval();

            dataColumn = new DataColumn[]{ new DataColumn(columnName[0]),
                                           new DataColumn(columnName[1]),
                                           new DataColumn(columnName[2]),
                                           new DataColumn(columnName[3]),
                                           new DataColumn(columnName[4]) };
        }
 public PurchaseOrder(int id, Supplier supplier, string deliverAdd, string attn, DateTime expectedDate, DateTime createdDate, Employee createdBy, DateTime approvedDate, Employee approvedBy, int status, string deliveryOrderNo, DateTime deliveryDate, Employee acceptedBy)
 {
     this.Id = id;
     this.Supplier = supplier;
     this.DeliverAddress = deliverAdd;
     this.Attn = attn;
     this.ExpectedDate = expectedDate;
     this.CreatedDate = createdDate;
     this.CreatedBy = createdBy;
     this.ApprovedDate = approvedDate;
     this.ApprovedBy = approvedBy;
     this.Status = status;
     this.DeliveryOrderNumber = deliveryOrderNo;
     this.DeliveryDate = deliveryDate;
     this.AcceptedBy = acceptedBy;
 }
        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 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]) };
        }