protected void imgNext_Click(object sender, ImageClickEventArgs e)
        {
            var eventId = Convert.ToInt64(hfEventID.Value);

            EventId = eventId;

            if (!(Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No"))
            {
                if (CallId != null)
                {
                    var repository = new CallCenterCallRepository();
                    repository.UpdateEventforaCall(eventId, CallId.Value);
                }
            }

            if (rbtReportMailY.Checked && Convert.ToInt64(hfResultOrderID.Value) > 0)
            {
                ShippingOptionId = Convert.ToInt64(hfResultOrderID.Value);
                var shippingAddress = ShippingOtion.SaveShippingAddress();
                if (shippingAddress != null)
                {
                    ShippingAddressId = shippingAddress.Id;
                }
                else
                {
                    return;
                }
            }
            else
            {
                RegistrationFlow.ShippingAddressId = 0;
                RegistrationFlow.ShippingOptionId  = 0;
            }
            if (RegistrationFlow == null || RegistrationFlow.ShippingOptionId <= 0)
            {
                Response.RedirectUser("/App/CallCenter/CallCenterRep/AddNotes.aspx?guid=" + GuId);
            }

            if (Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No")
            {
                Response.RedirectUser("SendReportStep3.aspx?Call=No&CustomerID=" + CustomerId + "&guid=" + GuId);
            }
            else
            {
                Response.RedirectUser("SendReportStep3.aspx?guid=" + GuId);
            }
            //Response.RedirectUser("SendReportStep3.aspx");
        }
Exemple #2
0
        protected void imgNext_Click(object sender, ImageClickEventArgs e)
        {
            var orderRepository = IoC.Resolve <IOrderRepository>();
            var order           = orderRepository.GetOrderByEventCustomerId(Convert.ToInt64(hfEventcustomerID.Value));
            var orderDetail     = order.OrderDetails.SingleOrDefault(od => (od.DetailType == OrderItemType.EventPackageItem || od.DetailType == OrderItemType.EventTestItem) &&
                                                                     od.EventCustomerOrderDetail != null && od.EventCustomerOrderDetail.IsActive && od.IsCompleted);

            var shippingDetailRepository = IoC.Resolve <IShippingDetailRepository>();

            var resultShippingDetails = shippingDetailRepository.GetShippingDetailsForCancellation(orderDetail.Id);
            var cdShippingDetails     = shippingDetailRepository.GetProductShippingDetailsForCancellation(orderDetail.Id);

            resultShippingDetails = resultShippingDetails.Where(sd => sd.Status == ShipmentStatus.Processing).Select(sd => sd).ToArray();
            //cdShippingDetails = cdShippingDetails.Where(sd => sd.Status == ShipmentStatus.Processing).Select(sd => sd).ToArray();


            if (Convert.ToInt64(hfResultOrderID.Value) > 0 && resultShippingDetails.Count() > 0)//&& (cdShippingDetails == null || (cdShippingDetails.Count() < resultShippingDetails.Count()))
            {
                ErrorDiv.InnerText = "There is already an unprocessed shipping request in your order. Duplicate shipping cannot be added till this shipping request is processed. Proceed with the default selection to add a product or contact your admin.";
                ErrorDiv.Style.Add(HtmlTextWriterStyle.Display, "block");
                return;
            }
            if (Convert.ToInt64(hfResultOrderID.Value) <= 0 && !cdShippingDetails.IsNullOrEmpty() && resultShippingDetails.Count() == 0)
            {
                ErrorDiv.InnerText = "To send an additional copy of Images to the customer, you need to select any one of the shipping options.";
                ErrorDiv.Style.Add(HtmlTextWriterStyle.Display, "block");
                return;
            }

            var eventId = Convert.ToInt64(hfEventID.Value);

            EventId = eventId;

            if (!(Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No"))
            {
                if (CallId != null)
                {
                    var repository = new CallCenterCallRepository();
                    repository.UpdateEventforaCall(eventId, CallId.Value);
                }
            }

            if (ProductOption.IsProductSelected && ProductOption.ProductId > 0)
            {
                ProductId = ProductOption.ProductId;
            }
            else
            {
                ProductId = null;
            }

            if (Convert.ToInt64(hfResultOrderID.Value) > 0)
            {
                var address = ResultOtion.SaveShippingAddress();
                ShippingAddressId = address.Id;
                ShippingOptionId  = Convert.ToInt64(hfResultOrderID.Value);
            }
            else
            {
                ShippingAddressId = null;
                ShippingOptionId  = null;
            }

            if (ProductId == null)
            {
                if (CurrentOrgRole.CheckRole((long)Roles.Technician) || CurrentOrgRole.CheckRole((long)Roles.NursePractitioner) || CurrentOrgRole.CheckRole((long)Roles.FranchisorAdmin))
                {
                    Response.RedirectUser(ViewState["UrlReferer"].ToString());
                }
                Response.RedirectUser("/App/CallCenter/CallCenterRep/AddNotes.aspx?guid=" + GuId);
            }
            else
            {
                if (CurrentOrgRole.CheckRole((long)Roles.Technician) || CurrentOrgRole.CheckRole((long)Roles.NursePractitioner) || CurrentOrgRole.CheckRole((long)Roles.FranchisorAdmin))
                {
                    Session["c_url"] = ViewState["UrlReferer"].ToString();
                    Response.RedirectUser("/App/Franchisee/Technician/MakePaymentforAddonProduct?id=" + CustomerId + "&guid=" + GuId);
                }

                if (Request.QueryString["Call"] != null && Request.QueryString["Call"] == "No")
                {
                    Response.RedirectUser("SendReportStep3.aspx?Call=No&CustomerID=" + CustomerId + "&guid=" + GuId);
                }
                else
                {
                    Response.RedirectUser("SendReportStep3.aspx?guid=" + GuId);
                }
            }
        }