public void UpdateCell(CustomerInteraction meetingsInfo)
 {
     LabelSentEmail.Text = meetingsInfo.Type == "Email" ? "Sent Email To " + meetingsInfo.CustomerName : "Phone Call";
     LabelDate.Text =  DateTime.Parse(meetingsInfo.DateNTime).ToString("MMM dd, yyyy  hh:mm tt");
     if(meetingsInfo.Type == "Email")
         ImageViewEmail.Image = UIImage.FromBundle ("Email Sent Thumb.png");
     else
         ImageViewEmail.Image = UIImage.FromBundle ("Phone Thumb.png");
 }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			UIBarButtonItem btn = new UIBarButtonItem ();
			btn.Image = UIImage.FromFile("Navigation Back Icon.png");
			btn.Clicked += (sender , e)=>{				
				this.NavigationController.PopViewController(false);
			};
			NavigationItem.LeftBarButtonItem = btn;

			this.Title = "Customer Profile";

			loadingOverlay = new LoadingOverlay(this.View.Bounds);
			this.View.Add(loadingOverlay);

//			LoadScreenData ();
//			ButtonDealMakerUsed.Hidden = true;
//			//customerDetails.dealMaker != null 
//			if (customerDetails.dealMaker != null) {
//				LabelDealMakerUsed.Text = customerDetails.dealMaker.BrokerName;
//				ButtonDealMakerUsed.Hidden = false;
//			}
			//DealMakersImage1.Hidden = customerDetails.dealMaker != null ? false : true;
			//Add code to navigate to dealmaker details 
			ButtonDealMakerUsed.TouchUpInside += (object sender, EventArgs e) => {
				MyDealMakerDetailVC dealmakerDetailObject = this.Storyboard.InstantiateViewController ("MyDealMakerDetailVC") as MyDealMakerDetailVC;
				if (dealmakerDetailObject != null) { 
					dealmakerDetailObject.brokerObj = customerDetails.dealMaker;
					this.NavigationController.PushViewController (dealmakerDetailObject, true);
				}
			};
			
			ButtonPhone.TouchUpInside += (object sender, EventArgs e) => {
				var phone = string.IsNullOrEmpty(customerDetails.Phone.Trim()) == true ? "0" : customerDetails.Phone;
				var url = new NSUrl ("tel://" + phone);
				if (!UIApplication.SharedApplication.OpenUrl (url)) {
					var av = new UIAlertView ("Not supported",
						"Scheme 'tel:' is not supported on this device",
						null,
						"OK",
						null);
					av.Show ();
				};
				CustomerInteraction customerinteract = new CustomerInteraction();
				customerinteract.CustomerName =  customerDetails.Name;
				customerinteract.UserId = AppDelegate.UserDetails.UserId;
				customerinteract.Type = "Phone";
				customerinteract.DateNTime = DateTime.Now.ToString();
				customerinteract.LeadID = customerDetails.LeadId;
				AppDelegate.customerBL.SaveCutomerInteraction(customerinteract);
				//Xamarin Insights tracking
				Insights.Track("SaveCutomerInteraction", new Dictionary <string,string>{
					{"UserId", customerinteract.UserId.ToString()},
					{"CustomerName", customerinteract.CustomerName}
				});
			};

			ButtonMail.TouchUpInside += (object sender, EventArgs e) => {
				MFMailComposeViewController mailController;
				if (MFMailComposeViewController.CanSendMail) {
					// do mail operations here
					mailController = new MFMailComposeViewController ();
					mailController.SetToRecipients (new string[]{customerDetails.Email});
					mailController.SetSubject ("Quick request");
					mailController.SetMessageBody ("", false);
					this.PresentViewController (mailController, true, null);
					mailController.Finished += ( object s, MFComposeResultEventArgs args) => {
						switch(args.Result)
						{
								case MFMailComposeResult.Cancelled: 							
									break;
								case MFMailComposeResult.Saved: 
									break;
								case MFMailComposeResult.Sent: 	
									CustomerInteraction customerinteract = new CustomerInteraction();
									customerinteract.CustomerName =  customerDetails.Name;
									customerinteract.UserId = AppDelegate.UserDetails.UserId;
									customerinteract.Type = "Email";
									customerinteract.DateNTime = DateTime.Now.ToString();
									customerinteract.LeadID = customerDetails.LeadId;
									AppDelegate.customerBL.SaveCutomerInteraction(customerinteract);				

									// Xamarin Insights tracking
									Insights.Track("Save CutomerInteraction", new Dictionary <string,string>{
										{"UserId", customerinteract.UserId.ToString()},
										{"CustomerName", customerinteract.CustomerName},
										{"Type", "Email"}
									});
									break;
								case MFMailComposeResult.Failed: 
									break;
						}
						args.Controller.DismissViewController (true, null);
					};


				}
			};

			ButtonCalendarEvent.TouchUpInside += (object sender, EventArgs e) => {
//				CalenderHomeDVC calendarHomeDV = new CalenderHomeDVC ();
//				this.NavigationController.PushViewController(calendarHomeDV, true);
				LaunchCreateNewEvent();
			};
			//await LoadCustomerAndMeetingInfo ();
		}
