Пример #1
0
 public MobileAPIController(InventoryManagementSystemContext db, EmployeeService eservice, RequisitionService rpService, ProductService pService)
 {
     this.eservice  = eservice;
     this.rpService = rpService;
     this.pService  = pService;
     this.db        = db;
 }
Пример #2
0
 public RequisitionController(RequisitionService reqService, InventoryService invService, DepartmentService deptService, StationeryContext dbcontext)
 {
     this.deptService = deptService;
     this.invService  = invService;
     this.reqService  = reqService;
     this.dbcontext   = dbcontext;
 }
Пример #3
0
        public ActionResult CreateRequisition(string sessionId)
        {
            Employee    emp      = EmployeeService.GetUserBySessionId(sessionId);
            List <Cart> empCarts = RequisitionService.GetCartsByEmpId(emp.EmpId);

            if (empCarts.Count != 0)
            {
                List <Cart> cartsToRequest = new List <Cart>();
                foreach (string key in Request.Form.AllKeys)
                {
                    var  value    = Request[key];
                    int  quantity = Convert.ToInt32(value);
                    long itemId   = Convert.ToInt64(key);
                    Cart cart     = empCarts.Find(c => c.Item.ItemId == itemId);
                    cart.Quantity = quantity;
                    cartsToRequest.Add(cart);
                }

                RequisitionService.CreateRequisition(cartsToRequest, emp.EmpId);
                string            headMail = RequisitionService.GetDeptHead(emp.DeptId);
                EmailNotification notice   = new EmailNotification();
                notice.ReceiverMailAddress = headMail;
                Task.Run(() => emailService.SendMail(notice, EmailTrigger.ON_REQUISITION_MAIL));
            }
            return(RedirectToAction("NewRequisition", "Requisition", new { sessionId = sessionId }));
        }
Пример #4
0
        private void SaveInfoToDatabase(PDFInfo pdf)
        {
            logger.Info($"Getting req info from the database for {pdf.Barcode}");

            var barcode = int.Parse(pdf.Barcode);
            var req     = RequisitionFactory.CreateRequisition(barcode, new ProlisService());

            if (req != null)
            {
                var doc = new RequisitionDocument()
                {
                    RequisitionId = req.RequisitionNo,
                    Document      = pdf.Pdf,
                    markedDeleted = false
                };

                logger.Info("Req info received.  Saving info.");

                var db = new RequisitionService();
                db.SaveRequisition(req);

                var docService = new LOIS.BLL.services.DocumentService();
                docService.SaveDocument(doc);

                if (req.Patient != null)
                {
                    db.SavePatient(req.Patient);
                }

                logger.Debug("Saved for " + pdf.Barcode);
            }
        }
        public ActionResult RequisitionList()
        {
            RequisitionService     rservice     = new RequisitionService();
            List <RequisitionList> requisitions = rservice.GetRequisitionList();

            ViewBag.requisitionList = requisitions;
            return(View());
        }
 public RequisitionController(ILogger <RequisitionController> logger, ProductService pService, EmployeeService empService, RequisitionService rpService, DisbursementFormService dfService)
 {
     _logger         = logger;
     this.pService   = pService;
     this.rpService  = rpService;
     this.empService = empService;
     this.dfService  = dfService;
 }
Пример #7
0
        public ActionResult AddtoList(long itemId, string sessionId)
        {
            string   qty = Request.Form["itemQuantity"] == "" ? "1" : Request.Form["itemQuantity"];
            Employee emp = EmployeeService.GetUserBySessionId(sessionId);

            RequisitionService.SaveToCart(itemId, emp.EmpId, Convert.ToInt32(qty));
            return(RedirectToAction("NewRequisition", "Requisition", new { sessionId = sessionId }));
        }
