protected void SendSMSNotification() { taxpayer = (ITaxpayer)Session["ITaxpayer"]; StringBuilder message = new StringBuilder() .AppendFormat("Dear {0} {1},\n", taxpayer.FirstName, taxpayer.LastName) .AppendFormat("The FCT Internal Revenue Service (FCT-IRS) has successfully ") .AppendFormat("validated your taxpayer details and issued you a Taxpayer Identification Number.\n") .AppendFormat("TIN: {0} \n", taxpayer.TIN) .AppendFormat("Please quote this TIN in all communications with the FCT-IRS. Thank you \n") .AppendFormat("*****@*****.**"); string recipientPhone = taxpayer.Phone1; try { string requestId = SMSMessaging.SendSMS(recipientPhone, message.ToString()); DisplayAlert("Success", "SMS Notification", string.Concat("SMS succesfully sent to ", recipientPhone)); taxpayer.SMSNotified = true; context.SaveChanges(); } catch (Exception ex) { DisplayAlert("Danger", "SMS Notification", ex.Message); return; } }
private void GetTaxpayer(string tin) { Session[DataObjectName] = context.ITaxpayers.Where(t => t.TIN == tin).Single(); TaxpayerForm.DataSource = Session[DataObjectName]; TaxpayerForm.DataBind(); taxpayer = (ITaxpayer)Session[DataObjectName]; BirthLgaCombo_Callback(new object(), new CallbackEventArgsBase(taxpayer.BirthStateId)); OriginLgaCombo_Callback(new object(), new CallbackEventArgsBase(taxpayer.OriginStateId)); }
private void ValidateRecord(ITaxpayer taxpayerRecord) { string nin = taxpayerRecord.NIN; string bvn = taxpayerRecord.BVN; string jtbTin = taxpayerRecord.JTBTIN; string message; if (string.IsNullOrEmpty(bvn) && string.IsNullOrEmpty(nin)) { message = string.Format("A BVN or National Identity Number (NIN) is required to submit this record"); throw new Exception(message); } }
protected void AttachmentGridview_DataBinding(object sender, EventArgs e) { taxpayer = (ITaxpayer)Session["ITaxpayer"]; AttachmentGridview.DataSource = taxpayer.ITaxpayerFiles.ToList(); }
private void SaveRecord() { try { string tin = (string)TaxpayerForm.GetNestedControlValueByFieldName("TIN"); taxpayer = context.ITaxpayers.Single(t => t.TIN == tin); taxpayer.BVN = (string)TaxpayerForm.GetNestedControlValueByFieldName("BVN"); taxpayer.JTBTIN = (string)TaxpayerForm.GetNestedControlValueByFieldName("JTBTIN"); taxpayer.FIRSTIN = (string)TaxpayerForm.GetNestedControlValueByFieldName("FIRSTIN"); taxpayer.NIN = (string)TaxpayerForm.GetNestedControlValueByFieldName("NIN"); taxpayer.StateTIN = (string)TaxpayerForm.GetNestedControlValueByFieldName("StateTIN"); taxpayer.LastName = (string)TaxpayerForm.GetNestedControlValueByFieldName("LastName"); taxpayer.FirstName = (string)TaxpayerForm.GetNestedControlValueByFieldName("FirstName"); taxpayer.MiddleName = (string)TaxpayerForm.GetNestedControlValueByFieldName("MiddleName"); taxpayer.MaidenName = (string)TaxpayerForm.GetNestedControlValueByFieldName("MaidenName"); taxpayer.PreviousFirstName = (string)TaxpayerForm.GetNestedControlValueByFieldName("PreviousFirstName"); taxpayer.PreviousLastName = (string)TaxpayerForm.GetNestedControlValueByFieldName("PreviousLastName"); taxpayer.PreviousMiddleName = (string)TaxpayerForm.GetNestedControlValueByFieldName("PreviousMiddleName"); taxpayer.Height = (decimal?)TaxpayerForm.GetNestedControlValueByFieldName("Height"); taxpayer.SpouseNIN = (String)TaxpayerForm.GetNestedControlValueByFieldName("SpouseNIN"); taxpayer.Gender = (string)TaxpayerForm.GetNestedControlValueByFieldName("Gender"); taxpayer.MaritalStatus = (string)TaxpayerForm.GetNestedControlValueByFieldName("MaritalStatus"); taxpayer.Religion = (string)TaxpayerForm.GetNestedControlValueByFieldName("Religion"); taxpayer.BirthDate = (DateTime)TaxpayerForm.GetNestedControlValueByFieldName("BirthDate"); taxpayer.BirthStateId = (String)TaxpayerForm.GetNestedControlValueByFieldName("BirthStateId"); taxpayer.BirthCity = (String)TaxpayerForm.GetNestedControlValueByFieldName("BirthCity"); taxpayer.BirthLgaId = (int?)TaxpayerForm.GetNestedControlValueByFieldName("BirthLgaId"); taxpayer.BirthCountryId = (int?)TaxpayerForm.GetNestedControlValueByFieldName("BirthCountryId"); taxpayer.NationalityId = (int?)TaxpayerForm.GetNestedControlValueByFieldName("NationalityId"); taxpayer.OriginStateId = (string)TaxpayerForm.GetNestedControlValueByFieldName("OriginStateId"); taxpayer.OriginLgaId = (int?)TaxpayerForm.GetNestedControlValueByFieldName("OriginLgaId"); taxpayer.Phone1 = (string)TaxpayerForm.GetNestedControlValueByFieldName("Phone1"); taxpayer.Phone2 = (string)TaxpayerForm.GetNestedControlValueByFieldName("Phone2"); taxpayer.Email = (string)TaxpayerForm.GetNestedControlValueByFieldName("Email"); taxpayer.Website = (string)TaxpayerForm.GetNestedControlValueByFieldName("Website"); taxpayer.Employer = (string)TaxpayerForm.GetNestedControlValueByFieldName("Employer"); taxpayer.Profession = (string)TaxpayerForm.GetNestedControlValueByFieldName("Profession"); taxpayer.EmploymentId = (string)TaxpayerForm.GetNestedControlValueByFieldName("EmploymentId"); taxpayer.EmploymentStatus = (string)TaxpayerForm.GetNestedControlValueByFieldName("EmploymentStatus"); taxpayer.HighestEducation = (string)TaxpayerForm.GetNestedControlValueByFieldName("HighestEducation"); taxpayer.IdentificationType = (string)TaxpayerForm.GetNestedControlValueByFieldName("IdentificationType"); taxpayer.IdentificationNumber = (string)TaxpayerForm.GetNestedControlValueByFieldName("IdentificationNumber"); taxpayer.EmploymentStatus = (string)TaxpayerForm.GetNestedControlValueByFieldName("EmploymentStatus"); taxpayer.TaxOfficeId = (string)TaxpayerForm.GetNestedControlValueByFieldName("TaxOfficeId"); ValidateRecord(taxpayer); context.SaveChanges(); DisplayAlert("Success", "Individual Taxpayer", "Taxpayer successfully saved"); } catch (Exception ex) { DisplayAlert("Danger", "Individual Taxpayer", ex.Message); } }
protected void AddressCardView_DataBinding(object sender, EventArgs e) { taxpayer = (ITaxpayer)Session["ITaxpayer"]; AddressCardView.DataSource = taxpayer.ITaxpayerAddresses.ToList(); }