protected void ApproveButton_Click(object sender, EventArgs e) { try { string approvedBy = (string)Global.SessionUser.UserName; tinRequest = (ITINRequest)Session["TinRequest"]; long requestId = tinRequest.RequestId; string tin = ITINRequest.ApproveTinRequest(requestId, approvedBy); string message = string.Format("TIN: {0} has been successfully generated.", tin); DisplayAlert("Success", "Individual TIN Request", message); string firstName = tinRequest.FirstName; string lastname = tinRequest.LastName; string phone = tinRequest.Phone1; //SMSMessaging.SendGenericSms(firstName,lastname,tin,phone); TinRequestGridview.DataBind(); TinRequestMultiView.ActiveViewIndex = 0; } catch (Exception ex) { DisplayAlert("Danger", "Individual TIN Request", ex.Message); } }
private void ValidateRecord(ITINRequest request) { string nin = request.NIN; string bvn = request.BVN; string jtbTin = request.JTBTIN; string message; if (ExistInNIN(nin) == true) { message = string.Format("National Identity Number: {0} is already registered as a taxpayer", nin); throw new Exception(message); } if (ExistInBVN(bvn) == true) { message = string.Format("BVN: {0} is already registered as a taxpayer", bvn); throw new Exception(message); } if (!string.IsNullOrEmpty(jtbTin) && context.ITaxpayers.Any(n => n.JTBTIN == jtbTin) == true) { message = string.Format("JTB TIN: {0} is already registered as a taxpayer", jtbTin); throw new Exception(message); } if (string.IsNullOrEmpty(bvn) && string.IsNullOrEmpty(nin)) { message = string.Format("A BVN or National Identity Number (NIN) is required to submit this request"); throw new Exception(message); } }