public void BuyLaterClick() { SocialShareIOS SocialShareIOS= new SocialShareIOS (this,Screen.RaffleDetail); string emailOrPhone = socialShareView.BuylaterTextField.Text; string[] emailOrPhoneArray = new string[] { emailOrPhone}; //check if it is a canada phone if (FormatManager.chechinput (emailOrPhone, FormatManager.FormatOption.Phone)) { DismissSocialShareClick(); if (raffle.representative_needed=="N") { SocialShareIOS.Sms (String.Format (RaffleDetailData.c_smsMessageTemplate_WithLink, raffle.organization, raffle.sell_ticket_url, GlobalVariable.currentlocation), emailOrPhoneArray); } else { SocialShareIOS.Sms (String.Format (RaffleDetailData.c_smsMessageTemplate_NoLink, raffle.organization,RaffleDetailData.Tap5050WebPageLink), emailOrPhoneArray); } } else if (FormatManager.chechinput (emailOrPhone, FormatManager.FormatOption.Email)) { DismissSocialShareClick(); if (raffle.representative_needed=="N") { SocialShareIOS.Email (String.Format (RaffleDetailData.c_emailMessageTemplate_WithLink, raffle.organization, raffle.sell_ticket_url, GlobalVariable.currentlocation), String.Format (RaffleDetailData.c_emailSubjectTemplate_WithLink, raffle.organization), emailOrPhoneArray); } else { SocialShareIOS.Email (String.Format (RaffleDetailData.c_emailMessageTemplate_NoLink, raffle.organization, raffle.event_name, RaffleDetailData.Tap5050WebPageLink ), String.Format (RaffleDetailData.c_emailSubjectTemplate_NoLink, raffle.organization), emailOrPhoneArray); } } else { //alert UIAlertController Alert = UIAlertController.Create (RaffleDetailData.AlertScreenFormatErrorTitle, RaffleDetailData.AlertScreenFormatErrorMessage, UIAlertControllerStyle.Alert); Alert.AddAction (UIAlertAction.Create (RaffleDetailData.AlertScreenFormatErrorCancelBtnTitle, UIAlertActionStyle.Cancel,null )); PresentViewController (Alert, true, null); } }
/******************************************************************************** *Btn clicks ********************************************************************************/ public void sentBtnClick() { string organizationName = aboutScreenView.organizationNameTextField.Text; string mobilephone= aboutScreenView.phoneNumberTextField.Text; //check input string [] messageArray=new string[]{"Organization Name\n","Phone Number\n"}; FormatCheckFlagObject[] flags=new FormatCheckFlagObject[messageArray.Length]; for (int i = 0; i < flags.Length; i++) { flags[i]=new FormatCheckFlagObject(messageArray[i]); } if(FormatManager.chechinput(organizationName,FormatManager.FormatOption.OnlyLetter)){ flags[0].flag=true; } if(FormatManager.chechinput(mobilephone,FormatManager.FormatOption.OnlyNumber)&&mobilephone.Length>=5){ flags[1].flag=true; } bool totalfalg=true; foreach(var flagobj in flags){ if(!flagobj.flag){ totalfalg=false; } } if (totalfalg == true) { SocialShareIOS SocialShareIOS = new SocialShareIOS (this, Screen.RaffleDetail); string message = String.Format (AboutScreenData.RequestRaffleEmailBody, GlobalVariable.username, GlobalVariable.currentlocation, organizationName, mobilephone); SocialShareIOS.Email (message, AboutScreenData.RequestRaffleEmailSubject, new string []{ AboutScreenData.RequestRaffleEmailTarget }); } else { UIAlertController Alert = UIAlertController.Create (AboutScreenData.AlertScreenFormatErrorTitle, AboutScreenData.AlertScreenFormatErrorMessage(flags,messageArray), UIAlertControllerStyle.Alert); Alert.AddAction (UIAlertAction.Create (AboutScreenData.AlertScreenFormatErrorCancelBtnTitle, UIAlertActionStyle.Cancel, null)); PresentViewController (Alert, true, null); } }
public void twitterClick() { DismissSocialShareClick(); SocialShareIOS SocialShareIOS = new SocialShareIOS (this, Screen.RaffleDetail); if (raffle.representative_needed=="N") { SocialShareIOS.Twitter (RaffleDetailData.c_twitterAPIKey, RaffleDetailData.c_twitterSecret, String.Format (RaffleDetailData.c_twitterMessageTemplate_WithLink, raffle.organization), raffle.sell_ticket_url ); } else { SocialShareIOS.Twitter (RaffleDetailData.c_twitterAPIKey, RaffleDetailData.c_twitterSecret, String.Format (RaffleDetailData.c_twitterMessageTemplate_NoLink, raffle.organization), RaffleDetailData.Tap5050WebPageLink ); } }
/******************************************************************************** *Btn clicks ********************************************************************************/ public void SentSMSClick() { List<string> selectedPersonPhone = new List<string> (); foreach (var x in ContactList) { if (x.Selected) { selectedPersonPhone.Add (x.Phone); } } var v=this.NavigationController; SocialShareIOS SocialShareIOS = new SocialShareIOS (this,Screen.ContactList); if (String.IsNullOrEmpty(raffle.share_sms_body)){ if (raffle.representative_needed == "N") { SocialShareIOS.Sms(String.Format(RaffleDetailData.c_smsMessageTemplate_WithLink, raffle.organization, raffle.sell_ticket_url, GlobalVariable.currentlocation), selectedPersonPhone.ToArray()); } else { SocialShareIOS.Sms(String.Format(RaffleDetailData.c_smsMessageTemplate_NoLink, raffle.organization, RaffleDetailData.Tap5050WebPageLink), selectedPersonPhone.ToArray()); } } else { //SocialShareIOS.Sms(raffle.share_sms_body,selectedPersonPhone.ToArray()); SocialShareIOS.Sms(SharingString.Format(raffle.share_sms_body, raffle), selectedPersonPhone.ToArray()); } }
public void SentEmailClick() { List<string> selectedPersonEmail = new List<string> (); foreach (var x in ContactList) { if (x.Selected) { selectedPersonEmail.Add (x.Email); } } SocialShareIOS SocialShareIOS = new SocialShareIOS (this,Screen.ContactList); if (String.IsNullOrEmpty(raffle.share_email_subject) && String.IsNullOrEmpty(raffle.share_email_body)) { if (raffle.representative_needed == "N") { SocialShareIOS.Email(String.Format(RaffleDetailData.c_emailMessageTemplate_WithLink, raffle.organization, raffle.sell_ticket_url, GlobalVariable.currentlocation), String.Format(RaffleDetailData.c_emailSubjectTemplate_WithLink, raffle.organization), selectedPersonEmail.ToArray()); } else { SocialShareIOS.Email(String.Format(RaffleDetailData.c_emailMessageTemplate_NoLink, raffle.organization, raffle.event_name, RaffleDetailData.Tap5050WebPageLink), String.Format(RaffleDetailData.c_emailSubjectTemplate_NoLink, raffle.organization), selectedPersonEmail.ToArray()); } } else { //SocialShareIOS.Email(raffle.share_email_body,raffle.share_email_subject,selectedPersonEmail.ToArray()); SocialShareIOS.Email(SharingString.Format(raffle.share_email_body, raffle), SharingString.Format(raffle.share_email_subject, raffle), selectedPersonEmail.ToArray()); } }