private void FillFranchisorData() { Int32 userid = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.UserId); Int32 shellid = Convert.ToInt32(IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationId); // format phone no. CommonCode objCommonCode = new CommonCode(); FranchisorDAL franchisorDAL = new FranchisorDAL(); var franchisoruser = franchisorDAL.GetFranchisorUser(shellid.ToString(), userid.ToString(), 1); if (franchisoruser != null) { name.InnerText = franchisoruser[0].User.FirstName + " " + franchisoruser[0].User.MiddleName + " " + franchisoruser[0].User.LastName; spfrnchname.InnerText = franchisoruser[0].User.FirstName; spfrnchmname.InnerText = franchisoruser[0].User.MiddleName; spfrnchLname.InnerText = franchisoruser[0].User.LastName; DateTime DOB = Convert.ToDateTime(franchisoruser[0].User.DOB); dvRole.InnerText = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleDisplayName; spaddress1.InnerText = franchisoruser[0].Address.Address1; spaddress2.InnerText = franchisoruser[0].Address.Address2; spState.InnerText = franchisoruser[0].Address.State; spCountry.InnerText = franchisoruser[0].Address.Country; spCity.InnerText = franchisoruser[0].Address.City; spZip.InnerText = franchisoruser[0].Address.Zip; sptelHome.InnerText = objCommonCode.FormatPhoneNumberGet(franchisoruser[0].User.PhoneHome); sptelCell.InnerText = objCommonCode.FormatPhoneNumberGet(franchisoruser[0].User.PhoneCell); sptelOther.InnerText = objCommonCode.FormatPhoneNumberGet(franchisoruser[0].User.PhoneOffice); spemail1.InnerText = franchisoruser[0].User.EMail1; spemail2.InnerText = franchisoruser[0].User.EMail2; spdob.InnerText = DOB.ToString("MMMM dd, yyyy"); spssn.InnerText = franchisoruser[0].User.SSN; CommonCode objCCode = new CommonCode(); imgmyphto.ImageUrl = objCCode.GetPicture(Request.MapPath(franchisoruser[0].MyPicture), franchisoruser[0].MyPicture); imgmyteam.ImageUrl = objCCode.GetPicture(Request.MapPath(franchisoruser[0].TeamPicture), franchisoruser[0].TeamPicture); Ucimagelist1.Images = franchisoruser[0].OtherPictures; //var listImage = new List<string>(); //foreach (var strImage in franchisoruser[0].OtherPictures) //{ // listImage.Add(strImage); //} //Ucimagelist1.Images = listImage; spDesc.InnerText = franchisoruser[0].ShellDescription; } }
public string LoadBanner() { // format phone no. var objCommonCode = new CommonCode(); string serverName = ConfigurationManager.AppSettings["MMWebPath"]; string strServerImagePath = ConfigurationManager.AppSettings["MMVirtualPath"]; string strHPBanner; string strAssosiatedPhoneNumber = ""; strHPBanner = GetHPBannerForCustomer(intCustomerId, serverName, strServerImagePath, out strAssosiatedPhoneNumber); if (strHPBanner != string.Empty) { spHPBanner.InnerHtml = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode(strHPBanner, true); } else { const string imagePathUrl = "/Config/Content/Images/CustomerBanner.jpg"; if (File.Exists(Server.MapPath(imagePathUrl))) { spHPBanner.InnerHtml = System.Web.Security.AntiXss.AntiXssEncoder.HtmlEncode("<a href=\"SearchEvent.aspx\"><img src=\"" + imagePathUrl + "\"/></a>", true); } } return(objCommonCode.FormatPhoneNumberGet(strAssosiatedPhoneNumber)); }
void LoadGrid() { // format phone no. CommonCode objCommonCode = new CommonCode(); //FranchisorService service = new FranchisorService(); FranchisorDAL objFranchisorDal = new FranchisorDAL(); var currentSession = IoC.Resolve <ISessionContext>().UserSession; var listProspect = objFranchisorDal.GetUserProspect(string.Empty, Convert.ToInt32(currentSession.UserId), Convert.ToInt32(currentSession.CurrentOrganizationRole.RoleId), Convert.ToInt32(currentSession.CurrentOrganizationRole.OrganizationId), 0); EProspect[] arrProspect = null; if (listProspect != null) { arrProspect = listProspect.ToArray(); } if (arrProspect.Length > 0) { DataTable tblProspect = new DataTable(); tblProspect.Columns.Add("ProspectID", typeof(Int32)); tblProspect.Columns.Add("Name"); tblProspect.Columns.Add("Address"); tblProspect.Columns.Add("Phone"); tblProspect.Columns.Add("Email"); foreach (EProspect objProspect in arrProspect) { string address = objProspect.Address.Address1 + " " + objProspect.Address.City + " " + objProspect.Address.State + " " + objProspect.Address.Country + " " + objProspect.Address.ZipID.ToString(); tblProspect.Rows.Add(objProspect.ProspectID, objProspect.OrganizationName, address, objCommonCode.FormatPhoneNumberGet(objProspect.PhoneOffice), objProspect.EMailID); } //if ((SortDirection)ViewState["SortProspect"] == SortDirection.Descending) //{ // tblProspect.DefaultView.Sort = "name desc"; //} //else //{ // tblProspect.DefaultView.Sort = "name asc"; //} dgProspects.Visible = true; tblProspect = tblProspect.DefaultView.ToTable(); dgProspects.DataSource = tblProspect; ViewState["DSGRID"] = tblProspect; dgProspects.DataBind(); //errordiv.Visible = false; } else { dgProspects.Visible = false; errordiv.Visible = true; errordiv.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgNoRecordFound"); btnConvertHost.Enabled = false; btnDelete.Enabled = false; divGrdProspect.Visible = false; } }
/// <summary> /// Hides convert to host button for franchisor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdProspect_RowDataBound(object sender, GridViewRowEventArgs e) { // format phone no. CommonCode objCommonCode = new CommonCode(); if (FranchiseeView) { if (e.Row.RowType == DataControlRowType.DataRow) { var currentOrgRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole; if (currentOrgRole.CheckRole((long)Roles.FranchisorAdmin)) { var franchiseeName = e.Row.FindControl("spFranchisee") as HtmlContainerControl; franchiseeName.Style.Add(HtmlTextWriterStyle.Display, "block"); } else if (currentOrgRole.CheckRole((long)Roles.FranchiseeAdmin)) { var spanRateHost = e.Row.FindControl("HostRatingSpan") as HtmlContainerControl; if (spanRateHost != null) { spanRateHost.Style[HtmlTextWriterStyle.Display] = "block"; } } } } // Code to visible primary contact link if (e.Row.RowType == DataControlRowType.DataRow) { var googleAddressVerification = e.Row.FindControl("googleAddressVerification") as HtmlContainerControl; var spnName = (HtmlContainerControl)e.Row.FindControl("spnName"); var spnPhone = (HtmlContainerControl)e.Row.FindControl("spnPhone"); var spnEmail = (HtmlContainerControl)e.Row.FindControl("spnEmail"); var spnAddPrimaryContact = (HtmlContainerControl)e.Row.FindControl("spnAddPrimaryContact"); var divNamePhoneEmail = (HtmlContainerControl)e.Row.FindControl("divNamePhoneEmail"); if (googleAddressVerification != null) { } spnName.InnerText = spnName.InnerText.Trim(); spnPhone.InnerText = objCommonCode.FormatPhoneNumberGet(spnPhone.InnerText.Trim()); spnEmail.InnerText = spnEmail.InnerText.Trim(); if (spnName.InnerText.Equals("N/A") && spnPhone.InnerText.Equals("N/A") && spnEmail.InnerText.Equals("N/A")) { spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Display, "block"); spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Visibility, "visible"); // Hide all span divNamePhoneEmail.Style.Add(HtmlTextWriterStyle.Display, "none"); divNamePhoneEmail.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } else { spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Display, "none"); spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } } }
private void GetContactEIP() { //FranchisorUserService service = new FranchisorUserService(); //EFranchisorUser[] franchisoruser = service.ContactEIP(); // format phone no. CommonCode objCommonCode = new CommonCode(); FranchisorDAL franchisorDAL = new FranchisorDAL(); var listFranchisorUser = franchisorDAL.ContactEIP(); EFranchisorUser[] franchisoruser = null; if (listFranchisorUser != null) { franchisoruser = listFranchisorUser.ToArray(); } DataTable dtFranchisorUser = new DataTable(); dtFranchisorUser.Columns.Add("Name"); dtFranchisorUser.Columns.Add("Address"); dtFranchisorUser.Columns.Add("Country"); dtFranchisorUser.Columns.Add("PhoneDirect"); dtFranchisorUser.Columns.Add("PhoneOther"); dtFranchisorUser.Columns.Add("Email"); if (franchisoruser != null) { for (int icount = 0; icount < franchisoruser.Length; icount++) { string Name = CommonClass.FormatName(franchisoruser[icount].User.FirstName, "", franchisoruser[icount].User.LastName); string Address = CommonClass.FormatAddress(franchisoruser[icount].User.HomeAddress.Address1, franchisoruser[icount].User.HomeAddress.Address2, franchisoruser[icount].User.HomeAddress.City, franchisoruser[icount].User.HomeAddress.State, franchisoruser[icount].User.HomeAddress.Zip); dtFranchisorUser.Rows.Add(new object[] { Name, Address, franchisoruser[icount].User.HomeAddress.Country, objCommonCode.FormatPhoneNumberGet(franchisoruser[icount].User.PhoneCell), objCommonCode.FormatPhoneNumberGet(franchisoruser[icount].User.PhoneOffice), franchisoruser[icount].User.EMail1 }); } } switch ((SortDirection)ViewState["SortContact"]) { case SortDirection.Descending: dtFranchisorUser.DefaultView.Sort = "name desc"; break; default: dtFranchisorUser.DefaultView.Sort = "name asc"; break; } dtFranchisorUser = dtFranchisorUser.DefaultView.ToTable(); ViewState["DSGRID"] = dtFranchisorUser; gridcontacteip.DataSource = dtFranchisorUser; gridcontacteip.DataBind(); }
protected void _eventCustomerGrid_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { var eventCustomer = e.Row.DataItem as EventCustomerRegistrationViewData; if (eventCustomer != null) { // format phone no. CommonCode objCommonCode = new CommonCode(); var phoneSpan = e.Row.FindControl("spPhone") as HtmlContainerControl; if (objCommonCode.FormatPhoneNumberGet(eventCustomer.PhoneNumber).Length > 0) { phoneSpan.InnerText = "PH:" + objCommonCode.FormatPhoneNumberGet(eventCustomer.PhoneNumber); } string customerFullName = !string.IsNullOrEmpty(eventCustomer.MiddleName) ? eventCustomer.FirstName + " " + eventCustomer.MiddleName + " " + eventCustomer.LastName : eventCustomer.FirstName + " " + eventCustomer.LastName; string currentRowIndex = (e.Row.DataItemIndex + 2) < 10 ? "ctl0" + Convert.ToString(e.Row.DataItemIndex + 2) : "ctl" + Convert.ToString(e.Row.DataItemIndex + 2); var appointmentTime = e.Row.FindControl("_appointmentTimeLiteral") as Literal; var statusSpan = e.Row.FindControl("spStatus") as HtmlContainerControl; var checkInFilledSpan = e.Row.FindControl("spfiledcheckin") as HtmlContainerControl; var actionSpan = e.Row.FindControl("spAction") as HtmlContainerControl; if (appointmentTime != null) { var appointmentString = string.Format("{0:hh:mm tt}", eventCustomer.AppointmentStartTime); if (eventCustomer.RoomSlots != null && eventCustomer.RoomSlots.Any()) { var roomSlotString = "<hr />"; foreach (var roomSlot in eventCustomer.RoomSlots) { roomSlotString += roomSlot.FirstValue + " - " + roomSlot.SecondValue.ToShortTimeString() + "<br />"; } appointmentString += roomSlotString; } appointmentTime.Text = appointmentString; } var customerId = eventCustomer.CustomerId; var order = GetCurrentOrder(customerId); var packageNameLiteral = e.Row.FindControl("PackageNameLiteral") as Literal; if (packageNameLiteral != null) { if (!string.IsNullOrEmpty(eventCustomer.PackageName) && !string.IsNullOrEmpty(eventCustomer.AdditinalTest)) { packageNameLiteral.Text = eventCustomer.PackageName + ", " + eventCustomer.AdditinalTest; } else { packageNameLiteral.Text = !string.IsNullOrEmpty(eventCustomer.PackageName) ? eventCustomer.PackageName : eventCustomer.AdditinalTest; } } // TODO: Problem lies in DAL mapped to wrong field. long eventCustomerId = eventCustomer.EventCustomerId; long appiontmentId = eventCustomer.AppointmentId; /* When appointmentslot is not allocated to a customer ********* */ if (eventCustomerId == 0) { var customerDetailSpan = e.Row.FindControl("spcustomerdetail") as HtmlContainerControl; // Case added when a slot is blocked then link should be disable string prepareAction = "<span style=\"width:110px; float:left;\">"; if (statusSpan != null && eventCustomer.AppointmentSlotStatus == AppointmentSlotStatus.Blocked) { statusSpan.InnerText = "Blocked"; } else if (statusSpan != null) { statusSpan.InnerText = "Open"; prepareAction += " <a id='" + currentRowIndex + "_Block' href=\"javascript:OpenPopUp('/App/Common/BlockSlot.aspx?AppointmentID=" + appiontmentId + "&keepThis=true&TB_iframe=true&width=270&height=200&modal=true')\" class='thickbox'>Block</a> | "; } prepareAction += " <a id='" + currentRowIndex + "_Delete' href=\"javascript:DeleteAppointment('" + appiontmentId + "');\">Delete</a> "; if (actionSpan != null) { actionSpan.InnerHtml = prepareAction; } if (customerDetailSpan != null) { customerDetailSpan.InnerHtml = eventCustomer.AppointmentBlockReason; } if (checkInFilledSpan != null) { checkInFilledSpan.InnerText = "N/A"; } return; } var acceptanceDetailSpan = e.Row.FindControl("spAcctDetail") as HtmlContainerControl; var appointmentDetailsSpan = e.Row.FindControl("spApptDetail") as HtmlContainerControl; if (acceptanceDetailSpan != null) { acceptanceDetailSpan.Style[HtmlTextWriterStyle.Display] = "block"; } if (appointmentDetailsSpan != null) { appointmentDetailsSpan.Style[HtmlTextWriterStyle.Display] = "block"; } var customerDetailAnchor = e.Row.FindControl("aCustomerDetail") as HtmlAnchor; var customerEditAnchor = e.Row.FindControl("CustomerEdit") as HtmlAnchor; if (customerDetailAnchor != null && customerEditAnchor != null) { var currentOrgRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole; if (currentOrgRole.CheckRole((long)Roles.FranchisorAdmin)) { customerEditAnchor.HRef = "~/App/Franchisor/FranchisorEditCustomer.aspx?CustomerID=" + eventCustomer.CustomerId + "&Master=EventCustomerList"; customerDetailAnchor.HRef = "/App/Franchisor/FranchisorCustomerDetails.aspx?CustomerID=" + eventCustomer.CustomerId; } else if (currentOrgRole.CheckRole((long)Roles.FranchiseeAdmin)) { customerEditAnchor.HRef = "~/App/Franchisee/FranchiseeEditCustomer.aspx?CustomerID=" + eventCustomer.CustomerId + "&Master=EventCustomerList"; customerDetailAnchor.HRef = "/App/Franchisee/FranchiseeCustomerDetails.aspx?CustomerID=" + eventCustomer.CustomerId; } else if (currentOrgRole.CheckRole((long)Roles.SalesRep)) { customerEditAnchor.HRef = "javascript:void(0);"; customerDetailAnchor.HRef = "javascript:void(0);"; } } var customerNameLiteral = e.Row.FindControl("_customerNameLiteral") as Literal; if (customerNameLiteral != null) { customerNameLiteral.Text = customerFullName; } var customerIdLiteral = e.Row.FindControl("_customerIdLiteral") as Literal; if (customerIdLiteral != null) { customerIdLiteral.Text = eventCustomer.CustomerId.ToString(); } string userDateApplied = (eventCustomer.UserCreatedOn != default(DateTime)) ? eventCustomer.UserCreatedOn.ToString("MM/dd/yyyy") : string.Empty; var userCreatedDateLiteral = e.Row.FindControl("_userCreatedDateLiteral") as Literal; if (userCreatedDateLiteral != null) { userCreatedDateLiteral.Text = userDateApplied; } var couponCodeLiteral = e.Row.FindControl("_couponCodeLiteral") as Literal; var couponCode = GetCouponCode(); if (couponCodeLiteral != null) { couponCodeLiteral.Text = couponCode == "(0.00)" ? "-N/A-" : couponCode; } var paymentDetailLiteral = e.Row.FindControl("_paymentDetailLiteral") as Literal; if (paymentDetailLiteral != null && order != null) { paymentDetailLiteral.Text = order.DiscountedTotal.ToString("C2"); } /* When appointment slot is allocated to a customer ************ */ var checkInTempSpan = e.Row.FindControl("spCheckInInsert") as HtmlContainerControl; var checkOutTempSpan = e.Row.FindControl("spCheckOutInsert") as HtmlContainerControl; if (order != null && order.DiscountedTotal > order.TotalAmountPaid) { statusSpan.InnerText = "Not Paid"; } else { statusSpan.InnerText = "Paid"; } bool isTimeSaved = eventCustomer.CheckInTime.HasValue && eventCustomer.CheckOutTime.HasValue; if (isTimeSaved) { checkInTempSpan.InnerText = eventCustomer.CheckInTime.HasValue ? eventCustomer.CheckInTime.Value.ToShortTimeString() : ""; checkOutTempSpan.InnerText = eventCustomer.CheckOutTime.HasValue ? eventCustomer.CheckOutTime.Value.ToShortTimeString() : ""; checkInFilledSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); } else { checkInFilledSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); } } } }
private void GetContactMedicalVendor() { // format phone no. CommonCode objCommonCode = new CommonCode(); var sessionContext = IoC.Resolve <SessionContext>().UserSession; var medicalVendorDal = new MedicalVendorDAL(); List <EMVMVUser> medicalVendorAdmin = medicalVendorDal.GetMedicalVendorAdmin(sessionContext.CurrentOrganizationRole.OrganizationId.ToString(), 2); var dataSource = new DataTable(); dataSource.Columns.Add("MVMVUserID"); dataSource.Columns.Add("Name"); dataSource.Columns.Add("Address"); dataSource.Columns.Add("Phone"); dataSource.Columns.Add("Email"); if (medicalVendorAdmin != null) { for (int index = 0; index < medicalVendorAdmin.Count; index++) { string formatName = CommonClass.FormatName(medicalVendorAdmin[index].MVUser.User.FirstName, medicalVendorAdmin[index].MVUser.User.MiddleName, medicalVendorAdmin[index].MVUser.User.LastName); string formatAddress = CommonClass.FormatAddress(medicalVendorAdmin[index].MedicalVendor.BusinessAddress.Address1, medicalVendorAdmin[index].MedicalVendor.BusinessAddress.Address2, medicalVendorAdmin[index].MedicalVendor.BusinessAddress.City, medicalVendorAdmin[index].MedicalVendor.BusinessAddress.State, medicalVendorAdmin[index].MedicalVendor.BusinessAddress.Zip); dataSource.Rows.Add(new object[] { medicalVendorAdmin[index].MedicalVendorMVUserID, formatName, formatAddress, objCommonCode.FormatPhoneNumberGet(medicalVendorAdmin[index].MedicalVendor.BusinessPhone), medicalVendorAdmin[index].MVUser.User.EMail1 }); } } gridcontactfranchisee.DataSource = dataSource; gridcontactfranchisee.DataBind(); }
//public void LoadEventSummaryPanel(EEvent eventData) public void LoadEventSummaryPanel(EventMetricsViewData eventMetricsViewData, EventHostViewData eventHostViewData, EEvent eventPodDetails) { if (eventMetricsViewData == null || eventHostViewData == null) { return; } // format phone no. var commonCode = new CommonCode(); string key = EPDFType.ResultPdf + "~" + eventHostViewData.EventId + "~0~" + "ALL"; key = _cryptographyService.Encrypt(key); aPrintBulkResult.HRef = "javascript:showClinicalForm('" + key + "');"; key = EPDFType.ClinicalForm + "~" + eventHostViewData.EventId + "~0~" + "ALL"; key = _cryptographyService.Encrypt(key); aPrintBulkClinicalForm.HRef = "javascript:showClinicalForm('" + key + "');"; ancopenpopupaddslot.HRef = "/App/Common/AddSlot.aspx?EventDate=" + eventHostViewData.EventDate.ToShortDateString() + "&keepThis=true&TB_iframe=true&width=295&height=140&modal=true"; Session["EventID"] = eventHostViewData.EventId; ViewState["EventDate"] = eventHostViewData.EventDate; ViewState["EventName"] = eventHostViewData.Name; Session["EventDate"] = eventHostViewData.EventDate; Session["EventName"] = eventHostViewData.Name; if (Convert.ToDateTime(eventHostViewData.EventDate).Date > DateTime.Now.Date) { aResultStatus.Visible = false; //if (!eventPodDetails.IsTeamConfiguredOnEventDay) spIsTeamConfigured.Style[System.Web.UI.HtmlTextWriterStyle.Display] = "none"; } else { //if (!eventPodDetails.IsTeamConfiguredOnEventDay) spIsTeamConfigured.Style[System.Web.UI.HtmlTextWriterStyle.Display] = "block"; long shell = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.RoleId; if (shell == (int)Roles.FranchisorAdmin) { aResultStatus.HRef = "/App/Franchisor/EventCustomerResult.aspx?AllRecordsEventID=" + eventHostViewData.EventId; } else { aResultStatus.HRef = "/App/Franchisee/FranchiseeEventCustomerResult.aspx?AllRecordsEventID=" + eventHostViewData.EventId; } } speventdate.InnerText = Convert.ToDateTime(eventHostViewData.EventDate).ToShortDateString(); speventloc.InnerHtml = eventHostViewData.StreetAddressLine1 + ", " + eventHostViewData.City + ", " + eventHostViewData.State + ", " + eventHostViewData.Zip; sphostphone.InnerText = commonCode.FormatPhoneNumberGet(eventPodDetails.Host.PhoneOffice); ViewState["HostName"] = eventHostViewData.OrganizationName; ViewState["HostAddress"] = eventHostViewData.StreetAddressLine1; ViewState["HostCityStateZip"] = eventHostViewData.City + " " + eventHostViewData.State + " " + eventHostViewData.Zip; Session["HostName"] = eventHostViewData.OrganizationName; Session["HostAddress"] = eventHostViewData.StreetAddressLine1; Session["HostCityStateZip"] = eventHostViewData.City + " " + eventHostViewData.State + " " + eventHostViewData.Zip; spBPEIPDeposit.InnerText = decimal.Round((eventMetricsViewData.CashRevenue + eventMetricsViewData.CheckRevenue), 2).ToString(); spBPCashPayment.InnerText = decimal.Round(eventMetricsViewData.CashRevenue, 2).ToString(); spBPCardPayment.InnerText = decimal.Round(eventMetricsViewData.ChargeCardRevenue, 2).ToString(); spBPCheckPayment.InnerText = decimal.Round(eventMetricsViewData.CheckRevenue, 2).ToString(); spBPeCheckPayment.InnerText = decimal.Round(eventMetricsViewData.ECheckRevenue, 2).ToString(); decimal totalRevenue = eventMetricsViewData.ChargeCardRevenue + eventMetricsViewData.CheckRevenue + eventMetricsViewData.CashRevenue + eventMetricsViewData.ECheckRevenue + eventMetricsViewData.GiftCertificateRevenue + eventMetricsViewData.UnPaidExcluedeNoShowRevenue; spBPTotalPayment.InnerText = decimal.Round(totalRevenue, 2).ToString(); spBPEventID.InnerText = eventHostViewData.EventId.ToString(); lnkBPRegCustomer.Text = eventMetricsViewData.RegisteredCustomersCount.ToString(); spBPCanceledCustomer.InnerHtml = eventMetricsViewData.CancelledCustomersCount.ToString(); lnkBPNoshowCustomer.Text = eventMetricsViewData.NoShowCustomersCount.ToString(); lnkBPPaidCustomer.Text = eventMetricsViewData.PaidCustomersCount.ToString(); lnkBPUnpaidCustomer.Text = eventMetricsViewData.UnPaidCount.ToString(); lnkBPActCustomer.Text = eventMetricsViewData.AttendedCustomersCount.ToString(); lnkBPCardPaymentCount.Text = eventMetricsViewData.ChargeCardCount.ToString(); lnkBPCashPayment.Text = eventMetricsViewData.CashCount.ToString(); lnkBPCheckPayment.Text = eventMetricsViewData.CheckCount.ToString(); lnkBPeCheckPayment.Text = eventMetricsViewData.ECheckCount.ToString(); spPhoneCount.InnerText = decimal.Round(eventMetricsViewData.PhonePayments, 2).ToString(); lnkPhoneCount.Text = eventMetricsViewData.PhonePaymentCount.ToString(); spINetCount.InnerText = decimal.Round(eventMetricsViewData.InternetPayments, 2).ToString(); lnkInetCount.Text = eventMetricsViewData.InternetPaymentCount.ToString(); spOnsiteCount.InnerText = decimal.Round(eventMetricsViewData.OnsitePayments, 2).ToString(); lnkOnsiteCount.Text = eventMetricsViewData.OnsitePaymentCount.ToString(); spUpgradeCount.InnerText = decimal.Round(eventMetricsViewData.UpGradePayments, 2).ToString(); lnkUpgradeCount.Text = eventMetricsViewData.UpGradePaymentCount.ToString(); spDowngradeCount.InnerText = Convert.ToString(decimal.Round((eventMetricsViewData.DownGradePayments < 0 ? eventMetricsViewData.DownGradePayments * -1 : eventMetricsViewData.DownGradePayments), 2)); lnkDowngradeCount.Text = eventMetricsViewData.DownGradePaymentCount.ToString(); //TODO: Need to filter customers paid by GC // added giftCertificate _spnGcPaymentTotal.InnerText = decimal.Round(eventMetricsViewData.GiftCertificateRevenue, 2).ToString(); _lnkGcPaymentCount.Text = eventMetricsViewData.GiftCertificateCount.ToString(); sphostname.InnerText = eventHostViewData.OrganizationName; agmap.HRef = "http://maps.google.com/maps?f=q&hl=en&geocode=&q=" + eventHostViewData.StreetAddressLine1 + "," + eventHostViewData.City + "," + eventHostViewData.State + "," + eventHostViewData.Zip + "&ie=UTF8&z=16"; string poddetailstring = "N/A"; foreach (EEventPod objeventpod in eventPodDetails.EventPod) { if (poddetailstring == "N/A") { poddetailstring = ""; } string strpodteam = ""; string strpoddescription = ""; string vandescription = ""; strpoddescription = "<p class='roundarrowpopuprow_ecl'>Processing Capacity of " + objeventpod.Pod.PodProcessingCapacity.ToString() + " </p>"; vandescription = "<p class='roundarrowpopuprow_ecl'> Vehicle: " + objeventpod.Pod.Van.Name + "," + objeventpod.Pod.Van.Make + " (" + objeventpod.Pod.Van.VIN + ") </p>"; foreach (EFranchiseeFranchiseeUser objfranchiseefruser in objeventpod.Pod.TeamIDList) { strpodteam += "• " + objfranchiseefruser.FranchiseeUser.User.FirstName + " " + objfranchiseefruser.FranchiseeUser.User.MiddleName + " " + objfranchiseefruser.FranchiseeUser.User.LastName + "(" + objfranchiseefruser.RoleType + ")(" + objfranchiseefruser.FranchiseeFranchiseeUserID + ")<br />"; } string currentpod = "<div class='maindiv_roundmbox_ecl'><div class='innerdiv_roundmbox'><div class='lefttop_roundmbox'><img src='/App/Images/specer.gif' width='254' height='15' /></div><div class='midinner_roundmbox'>"; currentpod += "<p class='headertxt_roundmbox_ecl'>Pod Description</p><div class='divinnerbody_mbox'>"; currentpod += strpoddescription; currentpod += "<p><img src='/App/Images/specer.gif' width='220' height='5' /></p>" + vandescription; currentpod += "<p><img src='/App/Images/specer.gif' width='220' height='5' /></p><p class='roundarrowpopuprow_ecl'><u>Team Detail</u></p>"; currentpod += "<p><img src='/App/Images/specer.gif' width='220' height='5' /></p><div class='roundarrowpopuprow_ecl'>"; currentpod += strpodteam + "</div></div></div><div class='roundcornerbot_roundmbox'>"; currentpod += "<img src='/App/Images/specer.gif' width='254' height='15' /></div></div></div>"; poddetailstring = poddetailstring + objeventpod.Pod.Name + "<a href='javascript:void(0)' class='apd'> (More Info) <span class='tooltip'> " + currentpod + " </span> </a>"; aConfigureTeam.HRef = "javascript:OpenPopUp('/App/Franchisee/Technician/TeamConfiguration.aspx?EventID=" + eventHostViewData.EventId + "&PodID=" + objeventpod.Pod.PodID + "&EventDate=" + eventHostViewData.EventDate.ToShortDateString() + "');"; } sppoddetail.InnerHtml = poddetailstring; // BEGIN added upgrade/downgrade story(#7548) int totalCustomer = (eventMetricsViewData.PaidCustomersCount + eventMetricsViewData.UnPaidCount) - eventMetricsViewData.NoShowCustomersCount; _lnkAverageCustomers.Text = totalCustomer > 0 ? totalCustomer.ToString() : "0"; _spnAverageRevenueAmount.InnerHtml = totalCustomer > 0 ? decimal.Round((totalRevenue / totalCustomer), 2).ToString() : "0.00"; _spnUnpaidTotal.InnerHtml = decimal.Round(eventMetricsViewData.UnPaidExcluedeNoShowRevenue, 2).ToString(); _lnkUnpaidCount.Text = eventMetricsViewData.UnPaidExcluedeNoShowCount.ToString(); // END added upgrade/downgrade story(#7548) // Added HipaaStatus decimal _HipaapercentageDecimal; if (eventMetricsViewData.HipaaSignedCount > 0) { _HipaapercentageDecimal = Math.Round( Convert.ToDecimal(eventMetricsViewData.HipaaSignedCount) / Convert.ToDecimal(eventMetricsViewData.HipaaSignedCount + eventMetricsViewData.HipaaUnSignedCount) * 100, 2); if (_HipaapercentageDecimal > 0) { _spnHippaStatus.InnerText = Convert.ToString(_HipaapercentageDecimal) + "% " + "(" + eventMetricsViewData.HipaaSignedCount + "/" + (eventMetricsViewData.HipaaSignedCount + eventMetricsViewData.HipaaUnSignedCount) + ")"; } } else { _spnHippaStatus.InnerText = "0% (0/0)"; } }
private void SetCustomerDetails() { var customerRepository = IoC.Resolve <ICustomerRepository>(); var customer = customerRepository.GetCustomer(CustomerId); if (customer != null) { var objCCode = new CommonCode(); string userLogin = customer.UserLogin.UserName; string username = customer.Name.FullName; spdob.InnerText = customer.DateOfBirth != null?customer.DateOfBirth.Value.ToString("MM/dd/yyyy") : ""; spCustomerName.InnerText = username; spUserName.InnerText = userLogin; spEmail.InnerText = customer.Email != null?customer.Email.ToString() : ""; hfEmail.Value = customer.Email != null && customer.Email.ToString().Length > 0 ? "True" : "False"; spAddress.InnerText = CommonCode.AddressSingleLine(customer.Address.StreetAddressLine1, customer.Address.StreetAddressLine2, customer.Address.City, customer.Address.State, customer.Address.ZipCode.ToString()); spPhone.InnerText = customer.HomePhoneNumber != null && customer.HomePhoneNumber.ToString().Length > 0 ? objCCode.FormatPhoneNumberGet(customer.HomePhoneNumber.ToString()) : "-N/A-"; if (!string.IsNullOrEmpty(customer.UserLogin.HintQuestion)) { spHintSecurityQuestion.InnerText = customer.UserLogin.HintQuestion; spAnswer.InnerText = customer.UserLogin.HintAnswer.Length > 0 ? customer.UserLogin.HintAnswer : "-N/A-"; hfSecurityQustion.Value = "True"; } } }
private void GetFAUser() { FranchisorDAL franchisorDAL = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDAL.GetFranchisorFranchisorUser(IoC.Resolve <ISessionContext>().UserSession.UserId.ToString(), 3); EFranchisorFranchisorUser[] franchisoruser = null; // format phone no. CommonCode objCommonCode = new CommonCode(); if (listFranchisorFranchisorUser != null) { franchisoruser = listFranchisorFranchisorUser.ToArray(); } DataTable dtFAUser = new DataTable(); dtFAUser.Columns.Add("FranchisorFranchisorUserID"); dtFAUser.Columns.Add("name"); dtFAUser.Columns.Add("address"); dtFAUser.Columns.Add("phonecell"); dtFAUser.Columns.Add("UserID"); string strAddress = string.Empty; if (franchisoruser != null) { for (int icount = 0; icount < franchisoruser.Length; icount++) { strAddress = Falcon.App.Lib.CommonCode.AddressSingleLine(franchisoruser[icount].FranchisorUser.User.HomeAddress.Address1, franchisoruser[icount].FranchisorUser.User.HomeAddress.Address2, franchisoruser[icount].FranchisorUser.User.HomeAddress.City, franchisoruser[icount].FranchisorUser.User.HomeAddress.State, franchisoruser[icount].FranchisorUser.User.HomeAddress.Zip); dtFAUser.Rows.Add(new object[] { franchisoruser[icount].FranchisorFranchisorUserID, franchisoruser[icount].FranchisorUser.User.FirstName + " " + franchisoruser[icount].FranchisorUser.User.LastName, strAddress, objCommonCode.FormatPhoneNumberGet(franchisoruser[icount].FranchisorUser.User.PhoneCell.ToString()), franchisoruser[icount].FranchisorUser.User.UserID.ToString() }); } } if ((SortDirection)ViewState["SortFAUser"] == SortDirection.Descending) { dtFAUser.DefaultView.Sort = "name desc"; } else { dtFAUser.DefaultView.Sort = "name asc"; } dtFAUser = dtFAUser.DefaultView.ToTable(); grdFAUser.DataSource = dtFAUser; ViewState["DSGRID"] = dtFAUser; grdFAUser.DataBind(); //grdFAUser.Sort("name", SortDirection.Ascending);//always sorts in descending order. hfFranchisorUserID.Value = ""; }
private void FillMvUserData() { // format phone no. CommonCode objCommonCode = new CommonCode(); long physicianId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId; ITestRepository testRepository = new TestRepository(); IPhysicianRepository physicianRepository = new PhysicianRepository(); var medicalVendorDal = new MedicalVendorDAL(); bool allowAuthorizations; bool allowEvaluations; //TODO: To Repair medicalVendorDal.GetMVUserFunctionalities(physicianId, out allowAuthorizations, out allowEvaluations); decimal currentPayrate = 0.00M; if (allowEvaluations) { currentPayrate = physicianRepository.GetCurrentPayrate(physicianId); List <Test> tests = testRepository.GetPermittedTestsForaPhysician(physicianId); CurrentPayrateSpan.InnerHtml = string.Format("{0:c}", currentPayrate); PermittedTestsRepeater.DataSource = tests.OrderBy(t => t.Name); PermittedTestsRepeater.DataBind(); } List <EMVMVUser> medicalVendorUserProfile = medicalVendorDal.GetMedicalVendorMedicalVendorUserProfile(IoC.Resolve <ISessionContext>().UserSession.UserId.ToString(), 1); vendorname.InnerText = medicalVendorUserProfile[0].MedicalVendor.BusinessName; name.InnerText = medicalVendorUserProfile[0].MVUser.User.FirstName + " " + medicalVendorUserProfile[0].MVUser.User.MiddleName + " " + medicalVendorUserProfile[0].MVUser.User.LastName; fname.InnerText = medicalVendorUserProfile[0].MVUser.User.FirstName; mname.InnerText = medicalVendorUserProfile[0].MVUser.User.MiddleName; lname.InnerText = medicalVendorUserProfile[0].MVUser.User.LastName; if (medicalVendorUserProfile[0].MVUser.Resume != "") { aDwnResume.HRef = medicalVendorUserProfile[0].MVUser.Resume; aDwnResume.Disabled = false; } else { aDwnResume.Disabled = true; } if (medicalVendorUserProfile[0].MVUser.DigitalSignature != "") { aDwnSign.Disabled = false; aDwnSign.HRef = medicalVendorUserProfile[0].MVUser.DigitalSignature; } else { aDwnSign.Disabled = true; } specialization.InnerText = medicalVendorUserProfile[0].MVUser.MVUserSpecialization.Name; classification.InnerText = medicalVendorUserProfile[0].MVUser.MVUserClassification.Name; DateTime DOB = Convert.ToDateTime(medicalVendorUserProfile[0].MVUser.User.DOB); // DateTime DOA = Convert.ToDateTime(mvmvuser[0]reateDate); address1.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Address1; address2.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Address2; state.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.State; country.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.Country; city.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.City; zip.InnerText = medicalVendorUserProfile[0].MVUser.User.HomeAddress.ZipID.ToString(); phonehome.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneHome); phonecell.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneCell); phoneother.InnerText = objCommonCode.FormatPhoneNumberGet(medicalVendorUserProfile[0].MVUser.User.PhoneOffice); email1.InnerText = medicalVendorUserProfile[0].MVUser.User.EMail1; email2.InnerText = medicalVendorUserProfile[0].MVUser.User.EMail2; dob.InnerText = DOB.ToString("MMMM dd, yyyy"); ssn.InnerText = medicalVendorUserProfile[0].MVUser.User.SSN; var objCCode = new CommonCode(); imgmyphto.ImageUrl = objCCode.GetPicture(Request.MapPath(medicalVendorUserProfile[0].MVUser.MyPicture), medicalVendorUserProfile[0].MVUser.MyPicture); if (medicalVendorUserProfile[0].MVUser.References.Count <= 0) { refname1.InnerText = ""; refemail1.InnerText = ""; refname2.InnerText = ""; refemail2.InnerText = ""; refname3.InnerText = ""; refemail3.InnerText = ""; } if (medicalVendorUserProfile[0].MVUser.References.Count == 1) { refname1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].Name; refemail1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].EMail; } if (medicalVendorUserProfile[0].MVUser.References.Count == 2) { refname2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].Name; refemail2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].EMail; } if (medicalVendorUserProfile[0].MVUser.References.Count == 3) { refname1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].Name; refemail1.InnerText = medicalVendorUserProfile[0].MVUser.References[0] == null ? "" : medicalVendorUserProfile[0].MVUser.References[0].EMail; refname2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].Name; refemail2.InnerText = medicalVendorUserProfile[0].MVUser.References[1] == null ? "" : medicalVendorUserProfile[0].MVUser.References[1].EMail; refname3.InnerText = medicalVendorUserProfile[0].MVUser.References[2] == null ? "" : medicalVendorUserProfile[0].MVUser.References[2].Name; refemail3.InnerText = medicalVendorUserProfile[0].MVUser.References[2] == null ? "" : medicalVendorUserProfile[0].MVUser.References[2].EMail; } //spdateApplied.InnerText = DOA.ToString("MMMM dd, yyyy"); Ucimagelist1.Images = medicalVendorUserProfile[0].MVUser.OtherPictures.ToList(); }
/// <summary> /// Get the list of sales rep of the /// advocate sales manager franchisee /// </summary> private void getTeamForAdvocateSalesManager() { // format phone no. CommonCode objCommonCode = new CommonCode(); //FranchiseeFranchiseeUserService objFFService = new FranchiseeFranchiseeUserService(); // Removed Franchisee Service FranchiseeDAL franchiseeDAL = new FranchiseeDAL(); List <EFranchiseeFranchiseeUser> objFFUser = null; //objFFUser = objFFService.GetTeamForAdvocateSalesManager(1, true, intAdvocateSalesManagerId, true); objFFUser = franchiseeDAL.GetTeamForAdvocateSalesManager(1, intAdvocateSalesManagerId); DataTable dtSalesTeam = new DataTable(); dtSalesTeam.Columns.Add("Sr"); dtSalesTeam.Columns.Add("FranchiseeFranchiseeUserID"); dtSalesTeam.Columns.Add("Name"); dtSalesTeam.Columns.Add("Phone"); dtSalesTeam.Columns.Add("Email"); dtSalesTeam.Columns.Add("FranchiseeID"); dtSalesTeam.Columns.Add("ManagerID"); dtSalesTeam.Columns.Add("ManagerName"); dtSalesTeam.Columns.Add("Status"); Falcon.Entity.Other.EUser objuser; if (objFFUser != null) { for (int icount = 0; icount < objFFUser.Count; icount++) { string strName; objuser = objFFUser[icount].FranchiseeUser.User; strName = CommonClass.FormatName(objuser.FirstName, objuser.MiddleName, objuser.LastName); string strStatus; if (objFFUser[icount].AdvocateSalesManagerID == 0) { strStatus = "<a href='#' onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",true)'>Add</a> "; } else if (objFFUser[icount].AdvocateSalesManagerID == intAdvocateSalesManagerId) { strStatus = "<a href='#' onclick='return UpdateStatus(" + intAdvocateSalesManagerId + "," + objFFUser[icount].FranchiseeFranchiseeUserID + ",false)'>Remove</a> "; } else { strStatus = objFFUser[icount].AdvocateSalesManager; } if ((objFFUser[icount].FranchiseeUser.User.PhoneHome == "") || (objFFUser[icount].FranchiseeUser.User.PhoneHome == string.Empty)) { objFFUser[icount].FranchiseeUser.User.PhoneHome = "N/A"; } else { objFFUser[icount].FranchiseeUser.User.PhoneHome = objCommonCode.FormatPhoneNumberGet(objFFUser[icount].FranchiseeUser.User.PhoneHome); } if ((objFFUser[icount].FranchiseeUser.User.EMail1 == "") || (objFFUser[icount].FranchiseeUser.User.EMail1 == string.Empty)) { objFFUser[icount].FranchiseeUser.User.EMail1 = "N/A"; } dtSalesTeam.Rows.Add(new object[] { icount + 1, objFFUser[icount].FranchiseeFranchiseeUserID, strName, objFFUser[icount].FranchiseeUser.User.PhoneHome, objFFUser[icount].FranchiseeUser.User.EMail1, objFFUser[icount].Franchisee.FranchiseeID, objFFUser[icount].AdvocateSalesManagerID, objFFUser[icount].AdvocateSalesManager, strStatus }); } } grdTeam.DataSource = dtSalesTeam; ViewState["DSGRID"] = dtSalesTeam; grdTeam.DataBind(); }
/// <summary> /// Method to search prospects based on search criteria /// </summary> private void SearchProspects() { // format phone no. CommonCode objCommonCode = new CommonCode(); //saving search parameter var parameterString = new string[18]; bool blnReset = false; string roleName = string.Empty; // reset flag if (Request["isreset"] != null && Request["isreset"] == "true") { blnReset = true; Session["ParameterStringHost"] = null; } if (Session["ParameterStringHost"] != null && blnReset == false) { parameterString = (string[])Session["ParameterStringHost"]; } if (Request["prospectname"] != null) { parameterString[0] = Request["prospectname"]; } if (Request["startdate"] != null) { parameterString[1] = Request["startdate"]; } if (Request["enddate"] != null) { parameterString[2] = Request["enddate"]; } if (Request["salesrepid"] != null) { parameterString[3] = Request["salesrepid"]; } if (Request["distance"] != null) { parameterString[4] = Request["distance"]; } if (Request["zipcode"] != null) { parameterString[5] = Request["zipcode"]; } if (Request["status"] != null) { parameterString[6] = Request["status"]; } if (Request["hasevent"] != null) { parameterString[7] = Request["hasevent"]; } if (Request["territory"] != null) { parameterString[8] = Request["territory"]; } if (Request["pagenumber"] != null) { parameterString[9] = Request["pagenumber"]; } if (Request["pagesize"] != null) { parameterString[10] = Request["pagesize"]; } // Assigned To if (Request["assignedTo"] != null) { parameterString[16] = Request["assignedTo"]; } // login role if (Request["role"] != null) { roleName = Request["role"]; } // prospectTypeId if (Request["hostType"] != null) { parameterString[17] = Request["hostType"]; } Session["ParameterStringHost"] = parameterString; long franchiseeid = 0; int territoryid = 0; string strProspectName = string.Empty; string strStartDate = string.Empty; string strEndDate = string.Empty; long iSalesPersonId = 0; long prospectTypeId = 0; int istatusId = 0; int itypeId = 0; string strUserId = string.Empty; string strZipCode = string.Empty; string strDistance = "0"; string strNotesToolTip = string.Empty; const int isFeeder = 4; string strSortColomn = string.Empty; string strSortOrder = string.Empty; int iPageSize = 5; int iPageIndex = 1; long iTotalRecord; long assignedTo = 0; var objFranchisorDal = new FranchisorDAL(); EProspect[] objProspects = null; // Prospect Name if (!string.IsNullOrEmpty(parameterString[0])) { strProspectName = parameterString[0]; } // Start Name if (!string.IsNullOrEmpty(parameterString[1])) { strStartDate = parameterString[1]; } // End Name if (!string.IsNullOrEmpty(parameterString[2])) { strEndDate = parameterString[2]; } // SalesPersonId if (!string.IsNullOrEmpty(parameterString[3])) { iSalesPersonId = Convert.ToInt64(parameterString[3]); } if (!string.IsNullOrEmpty(parameterString[4]) && (!string.IsNullOrEmpty(parameterString[5]))) { strDistance = parameterString[4]; strZipCode = parameterString[5]; } //StatusID if (!string.IsNullOrEmpty(parameterString[6])) { istatusId = Convert.ToInt32(parameterString[6]); } //event status if (!string.IsNullOrEmpty(parameterString[7])) { itypeId = Convert.ToInt32(parameterString[7]); } // Territory id if (!string.IsNullOrEmpty(parameterString[8])) { territoryid = Convert.ToInt32(parameterString[8]); } // Get Page Number if (!string.IsNullOrEmpty(parameterString[9])) { iPageIndex = Convert.ToInt32(parameterString[9]); } // Get Page Size if (!string.IsNullOrEmpty(parameterString[10])) { iPageSize = Convert.ToInt32(parameterString[10]); } // Franchisee id if (!string.IsNullOrEmpty(Request["franchiseeid"])) { franchiseeid = Convert.ToInt64(Request["franchiseeid"]); } // AssignedTo (FranchiFranchiseesUserId) if (!string.IsNullOrEmpty(parameterString[16])) { assignedTo = Convert.ToInt64(parameterString[16]); } // ProspectTypeId if (!string.IsNullOrEmpty(parameterString[17])) { prospectTypeId = Convert.ToInt64(parameterString[17]); } // Get Sort Column if (!string.IsNullOrEmpty(Request["sortcolumn"])) { strSortColomn = Request["sortcolumn"]; } // Get Sort Order if (!string.IsNullOrEmpty(Request["sortorder"])) { strSortOrder = Request["sortorder"]; } if (strSortOrder.Equals("Ascending")) { strSortOrder = " Asc "; } if (strSortOrder.Equals("Descending")) { strSortOrder = " Desc "; } //Get data for salesperson selected in dropdown id true else call all data if (FranchiseeView) { if (strUserId == "" && strZipCode == "" && (strDistance == "" || strDistance == "0")) { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, "", 0, 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else if (strUserId != "" && strZipCode != "" && strDistance != "" && strDistance != "0") { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, strZipCode, Convert.ToInt32(strDistance), 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 2, strZipCode, Convert.ToInt32(strDistance), 1, isFeeder, Convert.ToInt64(iSalesPersonId), territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } } else { string shellId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationId.ToString(); var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, long.Parse(shellId), istatusId, itypeId, 2, strZipCode, int.Parse(strDistance), 1, isFeeder, iSalesPersonId, territoryid, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, 2, 2, 2, assignedTo, roleName, prospectTypeId); if (listProspects != null) { objProspects = listProspects.ToArray(); } } if (objProspects != null) { if (objProspects.Length == 1 && Request.QueryString["QuickSearch"] != null && Request.QueryString["QuickSearch"].Equals("True")) { Response.Write("/App/Franchisee/SalesRep/SalesRepProspectDetails.aspx?Type=Host&QuickSearch=True&ProspectID=" + objProspects[0].ProspectID); } else { var dtProspect = new DataTable(); //Create template for data table dtProspect.Columns.Add("ProspectId", typeof(Int32)); dtProspect.Columns.Add("ProspectName"); dtProspect.Columns.Add("ProspectCreatedDate"); dtProspect.Columns.Add("PhoneOffice"); dtProspect.Columns.Add("ProspectStatus"); dtProspect.Columns.Add("NoOFCalls"); dtProspect.Columns.Add("NoOFMeeting"); dtProspect.Columns.Add("NoOfContacts"); dtProspect.Columns.Add("SalesPersonFirstName"); dtProspect.Columns.Add("SalesPersonLastName"); dtProspect.Columns.Add("FranchiseeName"); dtProspect.Columns.Add("ProspectAddressId"); dtProspect.Columns.Add("ProspectAddress1"); dtProspect.Columns.Add("ProspectAddress2"); dtProspect.Columns.Add("ProspectCity"); dtProspect.Columns.Add("ProspectState"); dtProspect.Columns.Add("ProspectZip"); dtProspect.Columns.Add("ProspectCountry"); dtProspect.Columns.Add("ProspectCompleteAddress"); dtProspect.Columns.Add("ContactFirstName"); dtProspect.Columns.Add("ContactLastName"); dtProspect.Columns.Add("ContactPhone"); dtProspect.Columns.Add("ContactEmail"); dtProspect.Columns.Add("ContactCallDate"); dtProspect.Columns.Add("ContactCallStatus"); dtProspect.Columns.Add("LnkContactViewAll"); dtProspect.Columns.Add("LnkContactAddCall"); dtProspect.Columns.Add("LnkContactAddMeeting"); dtProspect.Columns.Add("LnkactivityNotes"); dtProspect.Columns.Add("LnkViewDetails"); dtProspect.Columns.Add("LnkAddContact"); dtProspect.Columns.Add("LnkConvertToHost"); dtProspect.Columns.Add("NotesToolTip"); //Add all the fetched data tto data table if (objProspects.Length > 0) { //// Case SalesRep //if (usershellmodulerole.RoleName == Roles.SalesRep.ToString()) //{ // //TODO: This filter is only for SaleRep and need to do for Franchisee also // // Sales Reps with territory assignments should only see hosts applicable to them. // long salesRepId = usershellmodulerole.RoleShellID; // ITerritoryRepository territoryRepository = new TerritoryRepository(); // IHostRepository hostRepository = new HostRepository(); // List<SalesRepTerritory> salesRepTerritories = territoryRepository.GetTerritoriesForSalesRep(salesRepId); // if (!salesRepTerritories.IsEmpty()) // { // IEnumerable<string> acceptableZipCodes = salesRepTerritories. // SelectMany(srt => srt.ZipCodes).Distinct().Select(z => z.Zip); // // Filter out hosts not located in zip codes of this sales rep's territories. // objProspects = objProspects.Where(p => acceptableZipCodes.Contains(p.Address.Zip)).ToArray(); // // Filter out hosts that do not host events of the type that the sales rep can see. // var prospectsToRemove = new List<EProspect>(); // foreach (EProspect prospect in objProspects) // { // string hostingZipCode = prospect.Address.Zip; // SalesRepTerritory territoryEventIsHostedIn = salesRepTerritories.Single(srt => srt.ZipCodes.Select(z => z.Zip). // Contains(hostingZipCode)); // EventType salesRepPermission = territoryEventIsHostedIn.SalesRepTerritoryAssignments. // Single(srta => srta.SalesRep.SalesRepresentativeId == salesRepId).EventTypeSetupPermission; // var acceptableEventTypes = hostRepository.GetEventTypesForHost(prospect.ProspectID); // if (salesRepPermission != EventType.Both && !acceptableEventTypes.Contains(salesRepPermission)) // { // prospectsToRemove.Add(prospect); // } // } // objProspects = objProspects.Except(prospectsToRemove).ToArray(); // iTotalRecord = objProspects.Count(); // } //} foreach (var objProspect in objProspects) { DataRow drProspect = dtProspect.NewRow(); drProspect["ProspectId"] = objProspect.ProspectID; drProspect["ProspectName"] = string.IsNullOrEmpty(objProspect.OrganizationName) ? "N/A" : objProspect.OrganizationName; drProspect["ProspectCreatedDate"] = string.IsNullOrEmpty(objProspect.ProspectDate) ? "N/A" : Convert.ToDateTime(objProspect.ProspectDate).ToShortDateString(); drProspect["PhoneOffice"] = !string.IsNullOrEmpty(objProspect.PhoneOffice) ? objCommonCode.FormatPhoneNumberGet(objProspect.PhoneOffice) : "N/A"; if (string.IsNullOrEmpty(objProspect.Status)) { drProspect["ProspectStatus"] = "N/A"; } else { string status; switch (objProspect.Status) { case "1": status = "Hot"; break; case "2": status = "Cold"; break; case "3": status = "Dead"; break; case "4": status = "Call Back"; break; default: status = "none"; break; } drProspect["ProspectStatus"] = status; } drProspect["NoOFCalls"] = objProspect.NoOfCalls; drProspect["NoOFMeeting"] = objProspect.NoOfMeetings; drProspect["NoOfContacts"] = objProspect.NoOfContacts; if (string.IsNullOrEmpty(objProspect.FirstName) && string.IsNullOrEmpty(objProspect.LastName)) { drProspect["SalesPersonFirstName"] = "N/A"; drProspect["SalesPersonLastName"] = ""; } else { drProspect["SalesPersonFirstName"] = objProspect.FirstName; drProspect["SalesPersonLastName"] = objProspect.LastName; } if (string.IsNullOrEmpty(objProspect.FranchiseeName)) { drProspect["FranchiseeName"] = "N/A"; } else { drProspect["FranchiseeName"] = objProspect.FranchiseeName; } var objAddress = objProspect.Address; // Set Initially the new line in address drProspect["ProspectAddressId"] = objAddress.AddressID.ToString(); drProspect["ProspectAddress1"] = string.IsNullOrEmpty(objAddress.Address1) ? "" : objAddress.Address1; drProspect["ProspectAddress2"] = string.IsNullOrEmpty(objAddress.Address2) ? "" : objAddress.Address2; drProspect["ProspectCity"] = string.IsNullOrEmpty(objAddress.City) ? "N/A" : objAddress.City; drProspect["ProspectState"] = string.IsNullOrEmpty(objAddress.State) ? "N/A" : objAddress.State; if (string.IsNullOrEmpty(objAddress.Zip) || (objAddress.Zip == "0")) { drProspect["ProspectZip"] = "N/A"; } else { drProspect["ProspectZip"] = objAddress.Zip; } // Format Address string prospectCompleteAddress = CommonCode.AddressMultiLine(objAddress.Address1, objAddress.Address2, objAddress.City, objAddress.State, objAddress.Zip); drProspect["ProspectCompleteAddress"] = prospectCompleteAddress; var objContact = objProspect.Contact.ToArray(); if (string.IsNullOrEmpty(objContact[0].FirstName)) { if (string.IsNullOrEmpty(objContact[0].LastName)) { drProspect["ContactFirstName"] = "N/A"; drProspect["ContactLastName"] = ""; } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } if (string.IsNullOrEmpty(objContact[0].PhoneHome)) { drProspect["ContactPhone"] = "N/A"; } else if (objContact[0].PhoneHome.Trim().Equals("(___)-___-____")) { drProspect["ContactPhone"] = "N/A"; } else { drProspect["ContactPhone"] = objCommonCode.FormatPhoneNumberGet(objContact[0].PhoneHome); } drProspect["ContactEmail"] = string.IsNullOrEmpty(objContact[0].EMail) ? "N/A" : objContact[0].EMail; var objContactCall = objProspect.ContactCall; drProspect["ContactCallDate"] = string.IsNullOrEmpty(objContactCall.StartDate) ? "N/A" : objContactCall.StartDate; var objCallStatus = objContactCall.CallStatus; drProspect["ContactCallStatus"] = string.IsNullOrEmpty(objCallStatus.Status) ? "N/A" : objCallStatus.Status; // Prepare Notes ToolTips bool blnNotes = false; strNotesToolTip = strNotesToolTip + "<table cellpadding='3' cellspacing='0' border='0' width='100%'>"; // Date and Time if (!string.IsNullOrEmpty(objContactCall.StartDate)) { string[] strDateTime = objContactCall.StartDate.Split(' '); if (strDateTime.Length >= 2) { strNotesToolTip = strNotesToolTip + "<tr><td>Date: " + strDateTime[0] + "</td><td>Time: " + strDateTime[1] + "</td></tr>"; blnNotes = true; } } // Duration if (!string.IsNullOrEmpty(objCallStatus.Duration) && (objCallStatus.Duration != "0.00")) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Duration: " + objCallStatus.Duration + " mins.</td></tr>"; blnNotes = true; } // Status if (!string.IsNullOrEmpty(objCallStatus.Status)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Status: " + objCallStatus.Status + "</td></tr>"; blnNotes = true; } // Notes if (!string.IsNullOrEmpty(objCallStatus.Notes)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Notes: </td></tr><tr><td colspan=2>" + objCallStatus.Notes + "</td></tr>"; blnNotes = true; } strNotesToolTip = strNotesToolTip + "</table>"; drProspect["NotesToolTip"] = blnNotes ? strNotesToolTip : "<table cellpadding='3' cellspacing='0' border='0' width='100%'><tr><td> Details Not Available </td></tr></table>"; strNotesToolTip = string.Empty; dtProspect.Rows.Add(drProspect); } } if (dtProspect.Rows.Count > 0) { grdProspect.DataSource = dtProspect; grdProspect.DataBind(); string pagingstring = ImplementPaging(iPageIndex, iPageSize, iTotalRecord); HtmlForm formNew = Page.Form; formNew.Controls.Clear(); formNew.Controls.Add(grdProspect); var sb = new System.Text.StringBuilder(); var htWriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); formNew.RenderControl(htWriter); string strRenderedHTML = sb.ToString(); int startindex = strRenderedHTML.IndexOf("<table"); int endindex = strRenderedHTML.LastIndexOf("</table>"); int length = (endindex - startindex) + 8; strRenderedHTML = strRenderedHTML.Substring(startindex, length); string totalRecord = "<span id=spnTotalRecordAsync>" + iTotalRecord + "</span>"; strRenderedHTML = "<div style='float: left; width: 746px'>" + strRenderedHTML + "</div>"; Response.Write(strRenderedHTML + pagingstring + "<p class=\"blueboxbotbg_cl\"><img src=\"/App/Images/specer.gif\" width=\"746\" height=\"5\" /></p>" + totalRecord); } else { string noRecordFound = "<div style='float:left; width:746px; border:solid 1px #E7F0F5; padding:10px 0px 10px 0px; display:block;' id='dvNoProspectFound' runat='server'>"; noRecordFound = noRecordFound + "<div class='divnoitemfound_custdbrd' style='margin-top:0px;'><p class='divnoitemtxt_custdbrd'><span class='orngbold18_default'>No Records Found</span></p></div></div>"; Response.Write(noRecordFound); } } } }
/// <summary> /// Display customer information /// </summary> private void DisplayCustomer() { long customerId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationRoleUserId; ICustomerRepository customerRepository = new CustomerRepository(); var customer = customerRepository.GetCustomer(customerId); var commonCode = new CommonCode(); dynamic displayCustomerModel = new ExpandoObject(); displayCustomerModel.CustomerId = customerId; if (customer != null) { _txtFirstName.Text = customer.Name.FirstName; _txtMiddleName.Text = customer.Name.MiddleName; _txtLastName.Text = customer.Name.LastName; NameLabel.InnerText = displayCustomerModel.Name = customer.Name.FullName; if (customer.Height != null) { _ddlFeet.SelectedValue = displayCustomerModel.Feet = customer.Height.Feet.ToString(); _ddlInch.SelectedValue = displayCustomerModel.Inches = customer.Height.Inches.ToString(); } if (customer.Weight != null) { displayCustomerModel.Weight = _txtWeight.Text = customer.Weight.Pounds.ToString(); } if (customer.Waist.HasValue && customer.Waist.Value > 0) { displayCustomerModel.Waist = _txtWaist.Text = customer.Waist.Value.ToString("0.0"); } ListItem lstRace = _ddlRace.Items.FindByText(customer.Race.ToString()); if (lstRace != null) { lstRace.Selected = true; displayCustomerModel.Race = lstRace.Text; } displayCustomerModel.AddressLine = _txtAddress.Text = customer.Address.StreetAddressLine1; displayCustomerModel.Suit = _txtSuit.Text = customer.Address.StreetAddressLine2; displayCustomerModel.City = _txtCity.Text = customer.Address.City; displayCustomerModel.State = hfstate.Value = customer.Address.State; ddlCountry.SelectedValue = customer.Address.CountryId.ToString(); displayCustomerModel.AddressLine = ddlCountry.SelectedItem.Text; displayCustomerModel.Zip = _txtZip.Text = customer.Address.ZipCode.Zip; displayCustomerModel.PhoneHome = _txtPhoneHome.Text = commonCode.FormatPhoneNumberGet(customer.HomePhoneNumber.ToString()); displayCustomerModel.PhoneCell = _txtPhoneCell.Text = commonCode.FormatPhoneNumberGet(customer.MobilePhoneNumber.ToString()); displayCustomerModel.PhoneOffice = _txtPhoneOffice.Text = commonCode.FormatPhoneNumberGet(customer.OfficePhoneNumber.ToString()); displayCustomerModel.EnableTexting = customer.EnableTexting; rbtnEnableTexting.Checked = customer.EnableTexting; rbtnDisableTexting.Checked = !customer.EnableTexting; displayCustomerModel.EnableVoiceMail = customer.EnableVoiceMail; rbtnEnableVoiceMail.Checked = customer.EnableVoiceMail; rbtnDisableVoiceMail.Checked = !customer.EnableVoiceMail; if (customer.DateOfBirth.HasValue) { displayCustomerModel.DateOfBrith = _txtDateOfBrith.Text = customer.DateOfBirth.Value.ToString("MM/dd/yyyy"); DobLabel.InnerText = customer.DateOfBirth.Value.ToString("MM/dd/yyyy"); DobLabelSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); DobTextboxSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); } else { DobLabelSpan.Style.Add(HtmlTextWriterStyle.Display, "none"); DobTextboxSpan.Style.Add(HtmlTextWriterStyle.Display, "block"); } _ddlGender.SelectedValue = displayCustomerModel.Gender = customer.Gender.ToString(); displayCustomerModel.Email = _txtEmail.Text = customer.Email.ToString(); displayCustomerModel.PhoneOfficeExtension = PhoneOfficeExtension.Text = customer.PhoneOfficeExtension; displayCustomerModel.Ssn = _txtSsnNumber.Text = customer.Ssn; if (IsUpdateProfile) { MarketingSourceDropDown.SelectedValue = displayCustomerModel.MarketingSource = customer.MarketingSource; } LogAudit(ModelType.View, displayCustomerModel, customerId); } }
private void SearchProspects() { // format phone no. CommonCode objCommonCode = new CommonCode(); //saving search parameter var parameterString = new string[17]; bool blnReset = false; string roleName = string.Empty; // reset flag if (Request["isreset"] != null && Request["isreset"] == "true") { blnReset = true; Session["ParameterStringProspect"] = null; } if (Session["ParameterStringProspect"] != null && blnReset == false) { parameterString = (string[])Session["ParameterStringProspect"]; } // prospect name if (Request["prospectname"] != null) { parameterString[0] = Request["prospectname"]; } //start date if (Request["startdate"] != null) { parameterString[1] = Request["startdate"]; } //end date if (Request["enddate"] != null) { parameterString[2] = Request["enddate"]; } //sales person if (Request["salesrepid"] != null) { parameterString[3] = Request["salesrepid"]; } //distance if (Request["distance"] != null) { parameterString[4] = Request["distance"]; } // zipcode if (Request["zipcode"] != null) { parameterString[5] = Request["zipcode"]; } // progress if (Request["progress"] != null) { parameterString[6] = Request["progress"]; } // type if (Request["type"] != null) { parameterString[7] = Request["type"]; } // assigned status if (Request["assignedstatus"] != null) { parameterString[8] = Request["assignedstatus"]; } // territory if (Request["territory"] != null) { parameterString[9] = Request["territory"]; } // page number if (Request["pagenumber"] != null) { parameterString[10] = Request["pagenumber"]; } // page size if (Request["pagesize"] != null) { parameterString[11] = Request["pagesize"]; } // will promote if (Request["willpromote"] != null) { parameterString[12] = Request["willpromote"]; } // will host if (Request["willhost"] != null) { parameterString[13] = Request["willhost"]; } // hosted in past if (Request["hostedinpast"] != null) { parameterString[14] = Request["hostedinpast"]; } // prospect list id parameterString[15] = Request["prospectlistid"] ?? "0"; // Assigned To if (Request["assignedTo"] != null) { parameterString[16] = Request["assignedTo"]; } // login role if (Request["role"] != null) { roleName = Request["role"]; } Session["ParameterStringProspect"] = parameterString; long prospectListId = 0; long franchiseeid = 0; int territoryId = 0; string strProspectName = string.Empty; string strStartDate = string.Empty; string strEndDate = string.Empty; long iSalesPersonId = 0; int istatusId = 0; int itypeId = 0; string strUserId = string.Empty; string strZipCode = string.Empty; string strDistance = "0"; string strNotesToolTip = string.Empty; int isAssigned = 0; string strSortColomn = ""; string strSortOrder = " Asc"; int iPageSize = 5; int iPageIndex = 1; long iTotalRecord; int iWillPrompte = 3; int iWillHost = 3; int iHostedInPast = 3; long assignedTo = 0; Falcon.Entity.Other.EProspect[] objProspects = null; var objFranchisorDal = new FranchisorDAL(); // Prospect ListID if (!string.IsNullOrEmpty(parameterString[15])) { if (parameterString[15] != "0") { prospectListId = Convert.ToInt64(parameterString[15]); } } // Prospect Name if (!string.IsNullOrEmpty(parameterString[0])) { strProspectName = parameterString[0]; } // Start Name if (!string.IsNullOrEmpty(parameterString[1])) { strStartDate = parameterString[1]; } // End Name if (!string.IsNullOrEmpty(parameterString[2])) { strEndDate = parameterString[2]; } // SalesPersonId if (!string.IsNullOrEmpty(parameterString[3])) { iSalesPersonId = Convert.ToInt64(parameterString[3]); } //StatusID if (!string.IsNullOrEmpty(parameterString[6])) { istatusId = Convert.ToInt32(parameterString[6]); } //TypeId if (!string.IsNullOrEmpty(parameterString[7])) { itypeId = Convert.ToInt32(parameterString[7]); } // Assign Status if (!string.IsNullOrEmpty(parameterString[8])) { isAssigned = Convert.ToInt32(parameterString[8]); } if (!string.IsNullOrEmpty(parameterString[4]) && (!string.IsNullOrEmpty(parameterString[5]))) { strDistance = parameterString[4]; strZipCode = parameterString[5]; } // Will Promote if (!string.IsNullOrEmpty(parameterString[12])) { iWillPrompte = Convert.ToInt32(parameterString[12]); } // Will Host if (!string.IsNullOrEmpty(parameterString[13])) { iWillHost = Convert.ToInt32(parameterString[13]); } // Hosted In Past if (!string.IsNullOrEmpty(parameterString[14])) { iHostedInPast = Convert.ToInt32(parameterString[14]); } // Get Page Size if (!string.IsNullOrEmpty(parameterString[11])) { iPageSize = Convert.ToInt32(parameterString[11]); } // Get Page Size if (!string.IsNullOrEmpty(parameterString[10])) { iPageIndex = Convert.ToInt32(parameterString[10]); } // Franchisee id if (!string.IsNullOrEmpty(Request["franchiseeid"])) { franchiseeid = Convert.ToInt64(Request["franchiseeid"]); } // Territory id if (!string.IsNullOrEmpty(parameterString[9])) { territoryId = Convert.ToInt32(parameterString[9]); } // AssignedTo (FranchiFranchiseesUserId) if (!string.IsNullOrEmpty(parameterString[16])) { assignedTo = Convert.ToInt64(parameterString[16]); } // Get Sort Column if (!string.IsNullOrEmpty(Request["sortcolumn"])) { strSortColomn = Request["sortcolumn"]; } // Get Sort Order if (!string.IsNullOrEmpty(Request["sortorder"])) { strSortOrder = Request["sortorder"]; } if (strSortOrder.Equals("Ascending")) { strSortOrder = " Asc "; } if (strSortOrder.Equals("Descending")) { strSortOrder = " Desc "; } // Case when prospect list if (prospectListId > 0) { var listProspects = objFranchisorDal.GetProspectsDetailByProspectListID(prospectListId, 1, out iTotalRecord, iPageSize, iPageIndex, strSortColomn, strSortOrder, assignedTo); if (listProspects != null) { objProspects = listProspects.ToArray(); } } // normal case else { //Get data for salesperson selected in dropdown id true else call all data if (FranchiseeView) { if (strUserId == "" && strZipCode == "" && (strDistance == "" || strDistance == "0")) { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 0, "", 0, 0, isAssigned, iSalesPersonId, territoryId, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, iWillPrompte, iWillHost, iHostedInPast, assignedTo, roleName, 0); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else if (strUserId != "" && strZipCode != "" && strDistance != "" && strDistance != "0") { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 0, strZipCode, Convert.ToInt32(strDistance), 0, isAssigned, iSalesPersonId, territoryId, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, iWillPrompte, iWillHost, iHostedInPast, assignedTo, roleName, 0); if (listProspects != null) { objProspects = listProspects.ToArray(); } } else { var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, franchiseeid, istatusId, itypeId, 0, strZipCode, Convert.ToInt32(strDistance), 0, isAssigned, iSalesPersonId, territoryId, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, iWillPrompte, iWillHost, iHostedInPast, assignedTo, roleName, 0); if (listProspects != null) { objProspects = listProspects.ToArray(); } } } else { string shellId = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole.OrganizationId.ToString(); var listProspects = objFranchisorDal.GetProspectsDetail(strProspectName, strStartDate, strEndDate, Convert.ToInt64(shellId), istatusId, itypeId, 1, strZipCode, Convert.ToInt32(strDistance), 0, isAssigned, iSalesPersonId, territoryId, strSortColomn, strSortOrder, iPageSize, iPageIndex, out iTotalRecord, iWillPrompte, iWillHost, iHostedInPast, assignedTo, roleName, 0); if (listProspects != null) { objProspects = listProspects.ToArray(); } } } if (objProspects.Length == 1 && Request.QueryString["QuickSearch"] != null && Request.QueryString["QuickSearch"].Equals("True")) { Response.Write("/App/Franchisee/SalesRep/SalesRepProspectDetails.aspx?Type=Prospect&QuickSearch=True&ProspectID=" + objProspects[0].ProspectID); } else { var dtProspect = new DataTable(); //Create template for data table dtProspect.Columns.Add("ProspectId", typeof(Int32)); dtProspect.Columns.Add("ProspectName"); dtProspect.Columns.Add("ProspectCreatedDate"); dtProspect.Columns.Add("PhoneOffice"); dtProspect.Columns.Add("ProspectStatus"); dtProspect.Columns.Add("AssignedStatus"); dtProspect.Columns.Add("NoOFCalls"); dtProspect.Columns.Add("NoOFMeeting"); dtProspect.Columns.Add("NoOfContacts"); dtProspect.Columns.Add("SalesPersonFirstName"); dtProspect.Columns.Add("SalesPersonLastName"); dtProspect.Columns.Add("FranchiseeName"); dtProspect.Columns.Add("ProspectAddress1"); dtProspect.Columns.Add("ProspectAddress2"); dtProspect.Columns.Add("ProspectCity"); dtProspect.Columns.Add("ProspectState"); dtProspect.Columns.Add("ProspectZip"); dtProspect.Columns.Add("ProspectCountry"); dtProspect.Columns.Add("ProspectCompleteAddress"); dtProspect.Columns.Add("ContactFirstName"); dtProspect.Columns.Add("ContactLastName"); dtProspect.Columns.Add("ContactPhone"); dtProspect.Columns.Add("ContactEmail"); dtProspect.Columns.Add("ContactCallDate"); dtProspect.Columns.Add("ContactCallStatus"); dtProspect.Columns.Add("LnkContactViewAll"); dtProspect.Columns.Add("LnkContactAddCall"); dtProspect.Columns.Add("LnkContactAddMeeting"); dtProspect.Columns.Add("LnkactivityNotes"); dtProspect.Columns.Add("LnkViewDetails"); dtProspect.Columns.Add("LnkAddContact"); dtProspect.Columns.Add("LnkConvertToHost"); dtProspect.Columns.Add("NotesToolTip"); dtProspect.Columns.Add("ProspectStatusImage"); //Add all the fetched data to data table if (objProspects != null && objProspects.Length > 0) { foreach (var objProspect in objProspects) { DataRow drProspect = dtProspect.NewRow(); drProspect["ProspectId"] = objProspect.ProspectID; drProspect["ProspectName"] = string.IsNullOrEmpty(objProspect.OrganizationName) ? "N/A" : objProspect.OrganizationName; drProspect["ProspectCreatedDate"] = string.IsNullOrEmpty(objProspect.ProspectDate) ? "N/A" : Convert.ToDateTime(objProspect.ProspectDate).ToShortDateString(); drProspect["PhoneOffice"] = !string.IsNullOrEmpty(objProspect.PhoneOffice) ? objCommonCode.FormatPhoneNumberGet(objProspect.PhoneOffice) : "N/A"; drProspect["AssignedStatus"] = objProspect.AssignedStatus.ToString(); if (string.IsNullOrEmpty(objProspect.Status)) { drProspect["ProspectStatus"] = "N/A"; } else { string status; //Set the status according to status id switch (objProspect.Status) { case "1": status = "Hot"; drProspect["ProspectStatusImage"] = "<img src='/App/Images/hot-icon.gif' alt='Hot' />"; break; case "2": status = "Cold"; drProspect["ProspectStatusImage"] = "<img src='/App/Images/cold-icon.gif' alt='Cold' />"; break; case "3": status = "Warm"; drProspect["ProspectStatusImage"] = "<img src='/App/Images/warm-icon.gif' alt='Warm' />"; break; default: status = "none"; drProspect["ProspectStatusImage"] = ""; break; } drProspect["ProspectStatus"] = status; } drProspect["NoOFCalls"] = objProspect.NoOfCalls; drProspect["NoOFMeeting"] = objProspect.NoOfMeetings; drProspect["NoOfContacts"] = objProspect.NoOfContacts; if (string.IsNullOrEmpty(objProspect.FirstName) && string.IsNullOrEmpty(objProspect.LastName)) { drProspect["SalesPersonFirstName"] = "N/A"; drProspect["SalesPersonLastName"] = ""; } else { drProspect["SalesPersonFirstName"] = objProspect.FirstName; drProspect["SalesPersonLastName"] = objProspect.LastName; } if (string.IsNullOrEmpty(objProspect.FranchiseeName)) { drProspect["FranchiseeName"] = "N/A"; } else { drProspect["FranchiseeName"] = objProspect.FranchiseeName; } //EAddress objAddress = objProspect.Address; var objAddress = objProspect.Address; // Set Initially the new line in address string strProspectCompleteAddress; drProspect["ProspectAddress1"] = string.IsNullOrEmpty(objAddress.Address1) ? "" : objAddress.Address1; drProspect["ProspectAddress2"] = string.IsNullOrEmpty(objAddress.Address2) ? "" : objAddress.Address2; drProspect["ProspectCity"] = string.IsNullOrEmpty(objAddress.City) ? "N/A" : objAddress.City; drProspect["ProspectState"] = string.IsNullOrEmpty(objAddress.State) ? "N/A" : objAddress.State; if (string.IsNullOrEmpty(objAddress.Zip) || (objAddress.Zip == "0")) { drProspect["ProspectZip"] = "N/A"; } else { drProspect["ProspectZip"] = objAddress.Zip; } // Format Address strProspectCompleteAddress = CommonCode.AddressMultiLine(objAddress.Address1, objAddress.Address2, objAddress.City, objAddress.State, objAddress.Zip); drProspect["ProspectCompleteAddress"] = strProspectCompleteAddress; var listContact = objProspect.Contact; Falcon.Entity.Other.EContact[] objContact; objContact = listContact.ToArray(); if (string.IsNullOrEmpty(objContact[0].FirstName)) { if (string.IsNullOrEmpty(objContact[0].LastName)) { drProspect["ContactFirstName"] = "N/A"; drProspect["ContactLastName"] = ""; } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } } else { drProspect["ContactFirstName"] = objContact[0].FirstName; drProspect["ContactLastName"] = objContact[0].LastName; } if (string.IsNullOrEmpty(objContact[0].PhoneHome)) { drProspect["ContactPhone"] = "N/A"; } else if (objContact[0].PhoneHome.Trim().Equals("(___)-___-____")) { drProspect["ContactPhone"] = "N/A"; } else { drProspect["ContactPhone"] = objCommonCode.FormatPhoneNumberGet(objContact[0].PhoneHome); } drProspect["ContactEmail"] = string.IsNullOrEmpty(objContact[0].EMail) ? "N/A" : objContact[0].EMail; var objContactCall = objProspect.ContactCall; drProspect["ContactCallDate"] = string.IsNullOrEmpty(objContactCall.StartDate) ? "N/A" : objContactCall.StartDate; var objCallStatus = objContactCall.CallStatus; if (string.IsNullOrEmpty(objCallStatus.Status)) { drProspect["ContactCallStatus"] = "N/A"; } else { drProspect["ContactCallStatus"] = objCallStatus.Status; } // Prepare Notes ToolTips bool blnNotes = false; strNotesToolTip = strNotesToolTip + "<table cellpadding='3' cellspacing='0' border='0' width='100%'>"; //Date and Time if (!string.IsNullOrEmpty(objContactCall.StartDate)) { string[] strDateTime = objContactCall.StartDate.Split(' '); if (strDateTime.Length >= 2) { strNotesToolTip = strNotesToolTip + "<tr><td>Date: " + strDateTime[0] + "</td><td>Time: " + strDateTime[1] + "</td></tr>"; blnNotes = true; } } // Duration if (!string.IsNullOrEmpty(objCallStatus.Duration)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Duration: " + objCallStatus.Duration + " mins.</td></tr>"; blnNotes = true; } // Status if (!string.IsNullOrEmpty(objCallStatus.Status)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Status: " + objCallStatus.Status + "</td></tr>"; blnNotes = true; } // Notes if (!string.IsNullOrEmpty(objCallStatus.Notes)) { strNotesToolTip = strNotesToolTip + "<tr><td colspan=2>Notes: </td></tr><tr><td colspan=2>" + objCallStatus.Notes + "</td></tr>"; blnNotes = true; } strNotesToolTip = strNotesToolTip + "</table>"; drProspect["NotesToolTip"] = blnNotes ? strNotesToolTip : "<table cellpadding='3' cellspacing='0' border='0' width='100%'><tr><td> Details Not Available </td></tr></table>"; strNotesToolTip = string.Empty; dtProspect.Rows.Add(drProspect); } } // Bind data with grid if rowcount is greate than 0 else shows No record found message if (dtProspect.Rows.Count > 0) { grdProspect.DataSource = dtProspect; grdProspect.DataBind(); if (dtProspect.Rows.Count == 1) { //spCount.InnerHtml = iTotalRecord.ToString() + " Result Found"; } string pagingstring = ImplementPaging(iPageIndex, iPageSize, iTotalRecord); HtmlForm newForm = Page.Form; newForm.Controls.Clear(); newForm.Controls.Add(grdProspect); var sb = new System.Text.StringBuilder(); var htWriter = new HtmlTextWriter(new System.IO.StringWriter(sb)); newForm.RenderControl(htWriter); string strRenderedHTML = sb.ToString(); string strTottalRecord; int startindex = strRenderedHTML.IndexOf("<table"); int endindex = strRenderedHTML.LastIndexOf("</table>"); int length = (endindex - startindex) + 8; strRenderedHTML = strRenderedHTML.Substring(startindex, length); strTottalRecord = "<span id=spnTotalRecordAsync>" + iTotalRecord.ToString() + "</span>"; strRenderedHTML = "<div style='float: left; width: 746px'>" + strRenderedHTML + "</div>"; Response.Write(strRenderedHTML + pagingstring + "<p class=\"blueboxbotbg_cl\"><img src=\"/App/Images/specer.gif\" width=\"746\" height=\"5\" /></p>" + strTottalRecord); } else { string noRecordFound = "<div style='float:left; width:746px; border:solid 1px #E7F0F5; padding:10px 0px 10px 0px; display:block;' id='dvNoProspectFound' runat='server'>"; noRecordFound = noRecordFound + "<div class='divnoitemfound_custdbrd' style='margin-top:0px;'><p class='divnoitemtxt_custdbrd'><span class='orngbold18_default'>No Records Found</span></p></div></div>"; Response.Write(noRecordFound); } } }
/// <summary> /// Hides convert to host button for franchisor /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void grdProspect_RowDataBound(object sender, GridViewRowEventArgs e) { if (FranchiseeView) { if (e.Row.RowType == DataControlRowType.DataRow) { var currentRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole; if (currentRole.CheckRole((long)Roles.FranchisorAdmin)) { var franchiseeName = e.Row.FindControl("spFranchisee") as HtmlContainerControl; franchiseeName.Style.Add(HtmlTextWriterStyle.Display, "block"); } } } else { if (e.Row.RowType == DataControlRowType.DataRow) { //e.Row.FindControl("spSalesPerson").Visible = true; //e.Row.FindControl("spFranchisee").Visible = false; var spnAssigned = (HtmlContainerControl)e.Row.FindControl("spnAssigned"); if (spnAssigned != null) { if (spnAssigned.InnerHtml.Trim().Equals("2")) { var spnSummary = (HtmlContainerControl)e.Row.FindControl("spnSummary"); if (spnSummary != null) { spnSummary.InnerHtml = "<img src='/App/images/unassigned-icon.gif' title='Unassigned' />"; } } } } } // Code to visible primary contact link if (e.Row.RowType == DataControlRowType.DataRow) { // format phone no. CommonCode objCommonCode = new CommonCode(); var spnName = (HtmlContainerControl)e.Row.FindControl("spnName"); var spnPhone = (HtmlContainerControl)e.Row.FindControl("spnPhone"); var spnEmail = (HtmlContainerControl)e.Row.FindControl("spnEmail"); var spnAddPrimaryContact = (HtmlContainerControl)e.Row.FindControl("spnAddPrimaryContact"); var divNamePhoneEmail = (HtmlContainerControl)e.Row.FindControl("divNamePhoneEmail"); spnName.InnerText = spnName.InnerText.Trim(); spnPhone.InnerText = objCommonCode.FormatPhoneNumberGet(spnPhone.InnerText.Trim()); spnEmail.InnerText = spnEmail.InnerText.Trim(); if (spnName.InnerText.Equals("N/A") && spnPhone.InnerText.Equals("N/A") && spnEmail.InnerText.Equals("N/A")) { spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Display, "block"); spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Visibility, "visible"); // Hide all span divNamePhoneEmail.Style.Add(HtmlTextWriterStyle.Display, "none"); divNamePhoneEmail.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } else { spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Display, "none"); spnAddPrimaryContact.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); } } }
private void GetOutBoundCalls() { // format phone no. CommonCode objCommonCode = new CommonCode(); Int64 iCallType = 0; if (Request["CallType"] != null && Convert.ToString(Request["CallType"]) != "") { iCallType = Convert.ToInt64(Request["CallType"]); } FranchisorDAL objDAL = new FranchisorDAL(); var listNotificationOther = objDAL.GetNotificationOtherPhone(iCallType); ENotificationOther[] objENotificationOther = null; if (listNotificationOther != null) { objENotificationOther = listNotificationOther.ToArray(); } DataTable dtNotification = new DataTable(); dtNotification.Columns.Add("CustomerID", typeof(Int64)); dtNotification.Columns.Add("NotificationPhoneID", typeof(Int64)); dtNotification.Columns.Add("NotificationID", typeof(Int64)); dtNotification.Columns.Add("UserId", typeof(Int64)); dtNotification.Columns.Add("CustomerName"); dtNotification.Columns.Add("NotificationTypeName"); dtNotification.Columns.Add("PhoneOffice"); dtNotification.Columns.Add("PhoneCell"); dtNotification.Columns.Add("PhoneHome"); dtNotification.Columns.Add("DeadLine"); dtNotification.Columns.Add("Source"); dtNotification.Columns.Add("ProspectCustomerId"); dtNotification.Columns.Add("Tag"); dtNotification.Columns.Add("SalesRep"); if (objENotificationOther != null) { for (int icount = 0; icount < objENotificationOther.Length; icount++) { dtNotification.Rows.Add(new object[] { objENotificationOther[icount].CustomerID, objENotificationOther[icount].NotificationPhoneID, objENotificationOther[icount].NotificationID, objENotificationOther[icount].UserID, objENotificationOther[icount].CustomerName, objENotificationOther[icount].NotificationType, objCommonCode.FormatPhoneNumberGet(objENotificationOther[icount].PhoneOffice), objCommonCode.FormatPhoneNumberGet(objENotificationOther[icount].PhoneCell), objCommonCode.FormatPhoneNumberGet(objENotificationOther[icount].PhoneHome), objENotificationOther[icount].NotificationDate, objENotificationOther[icount].Source, objENotificationOther[icount].ProspectCustomerId, objENotificationOther[icount].Tag, string.IsNullOrEmpty(objENotificationOther[icount].SalesRep)?"N/A" : objENotificationOther[icount].SalesRep }); } } if (objENotificationOther.Length > 0) { grdCustomerList.DataSource = dtNotification.DefaultView; grdCustomerList.DataBind(); } else { //divMessage.Style.Add(HtmlTextWriterStyle.Display,"block"); dvNoItemFound.Style["display"] = "block"; } }
private void LoadGrid() { // format phone no. CommonCode objCommonCode = new CommonCode(); var masterDal = new MasterDAL(); List <EEventCustomer> eevent = masterDal.GetCustomerListRoaster(Session["EventID"].ToString(), 0); DataTable tblEvent = new DataTable(); tblEvent.Columns.Add("Serial"); tblEvent.Columns.Add("AppointmentTime", typeof(DateTime)); tblEvent.Columns.Add("CustomerID"); tblEvent.Columns.Add("CustomerName"); tblEvent.Columns.Add("PackageTests"); tblEvent.Columns.Add("Amount"); tblEvent.Columns.Add("Discount"); tblEvent.Columns.Add("PaymentStatus"); tblEvent.Columns.Add("CheckInTime"); tblEvent.Columns.Add("CheckOutTime"); tblEvent.Columns.Add("Signature"); tblEvent.Columns.Add("CouponCode"); tblEvent.Columns.Add("Email"); tblEvent.Columns.Add("Phone"); int i = 1; if (eevent.Count > 0) { foreach (EEventCustomer objEvent in eevent) { string name = CommonClass.FormatName(objEvent.Customer.User.FirstName, "", objEvent.Customer.User.LastName); DateTime appointment = Convert.ToDateTime(objEvent.EventAppointment.StartTime); // string starttime = appointment.ToShortTimeString(); string email = objEvent.Customer.User.EMail1; string phone = objCommonCode.FormatPhoneNumberGet(objEvent.Customer.User.PhoneCell); if (Convert.ToInt32(objEvent.Paid) == 0) { tblEvent.Rows.Add(i, appointment, objEvent.Customer.CustomerID, name, objEvent.EventPackage.Package.PackageName, "$" + objEvent.PaymentDetail.Amount.ToString(), "$" + String.Format("{0:F2}", objEvent.Coupon.CouponValue), "No", objEvent.EventAppointment.CheckInTime, objEvent.EventAppointment.CheckOutTime, "________", objEvent.Coupon.CouponCode, email, phone); } else { tblEvent.Rows.Add(i, appointment, objEvent.Customer.CustomerID, name, objEvent.EventPackage.Package.PackageName, "$" + objEvent.PaymentDetail.Amount.ToString(), "$" + String.Format("{0:F2}", objEvent.Coupon.CouponValue), "Yes", objEvent.EventAppointment.CheckInTime, objEvent.EventAppointment.CheckOutTime, "________", objEvent.Coupon.CouponCode, email, phone); } i++; } } else { divMsg.Visible = true; divMsg.InnerHtml = "No Records of this Event"; img_btnPrint.Visible = false; divError.Visible = false; } //if ((SortDirection)ViewState["SortDirection"] == SortDirection.Ascending) //{ // tblEvent.DefaultView.Sort = "AppointmentTime desc"; // ViewState["SortDirection"] = SortDirection.Descending; //} //else //{ // tblEvent.DefaultView.Sort = "AppointmentTime asc"; // ViewState["SortDirection"] = SortDirection.Ascending; //} tblEvent = tblEvent.DefaultView.ToTable(); grdPrintRoster.DataSource = tblEvent; ViewState["DSGRID"] = tblEvent; Session["TableEventCustomerList"] = (DataTable)ViewState["DSGRID"]; grdPrintRoster.DataBind(); }
/// <summary> /// /// </summary> /// <param name="eventid"></param> public void LoadEventSummaryPanel(EventMetricsViewData eventMetricsViewData, EventHostViewData eventHostViewData, EEvent eventPodDetails) { if (eventMetricsViewData == null || eventHostViewData == null) { return; } // format phone no. CommonCode objCommonCode = new CommonCode(); aPrintBulkResult.HRef = "javascript:showPopup('" + eventHostViewData.EventId + "');"; aExistingCustomer.HRef = ResolveUrl("~/App/Common/SearchCustomer.aspx?Eventid=" + eventHostViewData.EventId); ancopenpopupaddslot.HRef = "/App/Common/AddSlot.aspx?EventDate=" + eventHostViewData.EventDate.ToShortDateString() + "&EventId=" + eventHostViewData.EventId + "&keepThis=true&TB_iframe=true&width=295&height=140&modal=true"; if (IoC.Resolve <ISettings>().ShowPartnerRelease) { aEndOfDay.HRef = "javascript:popupmenu4('/Scheduling/Event/EndofDay?id=" + eventHostViewData.EventId + "',1100,900)"; } updateHostRankingAnchor.HRef = "javascript:popupmenu3('/App/Franchisee/Technician/EndOfDayProcess.aspx?HostRanking=true&EventID=" + eventHostViewData.EventId + "&EventName=" + eventHostViewData.Name.Replace("'", "\\'") + "',550,620)"; Session["EventID"] = eventHostViewData.EventId; ViewState["EventDate"] = eventHostViewData.EventDate; ViewState["EventName"] = eventHostViewData.Name; var notes = IoC.Resolve <IEventRepository>().GetEmrNotes(eventHostViewData.EventId); if (notes != null) { EmrNotes = notes.Text; } Session["EventDate"] = eventHostViewData.EventDate; Session["EventName"] = eventHostViewData.Name; if (Convert.ToDateTime(eventHostViewData.EventDate).Date > DateTime.Now.Date) { spResultStatus.Visible = false; spEndofDay.Style[System.Web.UI.HtmlTextWriterStyle.Display] = "none"; } else { aResultStatus.HRef = "/Medical/Results/ResultStatusList?EventId=" + eventHostViewData.EventId; } speventdate.InnerText = Convert.ToDateTime(eventHostViewData.EventDate).ToShortDateString(); speventloc.InnerText = CommonCode.AddressSingleLine(eventHostViewData.StreetAddressLine1, eventHostViewData.StreetAddressLine2, eventHostViewData.City, eventHostViewData.State, eventHostViewData.Zip); sphostphone.InnerText = objCommonCode.FormatPhoneNumberGet(eventPodDetails.Host.PhoneOffice); var hostFacilityRankingService = IoC.Resolve <IHostFacilityRankingService>(); var hostFacilityRankingbyHsc = hostFacilityRankingService.GetHostFacilityRankingByHSC(eventHostViewData.HostId); if (hostFacilityRankingbyHsc != null) { spPlugPoints.InnerText = hostFacilityRankingbyHsc.NumberOfPlugPoints != null?hostFacilityRankingbyHsc.NumberOfPlugPoints.Value.ToString() : ""; spRoomSize.InnerText = hostFacilityRankingbyHsc.RoomSize; spInternetAccess.InnerText = hostFacilityRankingbyHsc.InternetAccess != null ? hostFacilityRankingbyHsc.InternetAccess.Name : ""; spHostRanking.InnerText = hostFacilityRankingbyHsc.Ranking != null ? hostFacilityRankingbyHsc.Ranking.Name : ""; spRoomNeedCleared.InnerText = hostFacilityRankingbyHsc.RoomNeedsCleared != null ? (hostFacilityRankingbyHsc.RoomNeedsCleared.Value ? "Yes" : "No") : ""; } ViewState["HostName"] = eventHostViewData.OrganizationName; ViewState["HostAddress"] = eventHostViewData.StreetAddressLine1; ViewState["HostCityStateZip"] = eventHostViewData.City + " " + eventHostViewData.State + " " + eventHostViewData.Zip; Session["HostName"] = eventHostViewData.OrganizationName; Session["HostAddress"] = eventHostViewData.StreetAddressLine1; Session["HostCityStateZip"] = eventHostViewData.City + " " + eventHostViewData.State + " " + eventHostViewData.Zip; spEIPdeposit.InnerHtml = decimal.Round(eventMetricsViewData.CashRevenue + eventMetricsViewData.CheckRevenue, 2).ToString(); speventid.InnerHtml = eventHostViewData.EventId.ToString(); spcashpayment.InnerHtml = decimal.Round(eventMetricsViewData.CashRevenue, 2).ToString(); spcardpayment.InnerHtml = decimal.Round(eventMetricsViewData.ChargeCardRevenue, 2).ToString(); spchequepayment.InnerHtml = decimal.Round(eventMetricsViewData.CheckRevenue, 2).ToString(); spBPeCheckPayment.InnerHtml = decimal.Round(eventMetricsViewData.ECheckRevenue, 2).ToString(); decimal totalRevenue = eventMetricsViewData.ChargeCardRevenue + eventMetricsViewData.CheckRevenue + eventMetricsViewData.CashRevenue + eventMetricsViewData.ECheckRevenue + eventMetricsViewData.GiftCertificateRevenue + eventMetricsViewData.UnPaidExcluedeNoShowRevenue; sptotalpayment.InnerHtml = decimal.Round(totalRevenue, 2).ToString(); ancregistered.Text = eventMetricsViewData.RegisteredCustomersCount.ToString(); spncancelled.InnerHtml = "<a href=\"javascript:void(0)\" onclick=\"showCancelledCustomers();\">" + eventMetricsViewData.CancelledCustomersCount.ToString() + "</a>"; ancnoshow.Text = eventMetricsViewData.NoShowCustomersCount.ToString(); ancpaid.Text = eventMetricsViewData.PaidCustomersCount.ToString(); ancunpaid.Text = eventMetricsViewData.UnPaidCount.ToString(); ancactual.Text = eventMetricsViewData.AttendedCustomersCount.ToString(); anccardpaymentcount.Text = eventMetricsViewData.ChargeCardCount.ToString(); anccashpaymentcount.Text = eventMetricsViewData.CashCount.ToString(); ancchequepaymentcount.Text = eventMetricsViewData.CheckCount.ToString(); lnkBPeCheckPayment.Text = eventMetricsViewData.ECheckCount.ToString(); if (eventPodDetails.FranchiseeFranchiseeUser != null) { spnSalesrepname.InnerHtml = eventPodDetails.FranchiseeFranchiseeUser.FranchiseeUser.User.FirstName + " " + eventPodDetails.FranchiseeFranchiseeUser.FranchiseeUser.User.LastName; if (eventPodDetails.FranchiseeFranchiseeUser.FranchiseeUser.User.PhoneHome.Trim().Length > 0) { spnContactInfo.InnerHtml = objCommonCode.FormatPhoneNumberGet(eventPodDetails.FranchiseeFranchiseeUser.FranchiseeUser.User.PhoneHome); } else { spnContactInfo.InnerHtml = eventPodDetails.FranchiseeFranchiseeUser.FranchiseeUser.User.EMail1; } } // BEGIN added upgrade/downgrade story(#7548) spUpgradeCount.InnerHtml = decimal.Round(eventMetricsViewData.UpGradePayments, 2).ToString(); lnkUpgradeCount.Text = eventMetricsViewData.UpGradePaymentCount.ToString(); spDowngradeCount.InnerHtml = Convert.ToString(decimal.Round(eventMetricsViewData.DownGradePayments < 0 ? eventMetricsViewData.DownGradePayments * -1 : eventMetricsViewData.DownGradePayments, 2)); lnkDowngradeCount.Text = eventMetricsViewData.DownGradePaymentCount.ToString(); // END added upgrade/downgrade story(#7548) // BEGIN added upgrade/downgrade story(#7548) //spUpgradeCount.InnerHtml = eventMetricsViewData.UpGradePayments.ToString(); //lnkUpgradeCount.Text = eventMetricsViewData.UpGradePaymentCount.ToString(); //spDowngradeCount.InnerHtml = Convert.ToString(eventMetricsViewData.DownGradePayments < 0 ? eventMetricsViewData.DownGradePayments * -1 : eventMetricsViewData.DownGradePayments); //lnkDowngradeCount.Text = eventMetricsViewData.DownGradePaymentCount.ToString(); int totalCustomer = (eventMetricsViewData.PaidCustomersCount + eventMetricsViewData.UnPaidCount) - eventMetricsViewData.NoShowCustomersCount; _spnAverageRevenueCount.InnerText = totalCustomer > 0 ? decimal.Round((totalRevenue / totalCustomer), 2).ToString() : "0.00"; _lnkAverageCustomers.Text = totalCustomer > 0 ? totalCustomer.ToString() : "0"; _spnUnpaidTotal.InnerText = decimal.Round(eventMetricsViewData.UnPaidExcluedeNoShowRevenue, 2).ToString(); _lnkUnpaidCount.Text = eventMetricsViewData.UnPaidExcluedeNoShowCount.ToString(); // added Onsite for Technician spOnsiteCount.InnerText = decimal.Round(eventMetricsViewData.OnsitePayments, 2).ToString(); lnkOnsiteCount.Text = eventMetricsViewData.OnsitePaymentCount.ToString(); // END added upgrade/downgrade story(#7548) //TODO: Need to filter customers paid by GC // added giftCertificate _spnGcPaymentTotal.InnerText = decimal.Round(eventMetricsViewData.GiftCertificateRevenue, 2).ToString(); _lnkGcPaymentCount.Text = eventMetricsViewData.GiftCertificateCount.ToString(); // Added HipaaStatus decimal _HipaapercentageDecimal; if (eventMetricsViewData.HipaaSignedCount > 0) { _HipaapercentageDecimal = Math.Round( Convert.ToDecimal(eventMetricsViewData.HipaaSignedCount) / Convert.ToDecimal(eventMetricsViewData.HipaaSignedCount + eventMetricsViewData.HipaaUnSignedCount) * 100, 2); _spnHippaStatus.InnerHtml = Convert.ToString(_HipaapercentageDecimal) + "% " + "(" + eventMetricsViewData.HipaaSignedCount + "/" + (eventMetricsViewData.HipaaSignedCount + eventMetricsViewData.HipaaUnSignedCount) + ")"; } else { _spnHippaStatus.InnerHtml = "0% (0/0)"; } txtEventNotes.Text = eventHostViewData.TechnicianNotes; sphostname.InnerHtml = eventHostViewData.OrganizationName; sphostname.InnerHtml = eventHostViewData.OrganizationName; string googleMapLink = CommonCode.GetGoogleMapAddress(eventHostViewData.StreetAddressLine1, eventHostViewData.City, eventHostViewData.State, eventHostViewData.Zip, eventHostViewData.Latitude + "," + eventHostViewData.Longitude, eventHostViewData.UseLatitudeAndLongitudeForMapping); agmap.HRef = googleMapLink; //agmap.HRef = "http://maps.google.com/maps?f=q&hl=en&geocode=&q=" + objevent.Host.Address.Address1 + "," + objevent.Host.Address.City + "," + objevent.Host.Address.State + "," + objevent.Host.Address.Zip + "&ie=UTF8&z=16"; // Set Google Address Verification Status if (eventHostViewData.GoogleAddressVerifiedBy.HasValue) { string googleAddressVerified = GetAddressVerifiedUser(eventHostViewData.GoogleAddressVerifiedBy.Value); _addressVerifiedStatus.InnerHtml = googleAddressVerified; } else { _addressVerifiedStatus.InnerHtml = CommonCode.GetGoogleAddressNotVerifiedJtip(); } string poddetailstring = "N/A"; foreach (EEventPod objeventpod in eventPodDetails.EventPod) { if (poddetailstring == "N/A") { poddetailstring = ""; } string strpodteam = string.Empty; string strpoddescription = string.Empty; string vandescription = string.Empty; strpoddescription = "<p class='prow'>Processing Capacity of " + objeventpod.Pod.PodProcessingCapacity.ToString() + " </p>"; vandescription = "<p class='prow'> Vehicle: " + objeventpod.Pod.Van.Name + "," + objeventpod.Pod.Van.Make + " (" + objeventpod.Pod.Van.VIN + ") </p>"; foreach (EFranchiseeFranchiseeUser objfranchiseefruser in objeventpod.Pod.TeamIDList) { strpodteam += "• " + objfranchiseefruser.FranchiseeUser.User.FirstName + " " + objfranchiseefruser.FranchiseeUser.User.MiddleName + " " + objfranchiseefruser.FranchiseeUser.User.LastName + "(" + objfranchiseefruser.RoleType + ")(" + objfranchiseefruser.FranchiseeFranchiseeUserID + ")<br />"; } string currentpod = "<div class='maindiv_roundmbox_ecl'>" + strpoddescription; currentpod += vandescription; currentpod += "<p class='prow'><u>Team Detail</u></p>"; currentpod += "<p class='prow'>" + strpodteam + "</p></div>"; poddetailstring = poddetailstring + objeventpod.Pod.Name + "<a href='javascript:void(0)' class='apd jtipLocal' title=\"Pod Details|" + currentpod + "\"> (More Info) </a>"; } sppoddetail.InnerHtml = poddetailstring; }
private void SearchFAUser(string searchtext) { FranchisorDAL franchisorDal = new FranchisorDAL(); var listFranchisorFranchisorUser = franchisorDal.GetFranchisorFranchisorUser(searchtext, 2); EFranchisorFranchisorUser[] franchisoruser = null; // format phone no. CommonCode objCommonCode = new CommonCode(); if (listFranchisorFranchisorUser != null) { franchisoruser = listFranchisorFranchisorUser.ToArray(); } DataTable dtFAUser = new DataTable(); dtFAUser.Columns.Add("FranchisorFranchisorUserID"); dtFAUser.Columns.Add("name"); dtFAUser.Columns.Add("address"); dtFAUser.Columns.Add("phonecell"); dtFAUser.Columns.Add("UserID"); string strAddress = string.Empty; if (franchisoruser != null && franchisoruser.Length > 0) { for (int icount = 0; icount < franchisoruser.Length; icount++) { strAddress = Falcon.App.Lib.CommonCode.AddressSingleLine(franchisoruser[icount].FranchisorUser.User.HomeAddress.Address1, franchisoruser[icount].FranchisorUser.User.HomeAddress.Address2, franchisoruser[icount].FranchisorUser.User.HomeAddress.City, franchisoruser[icount].FranchisorUser.User.HomeAddress.State, franchisoruser[icount].FranchisorUser.User.HomeAddress.Zip); dtFAUser.Rows.Add(new object[] { franchisoruser[icount].FranchisorFranchisorUserID, franchisoruser[icount].FranchisorUser.User.FirstName + " " + franchisoruser[icount].FranchisorUser.User.LastName, strAddress, objCommonCode.FormatPhoneNumberGet(franchisoruser[icount].FranchisorUser.User.PhoneCell.ToString()), franchisoruser[icount].FranchisorUser.User.UserID.ToString() }); } } else { divErrorMsg.InnerText = "No records found"; divErrorMsg.Visible = true; } if ((SortDirection)ViewState["SortFAUser"] == SortDirection.Descending) { dtFAUser.DefaultView.Sort = "name desc"; } else { dtFAUser.DefaultView.Sort = "name asc"; } dtFAUser = dtFAUser.DefaultView.ToTable(); dtFAUser.DefaultView.RowFilter = "UserID <> " + IoC.Resolve <ISessionContext>().UserSession.UserId; grdFAUser.DataSource = dtFAUser.DefaultView; ViewState["DSGRID"] = dtFAUser; grdFAUser.DataBind(); //grdFAUser.Sort("name", SortDirection.Ascending); hfFranchisorUserID.Value = ""; }
/// <summary> /// /// </summary> /// <param name="bolroster"></param> private void LoadGrid(bool bolroster) { // format phone no. CommonCode objCommonCode = new CommonCode(); var masterDal = new MasterDAL(); List <Falcon.Entity.Other.EEventCustomer> eevent; if (bolroster) { eevent = masterDal.GetCustomerListRoaster(speventid.InnerHtml, 0); } else { eevent = masterDal.GetCustomerListRoaster(speventid.InnerHtml, 1); } DataTable tblEvent = new DataTable(); tblEvent.Columns.Add("Serial"); tblEvent.Columns.Add("AppointmentTime"); tblEvent.Columns.Add("CustomerID"); tblEvent.Columns.Add("CustomerName"); tblEvent.Columns.Add("firstName"); tblEvent.Columns.Add("lastName"); tblEvent.Columns.Add("Package"); tblEvent.Columns.Add("AdditionalTests"); tblEvent.Columns.Add("Amount"); tblEvent.Columns.Add("Discount"); tblEvent.Columns.Add("PaymentStatus"); tblEvent.Columns.Add("CheckInTime"); tblEvent.Columns.Add("CheckOutTime"); tblEvent.Columns.Add("CouponCode"); tblEvent.Columns.Add("Email"); tblEvent.Columns.Add("Phone"); tblEvent.Columns.Add("IsShippingApplied"); tblEvent.Columns.Add("Notes"); tblEvent.Columns.Add("Signature"); tblEvent.Columns.Add("AddOn"); tblEvent.Columns.Add("KynStatus"); tblEvent.Columns.Add("PCPInfo"); tblEvent.Columns.Add("MSPInfo"); int regcustomercount = 0; int i = 1; var customerCallNotesRepository = IoC.Resolve <ICustomerCallNotesRepository>(); var productRepository = IoC.Resolve <IElectronicProductRepository>(); var shippingDetailRepository = IoC.Resolve <IShippingDetailRepository>(); var shippingOptionRepository = IoC.Resolve <IShippingOptionRepository>(); var eventSchedulingSlotRepository = IoC.Resolve <IEventSchedulingSlotRepository>(); var eventPodRoomRepository = IoC.Resolve <IEventPodRoomRepository>(); var appointmentRepository = IoC.Resolve <IAppointmentRepository>(); var eventAppointmentService = IoC.Resolve <IEventAppointmentService>(); var customerMedicareService = IoC.Resolve <ICustomerMedicareQuestionService>(); var slots = eventSchedulingSlotRepository.GetbyEventId(Convert.ToInt64(speventid.InnerHtml)); var eventPodRooms = eventPodRoomRepository.GetByEventId(Convert.ToInt64(speventid.InnerHtml)); var eventPodRepository = IoC.Resolve <IEventPodRepository>(); var isKynIntegrationEnabled = eventPodRepository.IsKynIntegrationEnabled(EventId); var pcpRepository = IoC.Resolve <PrimaryCarePhysicianRepository>(); var kynHealthAssessmentHelper = IoC.Resolve <IKynHealthAssessmentHelper>(); var eventCustomerRepository = IoC.Resolve <IEventCustomerRepository>(); var customerIds = eevent.Select(x => x.Customer.CustomerID); var pcpCustomerList = pcpRepository.GetByCustomerIds(customerIds); var eventCustomers = eventCustomerRepository.GetbyEventId(EventId); var orderMedicareSavedDate = customerMedicareService.GetEvenetCustomerMedicareSavedDatePair(EventId); if (eevent.Count > 0) { foreach (EEventCustomer objEvent in eevent) { string name = CommonClass.FormatName(objEvent.Customer.User.FirstName, "", objEvent.Customer.User.LastName); string firstName = objEvent.Customer.User.FirstName; string lastName = objEvent.Customer.User.LastName; DateTime appointment = Convert.ToDateTime(objEvent.EventAppointment.StartTime); var bookedAppointment = appointmentRepository.GetById(objEvent.EventAppointment.AppointmentID); var roomSlots = eventAppointmentService.GetRoomSlots(slots, bookedAppointment, eventPodRooms); var appointmentString = string.Format("{0:hh:mm tt}", appointment); if (roomSlots != null && roomSlots.Any()) { var roomSlotString = "<hr style='border:solid 1px #000000;' />"; foreach (var roomSlot in roomSlots) { roomSlotString += roomSlot.FirstValue + " - " + roomSlot.SecondValue.ToShortTimeString() + "<br />"; } appointmentString += roomSlotString; } // string starttime = appointment.ToShortTimeString(); string email = objEvent.Customer.User.EMail1; var user = objEvent.Customer.User; var validPhoneNumber = (!string.IsNullOrEmpty(user.PhoneHome) ? user.PhoneHome : (!string.IsNullOrEmpty(user.PhoneCell) ? user.PhoneCell : (!string.IsNullOrEmpty(user.PhoneOffice) ? user.PhoneOffice : ""))); string phone = objCommonCode.FormatPhoneNumberGet(validPhoneNumber); if (objEvent.Customer.CustomerID > 0) { regcustomercount++; } string shipping = objEvent.IsShippingApplied ? objEvent.Paid ? "Y" : "N" : "-"; string paid = objEvent.Paid ? "Y/" + shipping : "N/" + shipping; string couponAmount = !string.IsNullOrEmpty(objEvent.Coupon.CouponCode) ? String.Format("{0:C2}", objEvent.Coupon.CouponValue) : ""; var eventCallNotes = customerCallNotesRepository.GetEventCustomerAppointmentNotes(objEvent.Customer.CustomerID, EventId).ToList(); eventCallNotes = eventCallNotes.Where(e => !string.IsNullOrEmpty(e.Notes)).Select(e => e).ToList(); //var customerCallNotes = customerCallNotesRepository.GetCustomerNotes(objEvent.Customer.CustomerID).ToList(); //eventCallNotes.AddRange(customerCallNotes); string notes = string.Empty; if (eventCallNotes.Count > 0) { notes = string.Concat("<ul><li>", String.Join("</li><li>", eventCallNotes.Select(e => e.Notes)), " </li></ul>"); } var addOnProduct = productRepository.GetElectronicProductForOrder(EventId, objEvent.Customer.CustomerID); var additionalShipping = false; var cdShipping = false; var shippingDetails = shippingDetailRepository.GetShippingDetailsForEventCustomer(EventId, objEvent.Customer.CustomerID); var cdShippingOption = shippingOptionRepository.GetShippingOptionByProductId((long)Product.UltraSoundImages); if (shippingDetails != null && shippingDetails.Count() > 0) { additionalShipping = shippingDetails.Where(sd => sd.ActualPrice > 0).Any(); if (cdShippingOption != null) { cdShipping = shippingDetails.Where(sd => sd.ShippingOption.Id == cdShippingOption.Id).Any(); } } var addOn = "No"; if (addOnProduct != null && addOnProduct.Id == (long)Product.PremiumVersionPdf) { addOn = "Yes"; } else if (addOnProduct != null && addOnProduct.Id == (long)Product.UltraSoundImages && cdShipping) { addOn = "CD"; } else if (addOnProduct != null && addOnProduct.Id == (long)Product.UltraSoundImages && !cdShipping) { addOn = "Online"; } var kynStatus = "N/A"; var isPCPInfoAvilable = "No"; if (pcpCustomerList != null && pcpCustomerList.Any() && pcpCustomerList.Any(x => objEvent.Customer.CustomerID == x.CustomerId)) { isPCPInfoAvilable = "Yes"; } if (isKynIntegrationEnabled) { var isPreFilled = kynHealthAssessmentHelper.IsKynHafPrefilled(EventId, objEvent.Customer.CustomerID, Convert.ToDateTime(EventDate.ToShortDateString() + " " + appointment.ToShortTimeString())); if (isPreFilled.HasValue) { kynStatus = isPreFilled.Value ? "Yes" : "No"; } } var mspFilled = "N/A"; var isPurchased = customerMedicareService.IsTestPurchased(EventId, objEvent.Customer.CustomerID, new[] { (long)TestType.Medicare, (long)TestType.AWV, (long)TestType.AwvSubsequent }); var eventcustomerID = eventCustomers.First(x => x.CustomerId == objEvent.Customer.CustomerID).Id; if (isPurchased) { var isMedicareAnswers = orderMedicareSavedDate != null && orderMedicareSavedDate.Any(x => x.FirstValue == eventcustomerID && x.SecondValue.Date.AddDays(1) <= EventDate.Date); mspFilled = isMedicareAnswers ? "Yes" : "No"; } tblEvent.Rows.Add(i, appointmentString, objEvent.Customer.CustomerID, name, firstName, lastName, objEvent.EventPackage.Package.PackageName, objEvent.AdditionalTest, objEvent.PaymentDetail.Amount.ToString("C2"), couponAmount, paid, objEvent.EventAppointment.CheckInTime, objEvent.EventAppointment.CheckOutTime, objEvent.Coupon.CouponCode, email, phone, objEvent.IsShippingApplied, notes, "___________", addOn, kynStatus, isPCPInfoAvilable, mspFilled); i++; } } Recordcount = tblEvent.Rows.Count; dgprintroster.DataSource = tblEvent; dgprintroster.DataBind(); spcustomercount.InnerHtml = regcustomercount.ToString(); }
private void GetContactFranchisee() { List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> franchiseefranchiseeuser = null; FranchiseeDAL franchiseeDAL = new FranchiseeDAL(); // format phone no. CommonCode objCommonCode = new CommonCode(); var currentSession = IoC.Resolve <ISessionContext>().UserSession; var currentOrgRole = IoC.Resolve <ISessionContext>().UserSession.CurrentOrganizationRole; if (currentOrgRole.CheckRole((long)Roles.SalesRep)) { franchiseefranchiseeuser = franchiseeDAL.ContactFranchisee(currentSession.CurrentOrganizationRole.OrganizationId.ToString(), 2); } else { franchiseefranchiseeuser = franchiseeDAL.ContactFranchisee(string.Empty, 0); } DataTable dtFranchiseeUser = new DataTable(); dtFranchiseeUser.Columns.Add("FranhiseeFranchiseeUserID"); dtFranchiseeUser.Columns.Add("Name"); dtFranchiseeUser.Columns.Add("Address"); dtFranchiseeUser.Columns.Add("Phone"); dtFranchiseeUser.Columns.Add("Email"); if (franchiseefranchiseeuser != null) { for (int icount = 0; icount < franchiseefranchiseeuser.Count; icount++) { string Name = CommonClass.FormatName(franchiseefranchiseeuser[icount].FranchiseeUser.User.FirstName, "", franchiseefranchiseeuser[icount].FranchiseeUser.User.LastName); string Address = CommonClass.FormatAddress(franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Address1, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Address2, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.City, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.State, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Country, franchiseefranchiseeuser[icount].FranchiseeUser.User.HomeAddress.Zip); dtFranchiseeUser.Rows.Add(new object[] { franchiseefranchiseeuser[icount].FranchiseeFranchiseeUserID, Name, Address, objCommonCode.FormatPhoneNumberGet(franchiseefranchiseeuser[icount].FranchiseeUser.User.PhoneOffice), franchiseefranchiseeuser[icount].FranchiseeUser.User.EMail1 }); } } if ((SortDirection)ViewState["SortContactFranchisee"] == SortDirection.Descending) { dtFranchiseeUser.DefaultView.Sort = "name desc"; } else { dtFranchiseeUser.DefaultView.Sort = "name asc"; } dtFranchiseeUser = dtFranchiseeUser.DefaultView.ToTable(); gridcontactfranchisee.DataSource = dtFranchiseeUser; ViewState["DSGRID"] = dtFranchiseeUser; gridcontactfranchisee.DataBind(); }
public void BindCustomerList(List <EEventCustomer> arrcustomer) { // format phone no. var objCommonCode = new CommonCode(); var dtcustomerlist = new DataTable(); dtcustomerlist.Columns.Add("CustomerID"); dtcustomerlist.Columns.Add("CustomerName"); dtcustomerlist.Columns.Add("CheckInTime"); dtcustomerlist.Columns.Add("CheckOutTime"); dtcustomerlist.Columns.Add("AppointmentID"); dtcustomerlist.Columns.Add("ScheduledByID"); dtcustomerlist.Columns.Add("IsTimeSaved"); dtcustomerlist.Columns.Add("PackageID"); dtcustomerlist.Columns.Add("PackageName"); dtcustomerlist.Columns.Add("PackageCost"); dtcustomerlist.Columns.Add("CouponCode"); dtcustomerlist.Columns.Add("CouponValue"); dtcustomerlist.Columns.Add("NetPayment"); dtcustomerlist.Columns.Add("IsPaid"); dtcustomerlist.Columns.Add("AppointmentTime", typeof(DateTime)); dtcustomerlist.Columns.Add("EventCustomerID"); dtcustomerlist.Columns.Add("Email"); dtcustomerlist.Columns.Add("Phone"); dtcustomerlist.Columns.Add("NoShow", typeof(Boolean)); dtcustomerlist.Columns.Add("Reason"); dtcustomerlist.Columns.Add("Subject"); dtcustomerlist.Columns.Add("IsTestConducted", typeof(Boolean)); dtcustomerlist.Columns.Add("UserDateCreated"); dtcustomerlist.Columns.Add("IsMedicalHistoryFilled"); dtcustomerlist.Columns.Add("IsResultReady"); dtcustomerlist.Columns.Add("CustomerEventTestID"); dtcustomerlist.Columns.Add("TestStatus"); dtcustomerlist.Columns.Add("UserCreationMode"); dtcustomerlist.Columns.Add("EventCount"); dtcustomerlist.Columns.Add("RegisteredBy"); dtcustomerlist.Columns.Add("DateRegisteredOn"); dtcustomerlist.Columns.Add("MedicalHistoryURLQuStr"); dtcustomerlist.Columns.Add("IsAuthorized", typeof(bool)); for (int icount = 0; icount < arrcustomer.Count; icount++) { ECustomers objcustomer = arrcustomer[icount].Customer; string packageTestnameString = string.Empty; string customername = objcustomer.User.FirstName; if (objcustomer.User.MiddleName.Length > 0) { customername += " " + objcustomer.User.MiddleName; } customername += " " + objcustomer.User.LastName; DateTime appointmenttime = Convert.ToDateTime(arrcustomer[icount].EventAppointment.StartTime); string paymentstatus = ""; if (arrcustomer[icount].Paid == true) { paymentstatus = "PAID"; } else { paymentstatus = "NOT PAID"; } string couponcode = "N/A"; string couponvalue = "0.00"; if (!arrcustomer[icount].Coupon.CouponCode.Equals("0")) { couponcode = arrcustomer[icount].Coupon.CouponCode; } if (!arrcustomer[icount].Coupon.CouponAmount.ToString().Equals("0")) { couponvalue = arrcustomer[icount].Coupon.CouponAmount.ToString(); } string strmedicalhistoryqustr = "CustomerID=" + objcustomer.CustomerID + "&Package=" + arrcustomer[icount].EventPackage.Package.PackageName.Replace(" ", "@").Replace("+", "*"); if (arrcustomer[icount].Customer.IsHistoryFilled) { strmedicalhistoryqustr += "&Edit=true"; } string usercreateddate = ""; string phoneCell = objcustomer.User.PhoneCell; if (objCommonCode.FormatPhoneNumberGet(phoneCell).Length > 0) { phoneCell = "PH:" + objCommonCode.FormatPhoneNumberGet(phoneCell); } if (arrcustomer[icount].Customer.User.DateApplied != null) { usercreateddate = arrcustomer[icount].Customer.User.DateApplied.ToString(); } Session["PackageName"] = arrcustomer[icount].EventPackage.Package.PackageName; if ((!string.IsNullOrEmpty(arrcustomer[icount].EventPackage.Package.PackageName)) && (!string.IsNullOrEmpty(arrcustomer[icount].AdditionalTest))) { packageTestnameString = arrcustomer[icount].EventPackage.Package.PackageName + ", " + arrcustomer[icount].AdditionalTest; } else { packageTestnameString = !string.IsNullOrEmpty(arrcustomer[icount].EventPackage.Package.PackageName) ? arrcustomer[icount].EventPackage.Package.PackageName : arrcustomer[icount].AdditionalTest; } if (arrcustomer[icount].EventAppointment.CheckInTime.Length < 1 || arrcustomer[icount].EventAppointment.CheckOutTime.Length < 1) { dtcustomerlist.Rows.Add(new object[] { objcustomer.CustomerID, customername, arrcustomer[icount].EventAppointment.CheckInTime, arrcustomer[icount].EventAppointment.CheckOutTime, arrcustomer[icount].EventAppointment.AppointmentID.ToString(), arrcustomer[icount].EventAppointment.ScheduleByID.ToString(), "NULL", arrcustomer[icount].EventPackage.Package.PackageID, packageTestnameString, "$" + arrcustomer[icount].EventPackage.PackagePrice, couponcode, couponvalue, "$" + arrcustomer[icount].PaymentDetail.Amount, paymentstatus, appointmenttime, arrcustomer[icount].CustomerEventTestID.ToString(), objcustomer.User.EMail1, phoneCell, arrcustomer[icount].NoShow, arrcustomer[icount].EventAppointment.Reason, arrcustomer[icount].EventAppointment.Subject, arrcustomer[icount].TestConducted, usercreateddate, arrcustomer[icount].Customer.IsHistoryFilled, arrcustomer[icount].Customer.IsResultsReady, arrcustomer[icount].EventCustomerID, arrcustomer[icount].CustomerTestStatus, arrcustomer[icount].Customer.UserCreationMode, arrcustomer[icount].Customer.EventCount > 0 ? arrcustomer[icount].Customer.EventCount - 1 : arrcustomer[icount].Customer.EventCount, arrcustomer[icount].RegisteredBy, arrcustomer[icount].DateCreated.ToString("MM/dd/yyyy"), strmedicalhistoryqustr, arrcustomer[icount].IsAuthorized }); } else { dtcustomerlist.Rows.Add(new object[] { objcustomer.CustomerID, customername, arrcustomer[icount].EventAppointment.CheckInTime, arrcustomer[icount].EventAppointment.CheckOutTime, arrcustomer[icount].EventAppointment.AppointmentID.ToString(), arrcustomer[icount].EventAppointment.ScheduleByID.ToString(), "DB", arrcustomer[icount].EventPackage.Package.PackageID, packageTestnameString, "$" + arrcustomer[icount].EventPackage.PackagePrice, couponcode, couponvalue, "$" + arrcustomer[icount].PaymentDetail.Amount, paymentstatus, appointmenttime, arrcustomer[icount].CustomerEventTestID.ToString(), objcustomer.User.EMail1, phoneCell, arrcustomer[icount].NoShow, arrcustomer[icount].EventAppointment.Reason, arrcustomer[icount].EventAppointment.Subject, arrcustomer[icount].TestConducted, usercreateddate, arrcustomer[icount].Customer.IsHistoryFilled, arrcustomer[icount].Customer.IsResultsReady, arrcustomer[icount].EventCustomerID, arrcustomer[icount].CustomerTestStatus, arrcustomer[icount].Customer.UserCreationMode, arrcustomer[icount].Customer.EventCount > 0 ? arrcustomer[icount].Customer.EventCount - 1 : arrcustomer[icount].Customer.EventCount, arrcustomer[icount].RegisteredBy, arrcustomer[icount].DateCreated.ToString("MM/dd/yyyy"), strmedicalhistoryqustr, arrcustomer[icount].IsAuthorized }); } } /* added for sorting while keeping the filters applied */ dtcustomerlist.DefaultView.RowFilter = ""; /* **************************************************** */ if (dtcustomerlist.DefaultView.Count < 1) { innerDivCancelledCustomers.Style[HtmlTextWriterStyle.Display] = "none"; divNoRecordsFound.Style[HtmlTextWriterStyle.Display] = "block"; } else { innerDivCancelledCustomers.Style[HtmlTextWriterStyle.Display] = "block"; divNoRecordsFound.Style[HtmlTextWriterStyle.Display] = "none"; grdeventCancelledcustomers.DataSource = dtcustomerlist.DefaultView; grdeventCancelledcustomers.DataBind(); //string strformingpackagestring = ""; //string defview = dtcustomerlist.DefaultView.RowFilter; //ArrayList arrpackagename = new ArrayList(); //for (int vwcounter = 0; vwcounter < dtcustomerlist.DefaultView.Count; vwcounter++) //{ // string packagename = dtcustomerlist.DefaultView[vwcounter]["PackageName"].ToString(); // if (arrpackagename.Count > 0) // { // if (arrpackagename.Contains(packagename)) // continue; // } // arrpackagename.Add(packagename); // dtcustomerlist.DefaultView.RowFilter = "PackageName = '" + packagename + "'"; // if (dtcustomerlist.DefaultView.Count > 0) // strformingpackagestring += packagename + ": <b>" + dtcustomerlist.DefaultView.Count + " </b> | "; // dtcustomerlist.DefaultView.RowFilter = defview; //} } }
/// <summary> /// /// </summary> /// <param name="arrContact"></param> private void LoadGrid(EContact[] arrContact, int itotalcount) { if (arrContact != null && arrContact.Length > 0) { // format phone no. CommonCode objCommonCode = new CommonCode(); DataTable tblContact = new DataTable(); aBusinessView.HRef = ""; aGridView.HRef = ""; aGridView.Style[HtmlTextWriterStyle.Cursor] = "default"; aBusinessView.Style[HtmlTextWriterStyle.Cursor] = "default"; tblContact.Columns.Add("ContactID", typeof(Int32)); //tblContact.Columns.Add("ProspectID", typeof(Int32)); tblContact.Columns.Add("FirstName"); tblContact.Columns.Add("LastName"); tblContact.Columns.Add("Address"); tblContact.Columns.Add("Email"); tblContact.Columns.Add("PhoneOffice"); tblContact.Columns.Add("PhoneHome"); tblContact.Columns.Add("PhoneCell"); tblContact.Columns.Add("Fax"); tblContact.Columns.Add("ContactType"); foreach (EContact objContact in arrContact) { string address = ""; string name = string.Empty; if (objContact.Address.Address1.Length > 0) { address = CommonClass.FormatAddress(objContact.Address.Address1, objContact.Address.Address2, objContact.Address.City, objContact.Address.State, objContact.Address.Zip.ToString()); } name = CommonClass.FormatName(objContact.FirstName, "", objContact.LastName); tblContact.Rows.Add(objContact.ContactID, objContact.FirstName, objContact.LastName, address, objContact.EMail, objCommonCode.FormatPhoneNumberGet(objContact.PhoneOffice), objCommonCode.FormatPhoneNumberGet(objContact.PhoneHome), objCommonCode.FormatPhoneNumberGet(objContact.PhoneCell), objCommonCode.FormatPhoneNumberGet(objContact.Fax), objContact.County); } divErrorMsg.Visible = false; btnDelete.Enabled = true; btnEdit.Enabled = true; btnDelete.ImageUrl = "../Images/del-button.gif"; divViewGrid.Visible = false; divViewBusinessCards.Visible = false; if ((EViewType)ViewState["ViewType"] == EViewType.GRID) { aBusinessView.HRef = "javascript:onViewChange();"; aBusinessView.Style[HtmlTextWriterStyle.Cursor] = "pointer"; divViewGrid.Visible = true; grdContacts.DataSource = tblContact; grdContacts.DataBind(); btnDelete.OnClientClick = "return validate('Delete');"; divViewBusinessCards.EnableViewState = false; dlContacts.EnableViewState = false; tblGridPaging.InnerHtml = ImplementPaging(Convert.ToInt32(ViewState["PageNumber"]), Convert.ToInt16(ViewState["PageSize"]), itotalcount); } else { aGridView.HRef = "javascript:onViewChange();"; aGridView.Style[HtmlTextWriterStyle.Cursor] = "pointer"; dlContacts.Visible = true; tblListPaging.Visible = true; divViewBusinessCards.Visible = true; dlContacts.DataSource = tblContact; dlContacts.DataBind(); btnDelete.OnClientClick = "return DeleteDlist();"; divViewGrid.EnableViewState = false; grdContacts.EnableViewState = false; tblListPaging.InnerHtml = ImplementPaging(Convert.ToInt32(ViewState["PageNumber"]), Convert.ToInt16(ViewState["PageSize"]), itotalcount); } } else { if ((EViewType)ViewState["ViewType"] == EViewType.GRID) { divViewBusinessCards.Visible = false; divViewGrid.Visible = false; } else { divViewGrid.Visible = false; dlContacts.Visible = false; tblListPaging.Visible = false; } divErrorMsg.Visible = true; divErrorMsg.InnerHtml = (String)GetGlobalResourceObject("Resource", "msgNoRecordFound"); btnEdit.ImageUrl = "../Images/edit-button-disable.gif"; btnDelete.ImageUrl = "../Images/del-button-d.gif"; btnDelete.Enabled = false; btnEdit.Enabled = false; } }
/// <summary> /// get the Medical Vendor Data and fill the session object /// </summary> private void FillMedicalVendorData() { // format phone no. CommonCode objCommonCode = new CommonCode(); MedicalVendorDAL medicalvendorDAL = new MedicalVendorDAL(); var listmedicalvendor = medicalvendorDAL.GetMedicalVendor(IoC.Resolve <ISessionContext>().UserSession.UserId.ToString(), Convert.ToInt64(IoC.Resolve <SessionContext>().UserSession.CurrentOrganizationRole.OrganizationId), Roles.MedicalVendorAdmin.ToString(), 1); if (listmedicalvendor != null) { medicalvendor = listmedicalvendor.ToArray(); } name.InnerText = medicalvendor[0].MVUser.User.FirstName + " " + medicalvendor[0].MVUser.User.MiddleName + " " + medicalvendor[0].MVUser.User.LastName; dvDescription.InnerText = medicalvendor[0].Description; spFname.InnerText = medicalvendor[0].MVUser.User.FirstName; spMname.InnerText = medicalvendor[0].MVUser.User.MiddleName; spLname.InnerText = medicalvendor[0].MVUser.User.LastName; ///new changes DateTime DOB = Convert.ToDateTime(medicalvendor[0].MVUser.User.DOB); spDOB.InnerText = DOB.ToString("MMMM dd, yyyy"); spSSN.InnerText = medicalvendor[0].MVUser.User.SSN; spPayMode.InnerText = ((EPaymentType)medicalvendor[0].PaymentMode).ToString(); spPayInterval.InnerText = ((PaymentFrequency)medicalvendor[0].Interval).ToString(); /// spAddress1.InnerText = medicalvendor[0].MVUser.User.HomeAddress.Address1; spAddress2.InnerText = medicalvendor[0].MVUser.User.HomeAddress.Address2; spState.InnerText = medicalvendor[0].MVUser.User.HomeAddress.State; spCountry.InnerText = medicalvendor[0].MVUser.User.HomeAddress.Country; spCity.InnerText = medicalvendor[0].MVUser.User.HomeAddress.City; spZip.InnerText = medicalvendor[0].MVUser.User.HomeAddress.Zip; spPhoneHome.InnerText = objCommonCode.FormatPhoneNumberGet(medicalvendor[0].MVUser.User.PhoneHome); spPhoneCell.InnerText = objCommonCode.FormatPhoneNumberGet(medicalvendor[0].MVUser.User.PhoneCell); spPhoneOther.InnerText = objCommonCode.FormatPhoneNumberGet(medicalvendor[0].MVUser.User.PhoneOffice); spEmail1.InnerText = medicalvendor[0].MVUser.User.EMail1; spEmail2.InnerText = medicalvendor[0].MVUser.User.EMail2; spSpecialization.InnerText = medicalvendor[0].MVUser.MVUserSpecialization.Name; ///spSignature.InnerText = medicalvendor[0].MVUser.MVUserSpecialization.Name; spContract.InnerText = medicalvendor[0].Contract.Name; CommonCode objCCode = new CommonCode(); imgmyphto.ImageUrl = objCCode.GetPicture(Request.MapPath(medicalvendor[0].MVUser.MyPicture), medicalvendor[0].MVUser.MyPicture); imgmyteam.ImageUrl = objCCode.GetPicture(Request.MapPath(medicalvendor[0].MVUser.TeamPicture), medicalvendor[0].MVUser.TeamPicture); dvRole.InnerText = IoC.Resolve <SessionContext>().UserSession.CurrentOrganizationRole.RoleAlias; /// fill business details spBAddress1.InnerText = medicalvendor[0].BusinessAddress.Address1; spBAddress2.InnerText = medicalvendor[0].BusinessAddress.Address2; spBState.InnerText = medicalvendor[0].BusinessAddress.State; spBCountry.InnerText = medicalvendor[0].BusinessAddress.Country; spBCity.InnerText = medicalvendor[0].BusinessAddress.City; spBZip.InnerText = medicalvendor[0].BusinessAddress.Zip; spBPhone.InnerText = objCCode.FormatPhoneNumberGet(medicalvendor[0].BusinessPhone); spBFax.InnerText = objCCode.FormatPhoneNumberGet(medicalvendor[0].BusinessFax); spBVendorType.InnerText = medicalvendor[0].MedicalVendorType.Name; ucOtherPhoto.Images = medicalvendor[0].MVUser.OtherPictures.ToList(); }
private void LoadData() { // format phone no. CommonCode objCommonCode = new CommonCode(); var masterDal = new MasterDAL(); EEvent objevent; string rolename = ""; bool abondonedCustomer = false; if (Request.QueryString["RoleName"] != null) { rolename = Request.QueryString["RoleName"].ToString(); } if (rolename == "FranchiseeAdmin") { divCustomer.Style.Add(HtmlTextWriterStyle.Display, "none"); } else { divCustomer.Style.Add(HtmlTextWriterStyle.Display, "block"); } if (Request.QueryString.Count < 3) { long pageCount; objevent = masterDal.GetCustomerList(0, "", "", "", "", "", "", 0, 0, 0, 1, 10, out pageCount); } else { int customerid = 0; string customername = ""; string city = ""; string state = ""; string zip = ""; string startdate = ""; string enddate = ""; int franchiseeid = 0; int datetype = 0; if (Request.QueryString["CustomerID"] != null && Request.QueryString["CustomerID"].ToString().Trim().Length > 0) { customerid = Convert.ToInt32(Request.QueryString["CustomerID"]); if (customerid > 0) { spCustomerID.InnerText = customerid.ToString(); } else { spCustomerID.InnerText = "-N/A-"; } } if (Request.QueryString["FranchiseeID"] != null && Request.QueryString["FranchiseeID"].ToString().Trim().Length > 0) { franchiseeid = Convert.ToInt32(Request.QueryString["FranchiseeID"]); if (franchiseeid > 0) { spFranchiseeID.InnerText = franchiseeid.ToString(); } else { spFranchiseeID.InnerText = "-N/A-"; } if (rolename == "FranchiseeAdmin") { divCustomer.Style.Add(HtmlTextWriterStyle.Display, "none"); } else { divCustomer.Style.Add(HtmlTextWriterStyle.Display, "block"); } } if (Request.QueryString["CustomerName"] != null) { if (Request.QueryString["CustomerName"].ToString().Trim().Length > 0) { customername = Convert.ToString(Request.QueryString["CustomerName"]); spCustomerName.InnerText = customername; } else { spCustomerName.InnerText = "-N/A-"; } } if (Request.QueryString["City"] != null) { if (Request.QueryString["City"].ToString().Trim().Length > 0) { city = Convert.ToString(Request.QueryString["City"]); spCity.InnerText = city; } else { spCity.InnerText = "-N/A-"; } } if (Request.QueryString["State"] != null) { if (Request.QueryString["State"].ToString().Trim().Length > 0) { state = Convert.ToString(Request.QueryString["State"]); spState.InnerText = state; } else { spState.InnerText = "-N/A-"; } } if (Request.QueryString["Zip"] != null && Request.QueryString["Zip"].ToString().Trim().Length > 0) { if (Request.QueryString["Zip"].ToString().Trim().Length > 0) { zip = Convert.ToString(Request.QueryString["Zip"]); spZip.InnerText = zip; } else { spZip.InnerText = "-N/A-"; } } if (Request.QueryString["StartDate"] != null) { if (Request.QueryString["StartDate"].ToString().Trim().Length > 0) { startdate = Convert.ToString(Request.QueryString["StartDate"]); spStartDate.InnerText = startdate; } else { spStartDate.InnerText = "-N/A-"; } } if (Request.QueryString["EndDate"] != null) { if (Request.QueryString["EndDate"].ToString().Trim().Length > 0) { enddate = Convert.ToString(Request.QueryString["EndDate"]); spEndDate.InnerText = enddate; } else { spEndDate.InnerText = "-N/A-"; } } if (Request.QueryString["DateType"] != null) { if (Request.QueryString["DateType"].ToString().Trim().Length > 0) { datetype = Convert.ToInt32(Request.QueryString["DateType"]); if (datetype == 0) { spDateRangeBucket.InnerText = "Signup Date"; ViewState["SortExp"] = "DateCreated"; } else if (datetype == 1) { spDateRangeBucket.InnerText = "Attended Customers"; ViewState["SortExp"] = "EventDate"; } else if (datetype == 2) { spDateRangeBucket.InnerText = "Customer Date"; ViewState["SortExp"] = "RegDate"; } else if (datetype == 3) { spDateRangeBucket.InnerText = "Paid Customers"; } } } if (Request.QueryString["Abondoned"] != null) { if (Request.QueryString["Abondoned"].ToString().Trim().Length > 0 && Convert.ToBoolean(Request.QueryString["Abondoned"].ToString()) == true) { abondonedCustomer = Convert.ToBoolean(Request.QueryString["Abondoned"]); spHeaderText.InnerText = "Customer List (Customers who did not register for any event)"; } } long pagecount; if (abondonedCustomer == false) { objevent = masterDal.SearchFranchisorCustomerList(customerid, customername, city, state, zip, startdate, enddate, franchiseeid, datetype, 0, 0, out pagecount); } else { objevent = masterDal.GetCustomerList(customerid, customername, city, state, zip, startdate, enddate, franchiseeid, datetype, 2, 0, 0, out pagecount); } } DataTable dtcustomer = new DataTable(); dtcustomer.Columns.Add("Name"); dtcustomer.Columns.Add("Email"); dtcustomer.Columns.Add("Phone"); dtcustomer.Columns.Add("RegDate"); dtcustomer.Columns.Add("EventDate"); dtcustomer.Columns.Add("Marketing"); dtcustomer.Columns.Add("Address"); dtcustomer.Columns.Add("RestAddress"); dtcustomer.Columns.Add("Event"); dtcustomer.Columns.Add("Host"); dtcustomer.Columns.Add("Package"); dtcustomer.Columns.Add("AddressID"); dtcustomer.Columns.Add("FranchiseeID"); dtcustomer.Columns.Add("CustomerID"); dtcustomer.Columns.Add("TotalRevenue", typeof(float)); dtcustomer.Columns.Add("State"); dtcustomer.Columns.Add("City"); dtcustomer.Columns.Add("Country"); dtcustomer.Columns.Add("Zip"); dtcustomer.Columns.Add("AddedBY"); dtcustomer.Columns.Add("DateCreated", typeof(DateTime)); if (objevent != null) { for (int jcount = 0; jcount < objevent.Customer.Count; jcount++) { string address = objevent.Customer[jcount].Customer.BillingAddress.Address1; string restaddress = objevent.Customer[jcount].Customer.BillingAddress.City + " " + objevent.Customer[jcount].Customer.BillingAddress.State + " " + objevent.Customer[jcount].Customer.BillingAddress.Country + " " + objevent.Customer[jcount].Customer.BillingAddress.Zip; string username = string.Empty; if (objevent.Customer[jcount].Customer.User.MiddleName.Length > 0) { username = objevent.Customer[jcount].Customer.User.FirstName + " " + objevent.Customer[jcount].Customer.User.MiddleName + " " + objevent.Customer[jcount].Customer.User.LastName; } else { username = objevent.Customer[jcount].Customer.User.FirstName + " " + objevent.Customer[jcount].Customer.User.LastName; } string role = string.Empty; switch (objevent.Customer[jcount].Customer.AddedBy.ToString()) { case "10": role = "Call Center"; break; case "8": role = "Walk Ins"; break; default: role = "Internet"; break; } string eventdate = "-N/A-"; if (objevent.Customer[jcount].Customer.User.DOB != null && objevent.Customer[jcount].Customer.User.DOB.ToString().Length > 0) { eventdate = objevent.Customer[jcount].Customer.User.DOB; } string regdateShort = "-N/A-"; if (objevent.Customer[jcount].Customer.User.DateApplied != null && objevent.Customer[jcount].Customer.User.DateApplied.ToString().Length > 0) { regdateShort = objevent.Customer[jcount].Customer.User.DateApplied.ToString("MM/dd/yyyy"); } dtcustomer.Rows.Add(new object[] { username, objevent.Customer[jcount].Customer.User.EMail1, objCommonCode.FormatPhoneNumberGet(objevent.Customer[jcount].Customer.User.PhoneOffice), objevent.Customer[jcount].Customer.User.DateApplied.ToLongDateString(), eventdate, objevent.Customer[jcount].Customer.Gender, address, restaddress, objevent.Customer[jcount].Customer.CollectionMode, objevent.Customer[jcount].Customer.ContactMethod, objevent.Customer[jcount].EventPackage.Package.PackageName, objevent.Customer[jcount].Customer.User.HomeAddress.AddressID, objevent.Customer[jcount].TechnicianID, objevent.Customer[jcount].Customer.CustomerID, objevent.Customer[jcount].PaymentDetail.Amount, objevent.Customer[jcount].Customer.BillingAddress.State, objevent.Customer[jcount].Customer.BillingAddress.City, objevent.Customer[jcount].Customer.BillingAddress.Country, objevent.Customer[jcount].Customer.BillingAddress.Zip, role, regdateShort }); } } if (abondonedCustomer == true) { grdCustomerList.Columns[grdCustomerList.Columns.Count - 1].Visible = false; grdCustomerList.Columns[grdCustomerList.Columns.Count - 2].Visible = false; //grdCustomerList.Columns[grdCustomerList.Columns.Count - 3].Visible = false; } if (abondonedCustomer == false) { grdCustomerList.Columns[grdCustomerList.Columns.Count - 3].Visible = true; grdCustomerList.Columns[grdCustomerList.Columns.Count - 1].Visible = true; if (Request.QueryString["RoleName"] != null) { rolename = Request.QueryString["RoleName"].ToString(); if (rolename == "FranchisorAdmin") { grdCustomerList.Columns[grdCustomerList.Columns.Count - 2].Visible = true; } else { grdCustomerList.Columns[grdCustomerList.Columns.Count - 2].Visible = false; grdCustomerList.Columns[grdCustomerList.Columns.Count - 1].Visible = false; } if (rolename == "SalesRep") { grdCustomerList.Columns[grdCustomerList.Columns.Count - 1].Visible = false; } } } if ((SortDirection)ViewState["SortDir"] == SortDirection.Ascending) { dtcustomer.DefaultView.Sort = ViewState["SortExp"].ToString() + " asc"; } else { dtcustomer.DefaultView.Sort = ViewState["SortExp"].ToString() + " desc"; } dtcustomer = dtcustomer.DefaultView.ToTable(); grdCustomerList.DataSource = dtcustomer; grdCustomerList.DataBind(); }
private void GetProspectDetails(Int64 prospectid) { int iprospectid = Convert.ToInt32(prospectid); EProspect[] prospect = null; FranchisorDAL objDAL = new FranchisorDAL(); if (!string.IsNullOrEmpty(Request["IsHost"])) { if (Request["IsHost"].Equals("True")) { var listProspect = objDAL.GetHostDetails(iprospectid.ToString(), 1); if (listProspect != null) { prospect = listProspect.ToArray(); } } else { var listProspect = objDAL.GetProspectDetails(iprospectid.ToString(), 4); if (listProspect != null) { prospect = listProspect.ToArray(); } } } else { var listProspect = objDAL.GetProspectDetails(iprospectid.ToString(), 4); if (listProspect != null) { prospect = listProspect.ToArray(); } } if (prospect != null) { spProspectName2.InnerText = prospect[0].OrganizationName.ToString(); string strAddress = string.Empty; // Address if (!string.IsNullOrEmpty(prospect[0].Address.Address1)) { strAddress = strAddress + prospect[0].Address.Address1 + ", "; } // Suit if (!string.IsNullOrEmpty(prospect[0].Address.Address2)) { strAddress = strAddress + prospect[0].Address.Address2 + ", "; } // City if (!string.IsNullOrEmpty(prospect[0].Address.City)) { strAddress = strAddress + HttpUtility.HtmlEncode(prospect[0].Address.City) + ", "; } // State if (!string.IsNullOrEmpty(prospect[0].Address.State)) { strAddress = strAddress + HttpUtility.HtmlEncode(prospect[0].Address.State) + ", "; } // ZipID if (prospect[0].Address.ZipID > 0) { strAddress = strAddress + HttpUtility.HtmlEncode(prospect[0].Address.ZipID) + ", "; } if (strAddress.Length > 0) { if ((strAddress.Substring(strAddress.Length - 2, 2) == ", ")) { strAddress = strAddress.Substring(0, strAddress.Length - 2); } if (strAddress.Length > 0) { if ((strAddress.Substring(strAddress.Length - 1, 1) == ",")) { strAddress = strAddress.Substring(0, strAddress.Length - 1); } } if (strAddress.Length > 0) { if ((strAddress.Substring(0, 1) == ",")) { strAddress = strAddress.Substring(1, strAddress.Length - 1); } } else { strAddress = "-N/A-"; } } else { strAddress = "-N/A-"; } spAddress.InnerText = strAddress; spURL.InnerHtml = prospect[0].WebSite.Length > 0 ? HttpUtility.HtmlEncode(prospect[0].WebSite) : "-N/A-"; // format phone no. CommonCode objCommonCode = new CommonCode(); if (prospect[0].PhoneCell.Length > 0) { spPhone.InnerHtml = objCommonCode.FormatPhoneNumberGet(prospect[0].PhoneCell); } else if (prospect[0].PhoneOffice.Length > 0) { spPhone.InnerHtml = objCommonCode.FormatPhoneNumberGet(prospect[0].PhoneOffice); } else if (prospect[0].PhoneOther.Length > 0) { spPhone.InnerHtml = objCommonCode.FormatPhoneNumberGet(prospect[0].PhoneOther); } else { spPhone.InnerHtml = "-N/A-"; } string email = "-N/A-"; string eventname = "-N/A-"; string eventdate = "-N/A-"; string spnTemp = "-N/A-"; if (prospect[0].EMailID.Length > 0) { email = prospect[0].EMailID; } if ((prospect[0].EMailID.Length > 0)) { spOther.InnerText = email; } else { spOther.InnerText = "-N/A-"; } if (prospect[0].LastEventName.Length > 0) { eventdate = Convert.ToDateTime(prospect[0].LastEventDate).ToLongDateString(); eventname = prospect[0].LastEventName; } // Prospect type if (!string.IsNullOrEmpty(prospect[0].ProspectType.Name)) { spnProspectType.InnerText = prospect[0].ProspectType.Name; } else { spnProspectType.InnerText = "-N/A-"; } // Members/Employees if (prospect[0].ActualMembership > 0) { spnMembersEmployees.InnerText = prospect[0].ActualMembership.ToString(); } else { spnMembersEmployees.InnerText = "-N/A-"; } // Actual Attendence if (prospect[0].Attendance > 0) { spnAttendence.InnerText = prospect[0].Attendance.ToString(); } else { spnAttendence.InnerText = "-N/A-"; } // Facilities Fee if (!string.IsNullOrEmpty(prospect[0].ProspectDetails.FacilitiesFee)) { spnFacilitiesFee.InnerText = prospect[0].ProspectDetails.FacilitiesFee; } else { spnFacilitiesFee.InnerText = "-N/A-"; } // Will Promote if (prospect[0].WillCommunicate >= 0) { switch (prospect[0].WillCommunicate) { case 0: spnTemp = "No"; break; case 1: spnTemp = "Yes"; break; case 2: spnTemp = "Unknown"; break; default: spnTemp = "-N/A-"; break; } spnWillPromote.InnerText = spnTemp; spnTemp = ""; } // Will Host if (prospect[0].ProspectDetails.WillHost >= 0) { switch (prospect[0].ProspectDetails.WillHost) { case 0: spnTemp = "No"; break; case 1: spnTemp = "Yes"; break; case 2: spnTemp = "Unknown"; break; default: spnTemp = "-N/A-"; break; } spnWillHost.InnerText = spnTemp; spnTemp = ""; } // Viable Host Site if (prospect[0].ProspectDetails.ViableHostSite >= 0) { if (prospect[0].ProspectDetails.ViableHostSite == 0) { spnTemp = "No"; } else if (prospect[0].ProspectDetails.ViableHostSite == 1) { spnTemp = "Yes"; } else if (prospect[0].ProspectDetails.ViableHostSite == 2) { spnTemp = "Unknown"; } else { spnTemp = "-N/A-"; } spnViableHostSite.InnerText = spnTemp; spnTemp = ""; } } }