Beispiel #1
0
        public List <dynamic> AddCustDataFreight(FreightDetails FreightDetails)
        {
            List <dynamic>   objDynamic = new List <dynamic>();
            FreightTotal     freightTotal = new FreightTotal();
            var              Data = JsonConvert.DeserializeObject <List <CustFreightTitle> >(FreightDetails.FreightData);
            CustFreightTitle CustFreightTitle = new CustFreightTitle();
            string           strFreightAmount = string.Empty, strTaxAmount = string.Empty, strLeadTime = string.Empty;
            Decimal          FinalAmount = 0;
            Int64            OrderID = 0, intLeadTime = 0;

            if (!string.IsNullOrEmpty(securityHelper.Decrypt(FreightDetails.strOrderID, false)))
            {
                OrderID = Convert.ToInt64(securityHelper.Decrypt(FreightDetails.strOrderID, false));
            }
            for (int i = 0; i < Data.Count; i++)
            {
                CustFreightTitle = Data[i];
                if (CustFreightTitle.isFreightAmount == true)
                {
                    strFreightAmount = CustFreightTitle.Data;
                }

                if (CustFreightTitle.isTaxApplicable == true)
                {
                    strTaxAmount = CustFreightTitle.Data;
                }
                if (CustFreightTitle.isLeadTime == true)
                {
                    strLeadTime = CustFreightTitle.Data;
                    if (!string.IsNullOrEmpty(strLeadTime))
                    {
                        intLeadTime = Convert.ToInt64(strLeadTime);
                    }
                }

                AddFreightTitleDetail(OrderID, CustFreightTitle.FreightTitleId, CustFreightTitle.Data);
            }
            freightTotal = GetTotalAmount(FreightDetails.TotalAmount, strFreightAmount, strTaxAmount);
            int count = UpdateOrderDetail(OrderID, Convert.ToInt64(UserID), freightTotal.TotalAmount, freightTotal.Freight, freightTotal.TaxAmount, intLeadTime);

            EmailTemplate   emailTemplate   = new EmailTemplate();
            CustRequestData custRequestData = new CustRequestData();

            custRequestData.GetEmailDetails(OrderID.ToString(), string.Empty, string.Empty);

            objDynamic.Add(count);
            objDynamic.Add(FinalAmount);
            return(objDynamic);
        }
        //Order all
        public List <dynamic> AddOrderShipment(OrderShipmentComman OrderShipmentUI)
        {
            OrderShipmentInfoCRUD orderShipmentInfoCRUD = new OrderShipmentInfoCRUD();

            OrderShipmentDetailsCRUD orderShipmentDetailsCRUD = new OrderShipmentDetailsCRUD();


            List <dynamic>   ObjDynamic    = new List <dynamic>();
            OrderShipmentDTO OrderShipment = new OrderShipmentDTO();

            string strOrderID = securityHelper.Decrypt(OrderShipmentUI.strOrderID, false);


            OrderShipment.Type            = OrderShipmentUI.Type;
            OrderShipment.DocumentGroupId = OrderShipmentUI.DocumentGroupId;

            OrderShipment.ShipmentId     = OrderShipmentUI.ShipmentId;
            OrderShipment.Title          = OrderShipmentUI.Title;
            OrderShipment.ShipmentDateDB = OrderShipmentUI.ShipmentDate;
            OrderShipment.OrderId        = Convert.ToInt64(strOrderID);
            OrderShipment.isActive       = OrderShipmentUI.isActive;


            CRUDOrderShipment(OrderShipment);

            orderShipmentInfoCRUD.SaveOrdershipmentinfo(OrderShipmentUI, OrderShipment.ShipmentId);

            orderShipmentDetailsCRUD.SaveOrdershipmentDetails(OrderShipmentUI, OrderShipment.ShipmentId);


            ObjDynamic.Add(OrderShipment);
            if (OrderShipmentUI.SendEmail)
            {
                CustRequestData custRequestData = new CustRequestData();
                custRequestData.GetEmailDetails(strOrderID, OrderShipmentUI.SendEmailID, "99");
            }
            return(ObjDynamic);
        }