//
        // GET: /Conveyance/BuyerSolicitorPanel/5
        public ActionResult BuyerSolicitorPanel(int CaseID, string Tab = "A")
        {
            if (db.Cases.Find(CaseID) == null)
            {
                return(HttpNotFound());
            }
            //Check if client is enrollend
            if (db.Cases.Find(CaseID).ClientID == null)
            {
                return(View("ClientNotEnrolled"));
            }

            //Retrieve relevant modules
            Case          @case             = db.Cases.FirstOrDefault(p => p.CaseID == CaseID);
            int           ClientModuleSetID = @case.ClientModuleSetID;
            List <Module> Modules           = new List <Module>();

            if (@case.SolicitorModuleSetID == null)      //solicitor module set not created yet
            {
                Modules = db.Module.Where(p => (p.ModuleSetID == ClientModuleSetID && (p.InitiateParty == Instruction.Buy))).OrderBy(p => p.Position).ToList();
            }
            else
            {
                int SolicitorModuleSetID = (int)@case.SolicitorModuleSetID;
                Modules = db.Module.Where(p => (p.ModuleSetID == ClientModuleSetID && (p.InitiateParty == Instruction.Buy) || (p.ModuleSetID == SolicitorModuleSetID))).OrderBy(p => p.Position).ToList();
            }

            //Build view model
            ConveyanceViewModel model = new ConveyanceViewModel();

            model.Case     = @case;
            model.Modules  = Modules;
            model.Comments = GetModuleComments(Modules);
            model.Files    = GetModuleFiles(Modules);
            model.Tab      = Tab;

            ViewBag.CaseID        = CaseID;
            ViewBag.CaseName      = @case.CaseName;
            ViewBag.SolicitorName = @case.Solicitor.FirstName + " " + @case.Solicitor.LastName;
            if (@case.OpCaseID != null)
            {
                ViewBag.OpSolicitorName = @case.OpCase.Solicitor.FirstName + " " + @case.OpCase.Solicitor.LastName;
            }
            else
            {
                ViewBag.OpSolicitorName = "*solicitor not enrolled*";
            }
            return(View(model));
        }
        public ActionResult SellerPanel(int CaseID, string Tab = "A")
        {
            if (db.Cases.Find(CaseID) == null)
            {
                return(HttpNotFound());
            }
            Case          @case             = db.Cases.FirstOrDefault(p => p.CaseID == CaseID);
            int           ClientModuleSetID = @case.ClientModuleSetID;
            List <Module> Modules           = db.Module.Where(p => p.ModuleSetID == ClientModuleSetID).OrderBy(p => p.Position).ToList();

            //Build view model
            ConveyanceViewModel model = new ConveyanceViewModel();

            model.Case     = @case;
            model.Modules  = Modules;
            model.Comments = GetModuleComments(Modules);
            model.Files    = GetModuleFiles(Modules);
            model.Tab      = Tab;

            ViewBag.CaseID   = CaseID;
            ViewBag.CaseName = @case.CaseName;
            return(View(model));
        }
Esempio n. 3
0
        public ActionResult _ConveyanceSearch(string conv_Owner, string conv_Name)
        {
            ViewData["ConveyanceSearch_OwnerName"] = conv_Owner;
            ViewData["ConveyanceSearch_Name"]      = conv_Name;

            var convJSON  = new ConveyanceViewModel();
            int convCount = 0;
            int convId    = 0;

            try
            {
                IEnumerable <Conveyance> convList = convRepo.Search(conv_Owner, conv_Name).ToList();
                if (convList.Count() > 0)
                {
                    convCount = convList.Count();
                    Conveyance conv = convList.FirstOrDefault();
                    if ((conv != null) && (convCount == 1))
                    {
                        convJSON.Conveyance.CopyFrom(conv);
                        convId = conv.Id;
                    }
                }
            }
            catch (FormatException)
            {
            }

            return(new JsonResult
            {
                Data = new
                {
                    convcount = convCount,
                    conv_id = convId,
                    partialview = this.RenderPartialViewToString("ConveyanceEditDetail", convJSON)
                }
            });
        }
 public IActionResult Conveyance(ConveyanceViewModel conveyanceViewModel)
 {
     return(Json(true));
 }