protected void Page_Load(object sender, EventArgs e) { Title = "Search Events"; var objmaster = (Customer_CustomerMaster)Master; objmaster.SetBreadcrumb = "<a href=\"/App/Customer/HomePage.aspx\">Home</a>"; objmaster.SetPageView("EventRegistration"); if (!IsPostBack) { ViewState["SortExp"] = "Distance"; ViewState["SortDir"] = SortDirection.Ascending; var customerEventRegistrationViewDataRepository = new CustomerEventRegistrationViewDataRepository(); var customerEventRegistrationSummary = customerEventRegistrationViewDataRepository.GetCustomerEventRegistrationViewData(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId); if (customerEventRegistrationSummary != null && customerEventRegistrationSummary.Count > 0) { txtZip.Text = customerEventRegistrationSummary.Select(s => s.EventAddress.ZipCode.Zip).First(); } else { var customerRepository = IoC.Resolve <ICustomerRepository>(); var customer = customerRepository.GetCustomer(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId); txtZip.Text = customer.Address.ZipCode.Zip; } SearchEvent(); } if (Request.Params["__EVENTTARGET"] == "VerifyInvitationCode") { VerifyInvitation(Request.Params["__EVENTARGUMENT"]); } }
/// <summary> /// Prepare the data table and Load the grid /// </summary> /// <param name="customerid"></param> private void LoadGrid(long customerid) { var customerEventRegistrationViewDataRepository = new CustomerEventRegistrationViewDataRepository(); var customerEventRegistrationSummary = customerEventRegistrationViewDataRepository.GetCustomerEventRegistrationViewData(customerid); var dteventcustomer = new DataTable(); dteventcustomer.Columns.Add("EventName"); dteventcustomer.Columns.Add("EventID"); dteventcustomer.Columns.Add("HostName"); dteventcustomer.Columns.Add("Address"); dteventcustomer.Columns.Add("Appointment"); dteventcustomer.Columns.Add("RegisterDate"); dteventcustomer.Columns.Add("ShowUp"); dteventcustomer.Columns.Add("Package"); dteventcustomer.Columns.Add("PackageTest"); dteventcustomer.Columns.Add("TestResult"); dteventcustomer.Columns.Add("Cost"); dteventcustomer.Columns.Add("Coupon"); dteventcustomer.Columns.Add("Discount"); dteventcustomer.Columns.Add("Payment"); dteventcustomer.Columns.Add("IsPaid"); dteventcustomer.Columns.Add("EventCustomerID"); dteventcustomer.Columns.Add("EventDate"); dteventcustomer.Columns.Add("UserAddress"); dteventcustomer.Columns.Add("City"); dteventcustomer.Columns.Add("PackageID"); dteventcustomer.Columns.Add("State"); dteventcustomer.Columns.Add("ZipCode"); dteventcustomer.Columns.Add("AppointmentID"); dteventcustomer.Columns.Add("TestResultReady"); dteventcustomer.Columns.Add("TempHostAddress"); dteventcustomer.Columns.Add("TempHostCityStateZip"); dteventcustomer.Columns.Add("NetPayment"); dteventcustomer.Columns.Add("AssociatedPhoneNumber"); dteventcustomer.Columns.Add("IsAuthorized"); dteventcustomer.Columns.Add("DisplayResultPDF", typeof(bool)); dteventcustomer.Columns.Add("EventStatus"); dteventcustomer.Columns.Add("GoogleMap"); dteventcustomer.Columns.Add("PackageContainsColorectal", typeof(bool)); dteventcustomer.Columns.Add("ColoractelDisplayHTMLString"); dteventcustomer.Columns.Add("TotalAmount"); dteventcustomer.Columns.Add("OrderId"); dteventcustomer.Columns.Add("ShippingDetail"); dteventcustomer.Columns.Add("TotalPayment"); dteventcustomer.Columns.Add("TotalShippingAmount"); dteventcustomer.Columns.Add("ActiveOrderDetailId"); string phonenumber = ucHPBanner.LoadBanner(); foreach (var customerEventRegistration in customerEventRegistrationSummary) { string couponcode = "-N/A-"; string couponamout = string.Empty; if (customerEventRegistration.SourceCodeId != 0) { couponcode = customerEventRegistration.SourceCode + "/"; couponamout = customerEventRegistration.SourceCodeDiscount.ToString("C2"); } string showup; var dtEventDate = customerEventRegistration.EventDate; var dt = new DateTime(dtEventDate.Year, dtEventDate.Month, dtEventDate.Day); var dt2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day); //System.TimeSpan diffResult = dtEventDate - DateTime.Now; TimeSpan diffResult = dt - dt2; if (diffResult.Days > 0) { showup = "Upcoming"; } else if (diffResult.Days == 0) { showup = "InProgress"; } else { showup = "Completed"; } const string payment = "Pending"; var bolIsPaid = customerEventRegistration.IsPaid; //// Fill the Tests details of package #region Package Test string strTests = "No information avaialable"; Package packageDetail = null; if (customerEventRegistration.PackageId > 0) { packageDetail = IoC.Resolve <IPackageRepository>().GetById(customerEventRegistration.PackageId); } //toDO: this need get from view const string strTestheader = "<Table><tr><td style='color:#333'> Available Test</td></tr>"; const string strTestFooter = "</table>"; string strTestBody = ""; if (packageDetail != null) { strTestBody = packageDetail.Tests.Aggregate(strTestBody, (current, test) => current + "<tr><td>• " + test.Name + "</td></tr>"); } strTests = strTestheader + strTestBody + strTestFooter; #endregion #region Test Result string strTestsResult; if (customerEventRegistration.IsResultReady) { //string key = EPDFType.Clinical_Form + "~" + Convert.ToString(customerEventRegistration.EventId) + "~" + CustomerId + "~" + "SINGLE"; //key = new DigitalDeliveryCryptographyService().Encrypt(key); //strTestsResult = "<a href=\"javascript:showClinicalForm('" + key + "')\">Available Online</a>"; strTestsResult = "<a href=\"/App/Common/Results.aspx?EventId=" + customerEventRegistration.EventId + "&CustomerId=" + CustomerId + "\" target=\"_blank\">Available Online</a>"; } else { strTestsResult = " <span style='font-weight:bold; color:#ff6600;'>Not Yet Available</span>"; } #endregion // get event status var eventStatusString = GetEventStatus((int)customerEventRegistration.EventStatus, customerEventRegistration.EventDate); var googleMapAddressAndLink = CommonCode.GetGoogleMapAddress(customerEventRegistration.EventAddress.StreetAddressLine1, customerEventRegistration.EventAddress.City, customerEventRegistration.EventAddress.State, customerEventRegistration.EventAddress.ZipCode.Zip, customerEventRegistration.EventAddress.Latitude + "," + customerEventRegistration.EventAddress.Longitude, customerEventRegistration.EventAddress.LatLogUseForAddressMaping); bool isPackageWithColoractel = IsPackagewithColoractel(customerEventRegistration.PackageId); string htmlForColoractelDisplay; if (customerEventRegistration.IsColoractelResultReady) { htmlForColoractelDisplay = "<span style='font-weight:bold; color:#ff6600;' title='Details |" + TipMessageForCrcReady + "' class='ready-crcstatus-tip'>Ready</span>"; } else { htmlForColoractelDisplay = "<span style='font-weight:normal;'>Not Ready</span>"; } dteventcustomer.Rows.Add(new object[] { customerEventRegistration.EventName, customerEventRegistration.EventId, customerEventRegistration.HostOrganizationName, customerEventRegistration.EventAddress.ToString(), customerEventRegistration.AppointmentStartTime.ToShortTimeString(), String.Format("{0:MM/dd/yyyy}", customerEventRegistration.EventSignupDate), showup, customerEventRegistration.PackageName, strTests, strTestsResult, customerEventRegistration.PackagePrice.ToString("C2"), couponcode, couponamout, payment, bolIsPaid, customerEventRegistration.EventCustomerId, String.Format("{0:MM/dd/yyyy}", customerEventRegistration.EventDate), " objeventcustomer[icount].Customer.User.HomeAddress.Address1", " objeventcustomer[icount].Customer.User.HomeAddress.City", customerEventRegistration.PackageId, "objeventcustomer[icount].Customer.User.HomeAddress.State", "objeventcustomer[icount].Customer.User.HomeAddress.Zip", customerEventRegistration.AppointmentId, customerEventRegistration.IsResultReady, "objeventcustomer[icount].Customer.User.HomeAddress.Address1", "City,state,zip", ////"objeventcustomer[icount].Customer.User.HomeAddress.City +" "+objeventcustomer[icount].Customer.User.HomeAddress.State + " "+objeventcustomer[icount].Customer.User.HomeAddress.Zip", customerEventRegistration.TotalPayment, phonenumber, customerEventRegistration.IsAuthorized, customerEventRegistration.IsResultPdfgenerated, eventStatusString, googleMapAddressAndLink, isPackageWithColoractel, htmlForColoractelDisplay, customerEventRegistration.EffectiveOrderPrice, customerEventRegistration.OrderId, customerEventRegistration.IsShippingApplied, customerEventRegistration.TotalPayment, customerEventRegistration.TotalShippingCost, customerEventRegistration.OrderDetailId }); } //} if (dteventcustomer.Rows.Count > 0) { ViewState["DSGRD"] = dteventcustomer; FillEvent(dteventcustomer); dvNoItemFound.Style["display"] = "none"; } else { dvNoItemFound.Style["display"] = "block"; } }