Пример #8
0
        //private readonly ILogger<StationeryRetrievalController> _logger;
        //private EmployeeService empservice;

        public TrendAnalysisController(ProductCategoryService productcatservice, DepartmentService deptservice, RequisitionService reqservice, TrendAnalysisService taservice)
        {
            //_logger = logger;
            this.productcatservice = productcatservice;
            this.deptservice       = deptservice;
            this.reqservice        = reqservice;
            this.taservice         = taservice;
        }
        public ActionResult GetRequisitionDetails(int id)
        {
            RequisitionService        rservice = new RequisitionService();
            List <RequisitionDetails> rDetails = rservice.GetRequisitionDetails(id);

            ViewBag.rDetails = rDetails;
            return(View());
        }
 public PurchaseOrderController(StationeryContext dbcontext, RequisitionService reqService, InventoryService invService, DepartmentService deptService, DisbursementService disService)
 {
     this.deptService = deptService;
     this.invService  = invService;
     this.reqService  = reqService;
     this.dbcontext   = dbcontext;
     this.disService  = disService;
 }
Пример #11
0
 public InventoryApiController()
 {
     context              = new ApplicationDbContext();
     itemService          = new ItemService(context);
     stkMovementService   = new StockMovementService(context);
     itemPriceService     = new ItemPriceService(context);
     requisitionService   = new RequisitionService(context);
     purchaseOrderService = new PurchaseOrderService(context);
 }
Пример #12
0
        public ActionResult RequisitionList(string sessionId)
        {
            Employee    emp      = EmployeeService.GetUserBySessionId(sessionId);
            List <Cart> empCarts = RequisitionService.GetCartsByEmpId(emp.EmpId);

            ViewData["sessionId"] = sessionId;
            ViewData["isRep"]     = (emp.EmpRole == "REPRESENTATIVE");
            return(View(empCarts));
        }
Пример #13
0
        public ActionResult DeptPastRequisition(long deptId, string sessionId)
        {
            ViewData["sessionId"] = sessionId;
            ViewData["deptName"]  = DepartmentService.GetDepartmentById(deptId).DeptName;
            List <Requisition> reqList = RequisitionService.GetPastRequisitionByDeptId(deptId);

            reqList.Sort((x, y) => DateTime.Compare(y.DateOfRequest, x.DateOfRequest));
            return(View(reqList));
        }
Пример #14
0
 public DepartmentController(RequisitionService reqService, InventoryService invService, DepartmentService deptService, DisbursementService disService, NotificationService notiService, StationeryContext dbcontext)
 {
     this.deptService = deptService;
     this.invService  = invService;
     this.reqService  = reqService;
     this.dbcontext   = dbcontext;
     this.disService  = disService;
     this.notiService = notiService;
 }
Пример #15
0
        public ActionResult Reorder(int reqId, string sessionId)
        {
            Employee emp = EmployeeService.GetUserBySessionId(sessionId);

            RequisitionService.ReorderCart(reqId, emp.EmpId);
            ViewData["sessionId"] = sessionId;
            ViewData["isRep"]     = (emp.EmpRole == "REPRESENTATIVE");
            return(RedirectToAction("RequisitionList", "Requisition", new { sessionId = sessionId }));
        }
 public StationeryStoreController(StationeryContext dbcontext, RetrievalService rservice, RequisitionService requisitionService, InventoryService invService, DepartmentService deptService, DisbursementService disbService, NotificationService notifService)
 {
     this.dbcontext          = dbcontext;
     this.rservice           = rservice;
     this.requisitionService = requisitionService;
     this.invService         = invService;
     this.deptService        = deptService;
     this.disbService        = disbService;
     this.notifService       = notifService;
 }
Пример #17
0
 public RequisitionControllerTests()
 {
     requisitionService      = new RequisitionService(requisitionRepository);
     itemRequisitionService  = new ItemRequisitionService(itemRequisitionRepository);
     itemService             = new ItemService(itemRepository, new MLService(itemRequisitionService, requisitionService, itemRepository, new Microsoft.ML.MLContext()));
     departmentService       = new DepartmentService(departmentRepository);
     disbursementService     = new DisbursementService(disbursementRepository);
     itemDisbursementService = new ItemDisbursementService(itemDisbursementRepository);
     inventoryService        = new InventoryService(inventoryRepository);
 }
