public JsonResult Ordershipmentinfo(OrderShipmentComman model)
        {
            var Response = orderShipmentCRUD.AddOrderShipment(model);

            return(new JsonResult {
                Data = Response, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
        public List <dynamic> SaveOrdershipmentDetails(OrderShipmentComman strOrderShipmentDtls, Int64 ShipmentId)
        {
            List <dynamic> objDynamic = new List <dynamic>();

            OrderShipmentDetailsDTO orderShipmentDetailsDTO = new OrderShipmentDetailsDTO();

            OrderShipmentComman orderShipmentInfoUI = new OrderShipmentComman();
            int orddetid = 0;

            //string strOrderID = securityHelper.Decrypt(strOrderShipmentDtls.strOrderID, false);
            if (!string.IsNullOrEmpty(strOrderShipmentDtls.Ordershipmentinfo))
            {
                var Data = JsonConvert.DeserializeObject <List <OrderShipmentComman> >(strOrderShipmentDtls.ShipmentDetails);
                for (int i = 0; i < Data.Count; i++)
                {
                    orderShipmentInfoUI = Data[i];

                    if (orderShipmentInfoUI.ShipmentDetailId != 0)
                    {
                        orderShipmentDetailsDTO.ShipmentDetailId = orderShipmentInfoUI.ShipmentDetailId;
                    }

                    if (ShipmentId != 0)
                    {
                        orderShipmentDetailsDTO.ShipmentId = ShipmentId;
                    }

                    if (orderShipmentInfoUI.ODID != 0)
                    {
                        orderShipmentDetailsDTO.ODID = orderShipmentInfoUI.ODID;
                    }

                    if (orderShipmentInfoUI.Quantity != 0)
                    {
                        orderShipmentDetailsDTO.ActualQty = orderShipmentInfoUI.Quantity;
                    }


                    orderShipmentDetailsDTO.ShippedQty = orderShipmentInfoUI.ToShip;

                    orderShipmentDetailsDTO.BalanceQty = orderShipmentInfoUI.BalanceQty;



                    orderShipmentDetailsDTO.isActive = strOrderShipmentDtls.isActive;
                    orderShipmentDetailsDTO.Type     = strOrderShipmentDtls.Type;

                    CRUDOrderDetails(orderShipmentDetailsDTO);
                }
                objDynamic.Add(orddetid);
            }
            return(objDynamic);
        }
Beispiel #3
0
        public List <dynamic> SaveOrdershipmentinfo(OrderShipmentComman strOrderShipmentinfo, Int64 ShipmentId)
        {
            List <dynamic> objDynamic = new List <dynamic>();

            OrderShipmentInfoDTO orderShipmentInfoDTO = new OrderShipmentInfoDTO();

            OrderShipmentComman orderShipmentInfoUI = new OrderShipmentComman();
            int orddetid = 0;

            if (!string.IsNullOrEmpty(strOrderShipmentinfo.Ordershipmentinfo))
            {
                var Data = JsonConvert.DeserializeObject <List <OrderShipmentComman> >(strOrderShipmentinfo.Ordershipmentinfo);
                for (int i = 0; i < Data.Count; i++)
                {
                    orderShipmentInfoUI = Data[i];

                    if (orderShipmentInfoUI.ShipmentInfoId != 0)
                    {
                        orderShipmentInfoDTO.ShipmentInfoId = orderShipmentInfoUI.ShipmentInfoId;
                    }
                    if (orderShipmentInfoUI.CarrierIdx != 0)
                    {
                        orderShipmentInfoDTO.CarrierId = orderShipmentInfoUI.CarrierIdx;
                    }
                    if (!string.IsNullOrEmpty(orderShipmentInfoUI.Waybill))
                    {
                        orderShipmentInfoDTO.Waybill = orderShipmentInfoUI.Waybill;
                    }
                    if (ShipmentId != 0)
                    {
                        orderShipmentInfoDTO.ShipmentId = ShipmentId;
                    }
                    if (orderShipmentInfoUI.DeliveryDate != null)
                    {
                        orderShipmentInfoDTO.DeliveryDateDB = DateTime.Parse(orderShipmentInfoUI.DeliveryDate);
                    }
                    else
                    {
                        orderShipmentInfoDTO.DeliveryDateDB = null;
                    }

                    orderShipmentInfoDTO.isActive = strOrderShipmentinfo.isActive;
                    orderShipmentInfoDTO.Type     = strOrderShipmentinfo.Type;

                    CRUDOrderShipmentInfo(orderShipmentInfoDTO);
                }
                objDynamic.Add(orddetid);
            }
            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);
        }