Ejemplo n.º 1
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Waypoint?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DateTime?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Location?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (VesselName?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ShippingAgent?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DirectConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TranshipmentConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FullEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EmptyEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TEUSEquipments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RiskDetection?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (From?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (To?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalRisks?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceID?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceRef?.GetHashCode() ?? 0);
            return(hashCode);
        }
Ejemplo n.º 2
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (WayPointVisibilityID?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Waypoint?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (From?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (To?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ConveyanceRef?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (ShippingAgent?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DirectConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TransshipmentConsignments?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalCargos?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FullCargos?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (EmptyCargos?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalRiskDetected?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Consignment?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CargoId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RiskType?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (RiskScore?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Severity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Details?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (Suggestions?.GetHashCode() ?? 0);
            return(hashCode);
        }
Ejemplo n.º 3
0
        //
        // GET: /ShippingAgent/Details/5

        public ActionResult Details(int id = 0)
        {
            ShippingAgent shippingagent = objSourceMastersModel.GetShippingAgentById(id);

            if (shippingagent == null)
            {
                return(HttpNotFound());
            }
            return(View(shippingagent));
        }
Ejemplo n.º 4
0
        public ActionResult Edit(ShippingAgent shippingagent)
        {
            if (ModelState.IsValid)
            {
                objSourceMastersModel.SaveShippingAgentById(shippingagent);
                TempData["SuccessMSG"] = "You have successfully updated Shipping Agent.";
                return(RedirectToAction("Index"));
            }

            return(View(shippingagent));
        }
Ejemplo n.º 5
0
        //
        // GET: /ShippingAgent/Edit/5

        public ActionResult Edit(int id = 0)
        {
            ShippingAgent shippingagent = objSourceMastersModel.GetShippingAgentById(id);

            if (shippingagent == null)
            {
                return(HttpNotFound());
            }
            ViewBag.country = new SelectList(objSourceMastersModel.GetCountry(), "CountryID", "CountryName", shippingagent.CountryID);
            return(View(shippingagent));
        }
Ejemplo n.º 6
0
 public Leg(string uniqueIdentifier,ShippingAgent carrier, CarrierType carrierType,Destination origin,Destination destination ,DateTime departureTime, DateTime arrivalTime, double cost, double totalCapacity)
 {
     this.uniqueIdentifier = uniqueIdentifier;
     this.carrier = carrier;
     this.carrierType = carrierType;
     this.origin = origin;
     this.destination = destination;
     this.departureTime = departureTime;
     this.arrivalTime = arrivalTime;
     this.cost = cost;
     this.totalCapacity = totalCapacity;
     this.UsedCapacity = 0;
 }
        public override Product Create(string description)
        {
            Target client = new ShippingAgent("Shipping");

            client.Link = "URL to Shipping Service";

            Product video = new Video(description);

            video.Outputs = new List <Output>();
            video.Outputs.Add(new VideoPackingSlip("Original Packing Slip", video, client));

            return(video);
        }
Ejemplo n.º 8
0
        public override Product Create(string description)
        {
            Target client = new ShippingAgent("Shipping");

            client.Link = "URL to Shipping Service";
            Target paymentClient = new PaymentServiceAgent("Payment");

            paymentClient.Link = "URL to Payment Services";

            Product physicalProduct = new PhysicalProduct(description);

            physicalProduct.Outputs = new List <Output>();
            physicalProduct.Outputs.Add(new PackingSlip("Original Packing Slip", physicalProduct, client));
            physicalProduct.Outputs.Add(new PackingSlip("Commission Payment", physicalProduct, paymentClient));

            return(physicalProduct);
        }
        static void Main(string[] args)
        {
            OrderProcessor orderProcessor = new OrderProcessor();

            ShippingAgent shippingClient = new ShippingAgent("Shipping");

            shippingClient.Link = "Link to Shipping Service";
            RoyaltyDepartmentClient royaltyClient = new RoyaltyDepartmentClient("Royalty Department");

            royaltyClient.Link = "Link to Royalty Department Service";

            ProductFactory productFactory = new PhysicalProductFactory();
            Product        book           = productFactory.Create("Fiction Novel");

            book.Outputs = new List <Output>();
            book.Outputs.Add(new PackingSlip("Original Packing Slip", book, shippingClient));
            book.Outputs.Add(new PackingSlip("Duplicate Packing Slip", book, royaltyClient));

            orderProcessor.ProcessOrder(book);
        }
        public override Product Create(string description)
        {
            Target shippingClient = new ShippingAgent("Shipping");

            shippingClient.Link = "URL to Shipping Service";
            Target royaltyClient = new RoyaltyDepartmentClient("Royalty Department");

            royaltyClient.Link = "URL to Royalty Department Service";
            Target paymentClient = new PaymentServiceAgent("Payment");

            paymentClient.Link = "URL to Payment Services";

            Product book = new Book(description);

            book.Outputs = new List <Output>();
            book.Outputs.Add(new PackingSlip("Original Packing Slip", book, shippingClient));
            book.Outputs.Add(new PackingSlip("Duplicate Packing Slip", book, royaltyClient));
            book.Outputs.Add(new PackingSlip("Commission Payment", book, paymentClient));

            return(book);
        }
Ejemplo n.º 11
0
        public ActionResult Create(ShippingAgent shippingagent)
        {
            if (ModelState.IsValid)
            {
                ViewBag.country = DropDownList <CountryMaster> .LoadItems(
                    objSourceMastersModel.GetCountry(), "CountryID", "CountryName");

                var query = (from t in entity.ShippingAgents where t.AgentName == shippingagent.AgentName select t).ToList();

                if (query.Count > 0)
                {
                    ViewBag.SuccessMsg = "Agent name is already exist";
                    ViewBag.country    = DropDownList <CountryMaster> .LoadItems(
                        objSourceMastersModel.GetCountry(), "CountryID", "CountryName");

                    return(View());
                }


                objSourceMastersModel.SaveShippingAgentById(shippingagent);
                TempData["SuccessMSG"] = "You have successfully added Shipping Agent.";
                return(RedirectToAction("Index"));
            }
            else
            {
                TempData["SuccessMSG"] = "Invalid Model State";
                var errors = ModelState.Values.SelectMany(v => v.Errors);
                foreach (var item in errors)
                {
                    TempData["SuccessMSG"] = TempData["SuccessMSG"].ToString() + item.ErrorMessage + ";";
                }
            }
            ViewBag.country = DropDownList <CountryMaster> .LoadItems(
                objSourceMastersModel.GetCountry(), "CountryID", "CountryName");

            return(View(shippingagent));
        }
Ejemplo n.º 12
0
 public static ShippingAgent ToEntity(this ShippingAgentModel model, ShippingAgent destination)
 {
     return(AutoMapperConfiguration.Mapper.Map(model, destination));
 }
Ejemplo n.º 13
0
 public static ShippingAgentModel ToModel(this ShippingAgent entity)
 {
     return(AutoMapperConfiguration.Mapper.Map <ShippingAgent, ShippingAgentModel>(entity));
 }