Пример #18
0
        public ActionResult DeptRequisition(string sessionId)
        {
            Employee emp = EmployeeService.GetUserBySessionId(sessionId);

            ViewData["sessionId"] = sessionId;
            ViewData["isRep"]     = (emp.EmpRole == "REPRESENTATIVE");
            List <Requisition> reqList = RequisitionService.GetRequisitionByDeptId(emp.DeptId);

            reqList.Sort((x, y) => DateTime.Compare(y.DateOfRequest, x.DateOfRequest));
            return(View(reqList));
        }
Пример #19
0
        public void TestInitialize()
        {
            // Arrange
            context               = new ApplicationDbContext();
            requisitionService    = new RequisitionService(context);
            statusService         = new StatusService(context);
            requisitionRepository = new RequisitionRepository(context);
            itemRepository        = new ItemRepository(context);

            //// Populate Data (if necessary)
            populateRequisitions();
        }
Пример #20
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
                              InventoryManagementSystemContext db,
                              IWebHostEnvironment environment,
                              ProductService pService,
                              DepartmentService dService,
                              InventoryTransactionService invtransService,
                              ProductCategoryService pcService,
                              DisbursementFormService dfService,
                              StationeryRetrievalFormService srfService,
                              EmployeeTypeService etService,
                              EmployeeService empService,
                              RequisitionService rfService,
                              DelegationService delService,
                              SupplierService supService,
                              SupplierProductService spService,
                              InventoryTransactionService itService)

        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            //app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            // Cookie authentication configuration
            app.UseCookiePolicy();
            app.UseAuthentication();
            app.UseAuthorization();

            app.UseSession();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Home}/{action=Index}/{id?}");
            });

            db.Database.EnsureDeleted();
            db.Database.EnsureCreated();
            new DBSeeder(db, environment, pService, dService, pcService, dfService, srfService,
                         etService, empService, rfService, delService, supService, spService, itService);
        }
 public RequisitionController(
     TolkDbContext tolkDbContext,
     ILogger <RequisitionController> logger,
     RequisitionService requisitionService,
     ApiUserService apiUserService,
     ApiOrderService apiOrderService
     )
 {
     _dbContext          = tolkDbContext;
     _logger             = logger;
     _apiUserService     = apiUserService;
     _requisitionService = requisitionService;
     _apiOrderService    = apiOrderService;
 }
Пример #22
0
        public ActionResult GetPendingRequisitions(string sessionId)
        {
            Employee           emp           = EmployeeService.GetUserBySessionId(sessionId);
            long               deptId        = emp.DeptId;
            List <Requisition> requisitions  = RequisitionService.DisplayPendingRequisitions(deptId);
            bool               all           = DelegateService.CheckPreviousHeadForNav(deptId);
            bool               permanentHead = ((emp.EmpRole == "HEAD" && emp.EmpDisplayRole == "HEAD") || (emp.EmpRole == "EMPLOYEE" && emp.EmpDisplayRole == "HEAD"));

            ViewData["all"]                   = all;
            ViewData["permanentHead"]         = permanentHead;
            ViewData["requisitionsToProcess"] = requisitions;
            ViewData["sessionId"]             = sessionId;
            return(View());
        }
Пример #23
0
        public void InsertRequistion()
        {
            var req  = LOIS.BLL.Factories.RequisitionFactory.CreateRequisition(1, new FakeProlisService());
            var repo = new RequisitionService();

            repo.SaveRequisition(req);
            using (var b = new loisEntities1())
            {
                var r = b.Requisitions.First(x => x.RequisitionNo == 1);

                b.Requisitions.Remove(r);
                b.SaveChanges();
            }
        }
Пример #24
0
        public ActionResult ProcessRequisition(long reqId, string status, string sessionId)
        {
            Employee emp         = EmployeeService.GetUserBySessionId(sessionId);
            long     currentHead = emp.EmpId;

            RequisitionService.ProcessRequisition(reqId, status, currentHead);
            bool all           = DelegateService.CheckPreviousHeadForNav(emp.DeptId);
            bool permanentHead = ((emp.EmpRole == "HEAD" && emp.EmpDisplayRole == "HEAD") || (emp.EmpRole == "EMPLOYEE" && emp.EmpDisplayRole == "HEAD"));

            ViewData["all"]           = all;
            ViewData["permanentHead"] = permanentHead;
            ViewData["sessionId"]     = sessionId;
            return(RedirectToAction("GetPendingRequisitions", new { sessionId = sessionId }));
        }
        public RequisitionController()
        {
            context = new ApplicationDbContext();
            requisitionRepository = new RequisitionRepository(context);
            userRepository        = new UserRepository(context);

            requisitionService     = new RequisitionService(context);
            retrievalService       = new RetrievalService(context);
            itemService            = new ItemService(context);
            collectionPointService = new CollectionPointService(context);
            departmentService      = new DepartmentService(context);
            statusService          = new StatusService(context);

            userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(context));
        }