Ejemplo n.º 3
0
 public int SaveCutomerInteraction(CustomerInteraction customerInteraction)
 {
     //RestService restSevice = new RestService ();
     string leadsApicall = Constants.CustomerInteraction;
     string postData = Newtonsoft.Json.JsonConvert.SerializeObject(customerInteraction);
     string response =  RestService.Instance.PostData (leadsApicall, postData);
     var parsedResponse = Newtonsoft.Json.JsonConvert.DeserializeObject<int>(response.ToString());
     return parsedResponse;
 }
Ejemplo n.º 4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            this.Title = "Requestor Profile";
            ScrollViewRR.ContentSize=new CGSize (375.0f, 1200.0f);

            if (referralRequestType == "Completed")
                ScrollViewRR.Frame = new CGRect (0, 0, this.View.Bounds.Size.Width, this.View.Bounds.Size.Height);

            ButtonReferLater.Layer.BorderWidth = 2.0f;
            ButtonReferLater.Layer.BorderColor = UIColor.FromRGB (44, 145, 188).CGColor;

            UIBarButtonItem btn = new UIBarButtonItem ();
            btn.Image = UIImage.FromFile("Navigation Back Icon.png");
            btn.Clicked += (sender , e)=>{
                //this.NavigationController.PopViewController(false);
                ReferralRequestDetails referralRequestDetails = this.Storyboard.InstantiateViewController("ReferralRequestDetails") as ReferralRequestDetails;
                if(referralRequestDetails != null)
                    referralRequestDetails.referralRequestType = referralRequestType;
                    this.NavigationController.PushViewController(referralRequestDetails,true);
            };
            NavigationItem.LeftBarButtonItem = btn;

            AlertSubView.Layer.CornerRadius = 15.0f;
            AlertSubView.Layer.MasksToBounds = true;

            AlertSubViewRequestMeeting.Layer.CornerRadius = 15.0f;
            AlertSubViewRequestMeeting.Layer.MasksToBounds = true;

            AlertSubViewLater.Layer.CornerRadius = 15.0f;
            AlertSubViewLater.Layer.MasksToBounds = true;

            ButtonEmailAcceptView.Layer.CornerRadius = 5.0f;
            ButtonLaterView.Layer.CornerRadius = 5.0f;
            //			DisableReqMeetScroll.Layer.CornerRadius = 5.0f;
            ButtonRequestMeeting.Layer.CornerRadius = 5.0f;

            ButtonReferLater.Layer.BorderWidth = 2.0f;
            ButtonReferLater.Layer.BorderColor = UIColor.FromRGB (50, 135, 172).CGColor;

            LabelNameSeller.Text = refferalRequests.SellerName;
            LabelTitleSeller.Text = refferalRequests.SellerTitle;
            LabelIndustrySeller.Text = refferalRequests.SellerCompany;
            LabelCityState.Text = EvaluateString (refferalRequests.SellerCity,refferalRequests.SellerState);

            LabelComapnyNameSeller.Text = refferalRequests.SellerIndustry;
            LabelStreetSeller.Text = refferalRequests.SellerOfficeAddress;
            LabelCityStateSeller.Text = EvaluateString (refferalRequests.City,refferalRequests.State);
            LabelZipCodeCountrySeller.Text = EvaluateString (refferalRequests.SellerZipCode,"United State");
            LabelPhoneSeller.Text = "Tel: " + refferalRequests.SellerPhone;
            LabelLOBSeller.Text = refferalRequests.SellerLOB;

            LabelNameProspect.Text = refferalRequests.Prospect;
            LabelTitleProspect.Text = refferalRequests.LEAD_TITLE;
            LabelIndustryProspect.Text = refferalRequests.COMPANY_NAME;
            LabelCityStateProspectProfile.Text = EvaluateString (refferalRequests.LEAD_CITY,refferalRequests.LEAD_STATE);

            LabelStreetProspect.Text = EvaluateString (refferalRequests.LEAD_COMP_ADDRESS,refferalRequests.County);
            LabelCityStateProspect.Text = EvaluateString (refferalRequests.LEAD_CITY,refferalRequests.LEAD_STATE);
            LabelZipCountryProspect.Text = EvaluateString (refferalRequests.LEAD_COMP_ZIPCODE,refferalRequests.LEAD_COMP_COUNTRY);
            LabelPhoneProspect.Text = "Tel: " + refferalRequests.LEAD_PHONE;

            LabelFinancialsProspect.Text = "Revenue : "+ evaluateAmount(refferalRequests.Revenue);
            LabelFiscalYearProspect.Text = refferalRequests.FiscalYE;
            LabelLOBProspect.Text = refferalRequests.LEAD_LOB;
            LabelNetIncomeProspect.Text = refferalRequests.NetIncome;
            LabelEmployeesProspect.Text = refferalRequests.Employees;
            LabelMarketValueProspect.Text = evaluateAmount (refferalRequests.MarketValue);
            LabelMYearFoundedProspect.Text = refferalRequests.YearFounded;
            LabelIndustryRiskProspect.Text = refferalRequests.IndustryRiskScore;
            LabelWebsiteProspect.Text = refferalRequests.WebAddress;

            if (refferalRequests.Status == 2) {
                PassView.Hidden = true;
                MakeView.Hidden = false;
            } else if (refferalRequests.Status == 4) {
                PassView.Hidden = true;
                MakeView.Hidden = true;
            } else if (refferalRequests.Status == 1)  {
                LabelNameSeller.Hidden = true;
            }

            ButtonAccepRR.TouchUpInside += (object sender, EventArgs e) => {

                AppDelegate.brokerBL.UpdateBrokerStatus(refferalRequests.BrokerID,4,refferalRequests.LeadID);
                LabelNameSeller.Hidden = false;
                //Xamarin Insights tracking
                Insights.Track("Update BrokerStatus", new Dictionary <string,string>{
                    {"BrokerID", refferalRequests.BrokerID.ToString()},
                    {"Status", "4"},
                    {"LeadID", refferalRequests.LeadID.ToString()}
                });
                AppDelegate.referralRequestBL.UpdateReferralRequest(refferalRequests.ID,2);
                //Xamarin Insights tracking
                Insights.Track("Update ReferralRequest", new Dictionary <string,string>{
                    {"ReferralReqId", refferalRequests.ID.ToString()},
                    {"Status", "2"}
                });

                PassView.Hidden = true;
                MakeView.Hidden = false;
                AppDelegate.CurrentRRList.Remove(refferalRequests);
            };

            ButtonReferLater.TouchUpInside += (object sender, EventArgs e) => {
                AlertView.Hidden=false;
                AlertSubViewLater.Hidden=false;
            };

            ButtonLaterView.TouchUpInside += (object sender, EventArgs e) => {
                LandingRefferalRequestVC landingRefferalRequestVC = this.Storyboard.InstantiateViewController("landingRefferalRequestVC") as LandingRefferalRequestVC;
                if (landingRefferalRequestVC != null)
                {
                    //landingRefferalRequestVC.CaseID = GetCurrentCaseID();
                    this.NavigationController.PushViewController(landingRefferalRequestVC, true);
                }
            };

            ButtonPassRR.TouchUpInside += (object sender, EventArgs e) => {
                AppDelegate.referralRequestBL.UpdateReferralRequest(refferalRequests.ID,3);
                AppDelegate.brokerBL.UpdateBrokerStatus(refferalRequests.BrokerID,3,refferalRequests.LeadID);
                LandingRefferalRequestVC landingRefferalRequestVC = this.Storyboard.InstantiateViewController("landingRefferalRequestVC") as LandingRefferalRequestVC;
                if (landingRefferalRequestVC != null)
                {
                    //landingRefferalRequestVC.CaseID = GetCurrentCaseID();
                    this.NavigationController.PushViewController(landingRefferalRequestVC, true);
                }
            };

            ButtonMakeReferal.TouchUpInside += (object sender, EventArgs e) => {
                AlertView.Hidden=false;
                AlertSubView.Hidden=false;
            };

            //			ButtonAlertViewDisable.TouchUpInside += (object sender, EventArgs e) => {
            //				AlertViewLater.Hidden=true;
            //				AlertSubViewLater.Hidden=true;
            //			};

            //			DisableReqMeetScroll.TouchUpInside += (object sender, EventArgs e) => {
            //				AlertViewRequestMeeting.Hidden=true;
            //				AlertSubViewRequestMeeting.Hidden=true;
            //			};

            ButtonScroll_.TouchUpInside += (object sender, EventArgs e) => {
                AlertView.Hidden=true;
                AlertSubView.Hidden=true;
            };

            ButtonRequestMeeting.TouchUpInside += (object sender, EventArgs e) => {
            //				CalenderHomeDVC calendarHomeDV = new CalenderHomeDVC ();
            //				AppDelegate.IsFromRR = true;
                AppDelegate.CurrentRR = refferalRequests;
            //				if(AppDelegate.CurrentRRList.Contains(refferalRequests))
            //					AppDelegate.CurrentRRList.Remove(refferalRequests);
            //				this.NavigationController.PushViewController(calendarHomeDV, true);
                LaunchCreateNewEvent();
            };

            LabelReferralRequestMade.Text = "Thank you for making the Referral for " + refferalRequests.SellerName + "! You will be paid shortly. \n\n PayPal feature coming soon!";

            ViewReferralRequestMade.Layer.CornerRadius = 15.0f;
            ButtonReferralRequestMade.Layer.CornerRadius = 5.0f;
            ButtonReferralRequestMade.TouchUpInside += (object sender, EventArgs e) => {
                ViewReferralRequestMade.Hidden = true;
                AlertView.Hidden = true;
                MakeView.Hidden =true;
                ScrollViewRR.Frame = new CGRect(0,0,this.View.Bounds.Size.Width,667);
            };

            ButtonEmailAcceptView.TouchUpInside += (object sender, EventArgs e) =>  {
                MFMailComposeViewController mailController;
                if (MFMailComposeViewController.CanSendMail) {
                    // do mail operations here
                    mailController = new MFMailComposeViewController ();
                    mailController.SetToRecipients (new string[]{refferalRequests.LeadEmailID});
                    mailController.SetSubject ("Quick request");
                    mailController.SetMessageBody ("", false);
                    this.PresentViewController (mailController, true, null);
                    mailController.Finished += ( object s, MFComposeResultEventArgs args) => {
                        switch(args.Result)
                        {
                                case MFMailComposeResult.Cancelled:
                                    break;
                                case MFMailComposeResult.Saved:
                                    break;
                                case MFMailComposeResult.Sent:
                                    //PagingSendMail.BackgroundColor=UIColor.Red;
                                    AppDelegate.referralRequestBL.UpdateReferralRequest(refferalRequests.ID,4);
                                    //AppDelegate.brokerBL.UpdateBrokerStatus(refferalRequests.BrokerID,5,refferalRequests.LeadID);
                                    //Xamarin Insights tracking
                                    Insights.Track("Update ReferralRequest", new Dictionary <string,string>{
                                        {"BrokerUserID", refferalRequests.BrokerUserID.ToString()},
                                        {"Status", "4"}
                                    });
                                    CustomerInteraction customerinteract = new CustomerInteraction();
                                    customerinteract.CustomerName =  refferalRequests.Prospect;
                                    customerinteract.UserId = AppDelegate.UserDetails.UserId;
                                    customerinteract.Type = "Email";
                                    customerinteract.DateNTime = DateTime.Now.ToString();
                                    customerinteract.LeadID = (int)refferalRequests.LeadID;
                                    AppDelegate.customerBL.SaveCutomerInteraction(customerinteract);
                                    //Xamarin Insights tracking
                                    Insights.Track("Update ReferralRequest", new Dictionary <string,string>{
                                        {"UserId", customerinteract.UserId.ToString()},
                                        {"CustomerName", customerinteract.CustomerName},
                                        {"Type","Email"}
                                    });
                                    //						AlertViewRequestMeeting.Hidden=false;

                                    if(AppDelegate.CurrentRRList.Contains(refferalRequests))
                                        AppDelegate.CurrentRRList.Remove(refferalRequests);
                                    break;
                                case MFMailComposeResult.Failed:
                                    break;
                        }
                        AlertSubView.Hidden=true;
                        AlertSubViewRequestMeeting.Hidden=false;
                        args.Controller.DismissViewController (true, null);
                    };
                }
            };
        }