public ActionResult Edit(Guid id)
        {
            var activeConsignment = _consignmentService.GetById(id);
            var viewmodel         = new ConsignmentEditViewModel()
            {
                Id           = activeConsignment.Id,
                SupplierName = activeConsignment.Supplier.Name,
                SupplierId   = activeConsignment.Supplier.Id
            };

            return(View("_Edit", viewmodel));
        }
Beispiel #2
0
 public void GetById_UserHasInsufficientSecurityClearance_DomainValidationExceptionThrown()
 {
     try
     {
         _consignmentService = ConsignmentServiceFactory.Create(
             TestUserContext.Create("*****@*****.**", "Test User", "Operations Manager", UserRole.Public));
         _consignmentService.GetById(Guid.NewGuid());
     }
     catch (DomainValidationException dex)
     {
         _domainValidationException = dex;
     }
     Assert.IsTrue(_domainValidationException.ResultContainsMessage(Messages.InsufficientSecurityClearance));
 }
Beispiel #3
0
        public ActionResult Edit(int id)
        {
            ConsignmentService objService = new ConsignmentService();
            ConsignmentModel   objModel   = new ConsignmentModel();

            objModel = objService.GetById(id);

            int uid = 0;
            int cid = 0;
            int rid = 0;

            if (Session["UserId"] != null)
            {
                uid = Convert.ToInt32(Session["UserId"].ToString());
                cid = Convert.ToInt32(Session["CompID"].ToString());
                rid = Convert.ToInt32(Session["CompID"].ToString());
            }

            List <PartyModel> lstConsigner = new List <PartyModel>();

            lstConsigner           = objService.getConsigner(rid, cid);
            objModel.ListConsigner = new List <PartyModel>();
            objModel.ListConsigner.AddRange(lstConsigner);

            List <PartyModel> lstConsignee = new List <PartyModel>();

            lstConsignee           = objService.getConsigner(rid, cid);
            objModel.ListConsignee = new List <PartyModel>();
            objModel.ListConsignee.AddRange(lstConsignee);

            List <VehicleItem> lstVehicle = new List <VehicleItem>();

            lstVehicle           = objService.getVehicle(rid, cid);
            objModel.ListVehicle = new List <VehicleItem>();
            objModel.ListVehicle.AddRange(lstVehicle);
            ViewBag.Menuid = (Request.QueryString["menuid"]);
            return(View(objModel));
        }