Пример #26
0
 public RequisitionAPIController()
 {
     context                   = new ApplicationDbContext();
     requisitionService        = new RequisitionService(context);
     requisitionRepository     = new RequisitionRepository(context);
     retrievalService          = new RetrievalService(context);
     disbursementService       = new DisbursementService(context);
     statusService             = new StatusService(context);
     itemService               = new ItemService(context);
     departmentRepository      = new DepartmentRepository(context);
     userRepository            = new UserRepository(context);
     statusRepository          = new StatusRepository(context);
     collectionPointRepository = new CollectionPointRepository(context);
     notificationService       = new NotificationService(context);
 }
Пример #27
0
        public ActionResult ViewPastRequisitions(string sessionId)
        {
            Employee           emp          = EmployeeService.GetUserBySessionId(sessionId);
            long               deptId       = emp.DeptId;
            List <Requisition> requisitions = RequisitionService.DisplayPastRequisitions(deptId);

            requisitions.Sort((x, y) => DateTime.Compare(y.DateOfRequest, x.DateOfRequest));
            bool all           = DelegateService.CheckPreviousHeadForNav(deptId);
            bool permanentHead = ((emp.EmpRole == "HEAD" && emp.EmpDisplayRole == "HEAD") || (emp.EmpRole == "EMPLOYEE" && emp.EmpDisplayRole == "HEAD"));

            ViewData["all"]              = all;
            ViewData["permanentHead"]    = permanentHead;
            ViewData["pastRequisitions"] = requisitions;
            ViewData["sessionId"]        = sessionId;
            return(View());
        }
Пример #28
0
        public RequisitionService GetRequisitionService()
        {
            var url = this.endpoint + "?ServiceName=" + TaleoRequisitionServiceName;

            var requisitionService = new RequisitionService();
            var credCache          = new CredentialCache
            {
                { new Uri(endpoint), "Basic", new NetworkCredential(this.username, this.password) }
            };

            requisitionService.Credentials     = credCache;
            requisitionService.Url             = url;
            requisitionService.PreAuthenticate = true;

            return(requisitionService);
        }
Пример #29
0
        //For store employee to view and add catalogue
        public ActionResult All(string sessionId)
        {
            string desc = "";
            string cat  = "";

            desc = null == Request.Form["desSearch"] ? "" : Request.Form["desSearch"];
            cat  = null == Request.Form["catSearch"] ? "" : Request.Form["catSearch"];
            List <Inventory> catalogues = RequisitionService.ShowItems(desc, cat);
            List <string>    category   = new List <string>();

            category = RequisitionService.GetALLCategories();

            ViewData["catalogues"] = catalogues;
            ViewData["sessionId"]  = sessionId;
            ViewData["category"]   = category;
            return(View());
        }
