public ActionResult ApproveBooking(ApprovalVM approve)
        {
            var BookPastor = db.pastorsBooking.Find(approve.PastorBookingID);

            // BookPastor.updateBy = "Pastor";
            BookPastor.Status          = approve.Status;
            db.Entry(BookPastor).State = EntityState.Modified;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public IActionResult Approvals(int PatientId)
        {
            var model = new ApprovalVM();

            var user = _context.Patient.First(u => u.Id == PatientId);

            model.DOB         = user.Dob;
            model.PatientId   = PatientId;
            model.PatientName = user.FirstName + " " + user.LastName;

            // Get all items to be approved
            model.Investigations = _context.Investigations.Where(m => m.PatientId == PatientId && m.Active && m.Approved == false).ToList();
            model.Referrals      = _context.Referrals.Where(m => m.PatientId == PatientId && m.Approved == false).ToList();
            model.Medications    = _context.Medications.Where(m => m.PatientId == PatientId && m.Active && m.Approved == false).ToList();
            model.Problems       = _context.Problems.Where(m => m.PatientId == PatientId && m.Active && m.Approved == false).ToList();
            model.Reactions      = _context.Reactions.Where(m => m.PatientId == PatientId && m.Active && m.Approved == false).ToList();

            return(View(model));
        }
        public ActionResult PendingApproval()
        {
            var model = new ApprovalVM()
            {
                SelectedBlogPost = new BlogPost()
            };
            var blogPostOps = OperationsFactory.CreateBlogPostOps();
            var statusOps = OperationsFactory.CreateStatusOps();
            var commentOps = OperationsFactory.CreateCommentOps();
            model.ListOfPosts = blogPostOps.GetAllBlogPosts().FindAll(x=>x.Status.StatusID == 1);
            model.RejectedPostsList = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 3);
            model.DraftedPosts = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 5);
            model.ScheduledPosts = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 6 || x.DateOfPost > DateTime.Today);
            model.CommentsToBeApproved = commentOps.GetAllComments().FindAll(x => x.Status.StatusID == 1);
            var statusList = statusOps.ListAllStatuses();

            model.GenerateStatusList(statusList);

            return View(model);
        }
Пример #4
0
        public ActionResult PendingApproval()
        {
            var model = new ApprovalVM()
            {
                SelectedBlogPost = new BlogPost()
            };
            var blogPostOps = OperationsFactory.CreateBlogPostOps();
            var statusOps   = OperationsFactory.CreateStatusOps();
            var commentOps  = OperationsFactory.CreateCommentOps();

            model.ListOfPosts          = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 1);
            model.RejectedPostsList    = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 3);
            model.DraftedPosts         = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 5);
            model.ScheduledPosts       = blogPostOps.GetAllBlogPosts().FindAll(x => x.Status.StatusID == 6 || x.DateOfPost > DateTime.Today);
            model.CommentsToBeApproved = commentOps.GetAllComments().FindAll(x => x.Status.StatusID == 1);
            var statusList = statusOps.ListAllStatuses();

            model.GenerateStatusList(statusList);

            return(View(model));
        }
Пример #5
0
        public ActionResult Approvals()
        {
            //todo - add a list for org join requests.
            //todo - add a retire request???
            var rumors         = db.Rumors.Where(r => !r.IsApproved).ToList();
            var characters     = db.Characters.Where(c => !c.IsApproved).ToList();
            var journals       = db.Journals.Where(j => !j.IsApproved).ToList();
            var characterEdits = db.Characters.Where(c => c.HasUnseenEdit && c.IsApproved).ToList();
            var journalEdits   = db.Journals.Where(j => j.HasUnseenEdit && j.IsApproved).ToList();

            ApprovalVM model = new ApprovalVM {
                Rumors = rumors, Characters = characters, Journals = journals, CharacterEdits = characterEdits, JournalEdits = journalEdits
            };

            if (User.IsInRole("Admin"))
            {
                var users = db.UserDetails.Where(x => !x.IsApproved).ToList();
                model.Users = users;
            }
            return(View(model));
        }
Пример #6
0
        public ActionResult PurApproved(ApprovalVM D)
        {
            bool   status = false;
            string mes    = "";
            var    w      = (from y in databaseManager.sUsers
                             where y.UserID.ToString() == User.Identity.Name
                             select new { y.PlantNo }).FirstOrDefault();
            var    wn       = databaseManager.sPlants.Where(x => x.PlantNo == w.PlantNo).FirstOrDefault();
            string s1       = w.PlantNo.ToString();
            string s2       = string.Concat(s1 + "000000");
            int    reqno    = Convert.ToInt32(s2);
            var    maxreqno = (from n in databaseManager.FrdApprovals where n.PlantID == w.PlantNo select n.AppID).DefaultIfEmpty(reqno).Max();
            var    maxrNo   = maxreqno + 1;
            string Code     = string.Concat("APP" + maxreqno + "RM");
            int    v        = maxrNo;

            try
            {
                // using (LIVEEntities ddd = new LIVEEntities())
                using (var transaction = databaseManager.Database.BeginTransaction())
                {
                    if (ModelState.IsValid)
                    {
                        FrdApproval dbo = new FrdApproval();
                        {
                            dbo.AppID   = maxrNo;
                            dbo.PlantID = D.PlantID;
                            dbo.RefNo   = D.RefNo;
                            dbo.AppType = 1;
                            dbo.AppCode = Code;
                            //dbo.FirstApp = D.ReqID;
                            dbo.SecondRemarks = D.SecondRemarks;
                            dbo.SecondStatus  = "A";
                            //dbo.RefNo = D.RefNo;
                            //dbo.SupplierID = D.SupplierID;
                            //dbo.UserNote = D.UserNote;
                            //dbo.TypeCode = D.TypeCode;
                            //  if (D.TypeCode == 20)
                            // {
                            // dbo.AppBy = "XXXXX";
                            //  dbo.AppFlag = "O";
                            // }
                            //  else
                            // {
                            // dbo.AppBy = "NA";
                            // dbo.AppFlag = "N";
                            //  }
                            dbo.SecondDate = DateTime.Now;
                            dbo.SecondApp  = User.Identity.Name;
                        };
                        databaseManager.FrdApprovals.Add(dbo);
                        var result = databaseManager.FrdReceiveMasters.SingleOrDefault(b => b.ReqRecID == D.RefNo);
                        if (result != null)
                        {
                            result.AppFlag2    = "A";
                            result.AppDate2    = DateTime.Today;
                            result.AppBy2      = User.Identity.Name;
                            result.AppRemarks2 = D.SecondRemarks;
                            result.Status      = "APP";
                            databaseManager.SaveChanges();
                        }
                        databaseManager.SaveChanges();
                        transaction.Commit();
                        status = true;
                        databaseManager.Dispose();
                        ModelState.Clear();
                    }
                    else
                    {
                        status = false;
                        transaction.Rollback();
                    }
                    return(new JsonResult {
                        Data = new { status = status, mes = mes, v = v }
                    });
                }
            }
            catch (Exception ex)
            {
                string mess = ex.Message;
                return(Json(new { status = "error", message = "Error Generate" }));
            }
        }