Пример #30
0
        public ActionResult ViewAllRequisitionsByStatus(string status, string sessionId)
        {
            List <Requisition> requisitions = RequisitionService.ShowAllRequisitionsByStatusByDate(status);

            if (DisbursementListService.CheckForPendingDisbursements().Count != 0)
            {
                ViewData["alreadyAssigned"] = "YES";
            }
            else
            {
                ViewData["alreadyAssigned"] = "NO";
            }
            ViewData["Reqs"]      = requisitions;
            ViewData["status"]    = status;
            ViewData["sessionId"] = sessionId;
            return(View());
        }
        /// <summary>
        /// Borra el header de un vale cuando este no se puede finalizar
        /// </summary>
        /// <param name="proxyRequisition"></param>
        /// <param name="createHeaderReply"></param>
        /// <param name="opRequisition"></param>
        /// <param name="currentHeader"></param>
        /// <param name="currentRow"></param>
        /// <param name="error"></param>
        private void DeleteHeader(RequisitionService.RequisitionService proxyRequisition, RequisitionService.RequisitionServiceCreateHeaderReplyDTO createHeaderReply, RequisitionService.OperationContext opRequisition, int currentHeader, int currentRow, string error)
        {
            cells.GetRange(1, currentHeader, ResultColumn, (currentRow - 1)).Style = cells.GetStyle(StyleConstants.Error);

            cells.GetCell(ResultColumn, currentRow).Value += " Error: " + error;
            var deleteHeaderReply = new RequisitionService.RequisitionServiceDeleteHeaderReplyDTO();
            var deleteHeaderRequest = CreateDeleteRequestDto(createHeaderReply);

            try
            {
                deleteHeaderReply = proxyRequisition.deleteHeader(opRequisition, deleteHeaderRequest);
                cells.GetCell(ResultColumn, currentRow).Value += " La requisicion: " + deleteHeaderRequest.ireqNo + " fue borrada.";
            }
            catch (Exception errorHeader)
            {
                cells.GetCell(ResultColumn, currentRow).Value += " Error " + errorHeader.Message + ", Borrando la requisicion: " + deleteHeaderRequest.ireqNo;
            }
        }
        /// <summary>
        /// Esta funcion copia el encabezado de la creacion de la requisicion en el objeto del encabezado para el borrado
        /// </summary>
        /// <param name="createHeaderReply">Encabezado de la requisicion a borrar</param>
        /// <returns></returns>
        private static RequisitionService.RequisitionServiceDeleteHeaderRequestDTO CreateDeleteRequestDto(RequisitionService.RequisitionServiceCreateHeaderReplyDTO createHeaderReply)
        {
            var deleteHeaderRequest = new RequisitionService.RequisitionServiceDeleteHeaderRequestDTO
            {
                allocPcA = createHeaderReply.allocPcA,
                allocPcB = createHeaderReply.allocPcB,
                assignToTeam = createHeaderReply.assignToTeam,
                authorisedStatusDesc = createHeaderReply.authorisedStatusDesc,
                authsdBy = createHeaderReply.authsdBy,
                authsdByName = createHeaderReply.authsdByName,
                authsdDate = createHeaderReply.authsdDate,
                authsdItmAmt = createHeaderReply.authsdItmAmt,
                authsdPosition = createHeaderReply.authsdPosition,
                authsdPositionDesc = createHeaderReply.authsdPositionDesc,
                authsdStatus = createHeaderReply.authsdStatus,
                authsdStatusDesc = createHeaderReply.authsdStatusDesc,
                authsdTime = createHeaderReply.authsdTime,
                authsdTotAmt = createHeaderReply.authsdTotAmt,
                completedDate = createHeaderReply.completedDate,
                completeItems = createHeaderReply.completeItems,
                confirmDelete = createHeaderReply.confirmDelete,
                costCentreA = createHeaderReply.costCentreA,
                costCentreB = createHeaderReply.costCentreB,
                costDistrictA = createHeaderReply.costDistrictA,
                costDistrictB = createHeaderReply.costDistrictB,
                createdBy = createHeaderReply.createdBy,
                createdByName = createHeaderReply.createdByName,
                creationDate = createHeaderReply.creationDate,
                creationTime = createHeaderReply.creationTime,
                custNo = createHeaderReply.custNo,
                custNoDesc = createHeaderReply.custNoDesc,
                delivInstrA = createHeaderReply.delivInstrA,
                delivInstrB = createHeaderReply.delivInstrB,
                delivLocation = createHeaderReply.delivLocation,
                delivLocationDesc = createHeaderReply.delivLocationDesc,
                directPurchOrd = createHeaderReply.directPurchOrd,
                districtCode = createHeaderReply.districtCode,
                districtName = createHeaderReply.districtName,
                entitlementPeriod = createHeaderReply.entitlementPeriod,
                equipmentA = createHeaderReply.equipmentA,
                equipmentB = createHeaderReply.equipmentB,
                equipmentRefA = createHeaderReply.equipmentRefA,
                equipmentRefB = createHeaderReply.equipmentRefB,
                groupClass = createHeaderReply.groupClass,
                hdr140Status = createHeaderReply.hdr140Status,
                hdr140StatusDesc = createHeaderReply.hdr140StatusDesc,
                headerType = createHeaderReply.headerType,
                inabilityDate = createHeaderReply.inabilityDate,
                inabilityRsn = createHeaderReply.inabilityRsn,
                inspectCode = createHeaderReply.inspectCode,
                inventCat = createHeaderReply.inventCat,
                inventCatDesc = createHeaderReply.inventCatDesc,
                ireqNo = createHeaderReply.ireqNo,
                ireqType = createHeaderReply.ireqType,
                issTranType = createHeaderReply.issTranType,
                issTranTypeDesc = createHeaderReply.issTranTypeDesc,
                issueRequisitionTypeDesc = createHeaderReply.issueRequisitionTypeDesc,
                lastAcqDate = createHeaderReply.lastAcqDate,
                loanDuration = createHeaderReply.loanDuration,
                loanRequisitionNo = createHeaderReply.loanRequisitionNo,
                lstAmodDate = createHeaderReply.lstAmodDate,
                lstAmodTime = createHeaderReply.lstAmodTime,
                lstAmodUser = createHeaderReply.lstAmodUser,
                matGroupCode = createHeaderReply.matGroupCode,
                matGroupCodeDesc = createHeaderReply.matGroupCodeDesc,
                moreInstr = createHeaderReply.moreInstr,
                msg140Data = createHeaderReply.msg140Data,
                narrative = createHeaderReply.narrative,
                numOfItems = createHeaderReply.numOfItems,
                orderStatusDesc = createHeaderReply.orderStatusDesc,
                origWhouseId = createHeaderReply.origWhouseId,
                origWhouseIdDesc = createHeaderReply.origWhouseIdDesc,
                partIssue = createHeaderReply.partIssue,
                password = createHeaderReply.password,
                preqNo = createHeaderReply.preqNo,
                priorityCode = createHeaderReply.priorityCode,
                projectA = createHeaderReply.projectA,
                projectB = createHeaderReply.projectB,
                protectedInd = createHeaderReply.protectedInd,
                purchaseOrdNo = createHeaderReply.purchaseOrdNo,
                purchDelivInstr = createHeaderReply.purchDelivInstr,
                purchInstr = createHeaderReply.purchInstr,
                purchInstruction = createHeaderReply.purchInstruction,
                purchOfficer = createHeaderReply.purchOfficer,
                rcvngWhouse = createHeaderReply.rcvngWhouse,
                rcvngWhouseDesc = createHeaderReply.rcvngWhouseDesc,
                relatedWhReq = createHeaderReply.relatedWhReq,
                repairRequest = createHeaderReply.repairRequest,
                requestedBy = createHeaderReply.requestedBy,
                requestedByName = createHeaderReply.requestedByName,
                requiredByDate = createHeaderReply.requiredByDate,
                requiredByPos = createHeaderReply.requiredByPos,
                requiredByPosDesc = createHeaderReply.requiredByPosDesc,
                requisitionItemStatusDesc = createHeaderReply.requisitionItemStatusDesc,
                reversePeriodStart = createHeaderReply.reversePeriodStart,
                rotnRequisitionNo = createHeaderReply.rotnRequisitionNo,
                sentType = createHeaderReply.sentType,
                sentTypeDesc = createHeaderReply.sentTypeDesc,
                statsUpdatedInd = createHeaderReply.statsUpdatedInd,
                suggestedSupp = createHeaderReply.suggestedSupp,
                surveyNo = createHeaderReply.surveyNo,
                transType = createHeaderReply.transType,
                useByDate = createHeaderReply.useByDate,
                workOrderA = createHeaderReply.workOrderA,
                workOrderB = createHeaderReply.workOrderB,
                workProjA = createHeaderReply.workProjA,
                workProjB = createHeaderReply.workProjB,
                workProjIndA = createHeaderReply.workProjIndA,
                workProjIndB = createHeaderReply.workProjIndB
            };

            return deleteHeaderRequest;
        }