public async Task Get() { player.Play("Get"); var conversion1 = Conversions.Conversion1; var beneficiary1 = Beneficiaries.Beneficiary1; var payment1 = Payments.Payment1; Conversion conversion = await client.CreateConversionAsync(conversion1); Beneficiary beneficiary = await client.CreateBeneficiaryAsync(beneficiary1); payment1.BeneficiaryId = beneficiary.Id; payment1.ConversionId = conversion.Id; Payment payment = await client.CreatePaymentAsync(payment1, Payments.Payer1); Payer gotten = await client.GetPayerAsync(payment.PayerId); Assert.AreEqual(Payments.Payer1.CompanyName, gotten.CompanyName); Assert.AreEqual(Payments.Payer1.FirstName, gotten.FirstName); Assert.AreEqual(Payments.Payer1.LastName, gotten.LastName); Assert.AreEqual(Payments.Payer1.City, gotten.City); Assert.AreEqual(Payments.Payer1.Address, gotten.Address); Assert.AreEqual(Payments.Payer1.Postcode, gotten.Postcode); Assert.AreEqual(Payments.Payer1.StateOrProvince, gotten.StateOrProvince); Assert.AreEqual(Payments.Payer1.Country, gotten.Country); Assert.AreEqual(Payments.Payer1.DateOfBirth, gotten.DateOfBirth); Assert.AreEqual(Payments.Payer1.IdentificationType, gotten.IdentificationType); }
protected void dgBeneficiary_ItemCommand(object source, DataGridCommandEventArgs e) { Beneficiary beneficiary = new Beneficiary(); if (e.CommandName == "AddNew") { try { TextBox txtName = e.Item.FindControl("txtBeneficiaryName") as TextBox; beneficiary.BeneficiaryName = txtName.Text; TextBox txtBranchName = e.Item.FindControl("txtBranchName") as TextBox; beneficiary.BranchName = txtBranchName.Text; TextBox txtBankName = e.Item.FindControl("txtBankName") as TextBox; beneficiary.BankName = txtBankName.Text; TextBox txtSortCode = e.Item.FindControl("txtSortCode") as TextBox; beneficiary.SortCode = txtSortCode.Text; TextBox txtAccountNumber = e.Item.FindControl("txtAccountNumber") as TextBox; beneficiary.AccountNumber = txtAccountNumber.Text; SaveBeneficiary(beneficiary); dgBeneficiary.EditItemIndex = -1; BindBeneficiaries(); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to Add Beneficiary " + ex.Message, ChurchERP.Enums.RMessageType.Error)); } } pnlBeneficary_ModalPopupExtender.Show(); }
public List <Beneficiary> GetAllBeneficiaryList() { List <Beneficiary> allTypes = new List <Beneficiary>(); SqlConnection con = null; { String selectAllStr = "SELECT * FROM Beneficiary"; con = getConnection(); SqlCommand cmd = new SqlCommand(selectAllStr, con); con.Open(); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { Beneficiary p = new Beneficiary(); p.Benf_Id = Convert.ToInt32(reader["Benf_Id"]); // p.Type_desc = Convert.ToString(reader["Type_desc"]); allTypes.Add(p); } } return(allTypes); }
public async Task Delete() { player.Play("Delete"); var beneficiary1 = Beneficiaries.Beneficiary1; Beneficiary created = await client.CreateBeneficiaryAsync(beneficiary1); Beneficiary deleted = await client.DeleteBeneficiaryAsync(created.Id); Assert.AreEqual(created, deleted); try { await client.GetBeneficiaryAsync(created.Id); Assert.Fail(); } catch (System.Exception ex) { Assert.IsInstanceOf(typeof(NotFoundException), ex); } }
public async Task <IActionResult> PutBeneficiary([FromRoute] int id, [FromBody] Beneficiary beneficiary) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != beneficiary.Id) { return(BadRequest()); } _context.Entry(beneficiary).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BeneficiaryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void MergeFrom(ProtoTransferDispatchMessage other) { if (other == null) { return; } if (other.message_ != null) { if (message_ == null) { Message = new global::OpenVASP.ProtocolMessages.Messages.ProtoMessage(); } Message.MergeFrom(other.Message); } if (other.originator_ != null) { if (originator_ == null) { Originator = new global::OpenVASP.ProtocolMessages.Messages.ProtoOriginator(); } Originator.MergeFrom(other.Originator); } if (other.beneficiary_ != null) { if (beneficiary_ == null) { Beneficiary = new global::OpenVASP.ProtocolMessages.Messages.ProtoBeneficiary(); } Beneficiary.MergeFrom(other.Beneficiary); } if (other.transfer_ != null) { if (transfer_ == null) { Transfer = new global::OpenVASP.ProtocolMessages.Messages.ProtoTransferReply(); } Transfer.MergeFrom(other.Transfer); } if (other.transaction_ != null) { if (transaction_ == null) { Transaction = new global::OpenVASP.ProtocolMessages.Messages.ProtoTransaction(); } Transaction.MergeFrom(other.Transaction); } if (other.Comment.Length != 0) { Comment = other.Comment; } if (other.vaspInfo_ != null) { if (vaspInfo_ == null) { VaspInfo = new global::OpenVASP.ProtocolMessages.Messages.ProtoVaspInfo(); } VaspInfo.MergeFrom(other.VaspInfo); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public async Task <ActionResult <Beneficiary> > PostBeneficiary(Beneficiary beneficiary) { _context.Beneficiaries.Add(beneficiary); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBeneficiary", new { id = beneficiary.ID }, beneficiary)); }
public IHttpActionResult PutBeneficiary(decimal id, Beneficiary beneficiary) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != beneficiary.ben_id) { return(BadRequest()); } db.Entry(beneficiary).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!BeneficiaryExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public ActionResult SendMoney(string selectedAccount, string selectedBeneficiary, float amount) { if (Session["LoggedInCustomerId"] == null) { return(Redirect("/HomePage/Index")); } else { if (Session["LoggedInCustomerId"] == null) { return(Redirect("/HomePage/Index")); } else { var t = new Transactions(); t.amount = amount; t.recieverAccNo = int.Parse(selectedBeneficiary); t.senderAccNo = int.Parse(selectedAccount.Substring(0, 8)); var ch = new CustomerHelper(); ViewData["TransferFunds"] = ch.SendMoney(t); var c = new CustomerDetails(); c.cid = HttpContext.Session["LoggedInCustomerId"].ToString(); var b = new Beneficiary(); b.custId = HttpContext.Session["LoggedInCustomerId"].ToString(); ViewBag.Beneficiaries = ch.fetchBeneficiaryAccount(b); return(Redirect("/CustomerFundTransfer/TransferFunds")); } } }
public async Task <IActionResult> PutBeneficiary(Guid id, Beneficiary beneficiary) { if (id != beneficiary.ID) { return(BadRequest()); } _context.Entry(beneficiary).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BeneficiaryExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public HttpResponseMessage AddBeneficiary(Beneficiary beneficiary) { try { if (beneficiary.b_account_number == beneficiary.account_number) { return(Request.CreateResponse(HttpStatusCode.OK, "Same")); } var exists = db.Beneficiaries.FirstOrDefault(b => b.account_number == beneficiary.account_number && b.b_account_number == beneficiary.b_account_number); if (exists == null) { db.Beneficiaries.Add(beneficiary); db.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK, "Okay")); } else { return(Request.CreateResponse(HttpStatusCode.OK, "Exists")); } } catch (Exception e) { while (e.InnerException != null) { e = e.InnerException; } return(Request.CreateResponse(HttpStatusCode.OK, e.Message)); } }
protected void dgBeneficiary_UpdateCommand(object source, DataGridCommandEventArgs e) { int id = (int)dgBeneficiary.DataKeys[e.Item.ItemIndex]; Beneficiary beneficiary = _presenter.GetBeneficiaryById(id); try { TextBox txtName = e.Item.FindControl("txtEdtBeneficiaryName") as TextBox; beneficiary.BeneficiaryName = txtName.Text; TextBox txtBankName = e.Item.FindControl("txtEdtBankName") as TextBox; beneficiary.BankName = txtBankName.Text; TextBox txtAccountNumber = e.Item.FindControl("txtEdtAccountNumber") as TextBox; beneficiary.AccountNumber = txtAccountNumber.Text; beneficiary.Status = "Active"; SaveBeneficiary(beneficiary); dgBeneficiary.EditItemIndex = -1; BindBeneficiaries(); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to Update Beneficiary. " + ex.Message, RMessageType.Error)); ExceptionUtility.LogException(ex, ex.Source); ExceptionUtility.NotifySystemOps(ex, _presenter.CurrentUser().FullName); } ScriptManager.RegisterStartupScript(this, GetType(), "receiveBeneficiaryModal", "showBeneficiaryModal();", true); }
public ActionResult Create([Bind(Include = "BeneficiaryId,Name,Address,GPS,FamilyNo,age,Note")] Beneficiary beneficiary) { if (ModelState.IsValid) { var userId = User.Identity.GetUserId(); var hasAccount = db.Beneficiaries.Any(x => x.UserId == userId); if (hasAccount) { return(RedirectToAction("Index", "Home", null)); } beneficiary.UserId = User.Identity.GetUserId(); db.Beneficiaries.Add(beneficiary); db.SaveChanges(); MessageHelper message = new MessageHelper() { Message = "تم انشاء الحساب يمكنك الان انشاء طلب", MessageLink = "/Requests/Index", MessageLinkText = "أضغط هنا", MessageType = MessageType.success }; TempData["MessageHelper"] = message; return(RedirectToAction("Index", "Home", null)); } return(View(beneficiary)); }
public void ValidateModel(Beneficiary beneficiary) { if (beneficiary.AgeInYears < 18 && beneficiary.OVCTypeID == null) { ModelState.AddModelError("OVCTypeID", "Campo 'Tipo de OVC', obrigatório para crianças."); } }
public static async Task <Beneficiary> GetBeneficiary(string PolicyNumber) { string servicePath, sResponse; Beneficiary beneficiary = null; HttpResponseMessage response; try { //Build the URI servicePath = string.Format("{0}{1}{2}", Constants.UriConstants._ServicePath, Constants.UriConstants._GetBeneficiary, PolicyNumber); //Asynchronous call the WEB API GetByPolicyNumber method to get the Beneficiary by Policy NUmber response = await _Client.GetAsync(servicePath); if (response.IsSuccessStatusCode) { //Deserialize JSON response to Beneficiary sResponse = await response.Content.ReadAsStringAsync(); beneficiary = JsonConvert.DeserializeObject <Beneficiary>(sResponse); } return(beneficiary); } catch (Exception ex) { LoggerLibrary.Logger.Log(LoggerLibrary.Logger.GetCurrentMethod(), ex.Message, ex.StackTrace); throw; } }
public int ADD([FromBody] Beneficiary obj) { try { List <Beneficiary> beneficiaries = new List <Beneficiary>(); string sql = "SELECT beneficiaryID,beneficiaryName,beneficiaryMail,beneficiaryPhone,beneficiaryFax,beneficiaryAddress FROM beneficiarys WHERE beneficiaryName =@beneficiaryName AND beneficiaryPhone=@beneficiaryPhone"; DB.PullFromBD(sql, (cmd) => { cmd.Parameters.AddWithValueCheckNull("@beneficiaryName", obj.beneficiaryName); cmd.Parameters.AddWithValueCheckNull("@beneficiaryPhone", obj.beneficiaryPhone); }, (dr) => beneficiaries.Add(new Beneficiary(dr))); if (beneficiaries.Count > 0) { return(beneficiaries[0].beneficiaryID); } else { string msql = "INSERT INTO beneficiarys(beneficiaryName,beneficiaryMail,beneficiaryPhone,beneficiaryFax,beneficiaryAddress)" + "OUTPUT INSERTED.beneficiaryID VALUES(@beneficiaryName,@beneficiaryMail,@beneficiaryPhone,@beneficiaryFax,@beneficiaryAddress)"; return(DB.ExecuteCommand(msql, (cmd) => { cmd.Parameters.AddWithValueCheckNull("@beneficiaryName", obj.beneficiaryName); cmd.Parameters.AddWithValueCheckNull("@beneficiaryMail", obj.beneficiaryMail); cmd.Parameters.AddWithValueCheckNull("@beneficiaryPhone", obj.beneficiaryPhone); cmd.Parameters.AddWithValueCheckNull("@beneficiaryFax", obj.beneficiaryFax); cmd.Parameters.AddWithValueCheckNull("@beneficiaryAddress", obj.beneficiaryAddress); }, true)); } } catch (Exception) { return(-1); } }
private void btnAddB_Click(object sender, EventArgs e) { bool go = false; if (txtBID.Text.Equals("")) { txtBID.Text = Guid.NewGuid().ToString("N"); } foreach (Beneficiary item in BeneficiaryList) { if (txtBID.Text.Trim() == item.BeneficairyID) { go = true; break; } } if (go == false) { Beneficiary benAdd = new Beneficiary(txtBID.Text.Trim(), txtBName.Text.Trim(), txtBBranchCode.Text.Trim(), user.RsaID); BeneficiaryList.Add(benAdd); ClearBens(); BeneficiaryController.AddBeneficiary(benAdd); FillBeneficiaryDatagrid(BeneficiaryList); } else { MetroMessageBox.Show(this, "Beneficiary With Your Specified ID, Already Exists!", "Beneficiary ID In Use"); } }
public IHttpActionResult PostBeneficiary(Beneficiary beneficiary) { var beneficiarylist = db.fetch_beneficiaries(beneficiary.account_no); return(Ok(beneficiarylist)); //if (!ModelState.IsValid) //{ // return BadRequest(ModelState); //} //db.Beneficiaries.Add(beneficiary); //try //{ // db.SaveChanges(); //} //catch (DbUpdateException) //{ // if (BeneficiaryExists(beneficiary.ben_id)) // { // return Conflict(); // } // else // { // throw; // } //} //return CreatedAtRoute("DefaultApi", new { id = beneficiary.ben_id }, beneficiary); }
private void btnUpdateBPI_Click(object sender, EventArgs e) { bool go = false; Beneficiary Benn = new Beneficiary(); foreach (Beneficiary item in BeneficiaryList) { if (item.BeneficairyID == txtBID.Text.Trim()) { BeneficiaryList.Remove(item); Benn = new Beneficiary(txtBID.Text, txtBName.Text, txtBBranchCode.Text, user.RsaID); BeneficiaryList.Add(Benn); BeneficiaryController.UpdateBeneficiary(Benn); txtBName.Text = ""; txtBID.Text = ""; txtBBranchCode.Text = ""; FillBeneficiaryDatagrid(BeneficiaryList); ClearBens(); go = true; break; } } if (go != true) { MetroMessageBox.Show(this, "The Account You're Trying to Update Does Not Exist!", "Account Does Not Exist"); } }
public JsonResult AddBeneficiaryUpdate(int Employee_id, string PrimaryBeneficiary, string ContingentBeneficiary, string FirstName, string LastName, string SSN, string RelationshipToEmployee, DateTime DateOfBirth, string PhoneNumber, string PercentageOfBenefits, string MailingAddress, string City, string State, string ZipCode) { Beneficiary benefi = new Beneficiary(); benefi.Employee_id = Employee_id; benefi.PrimaryBeneficiary = PrimaryBeneficiary; benefi.ContingentBeneficiary = ContingentBeneficiary; benefi.FirstName = FirstName; benefi.LastName = LastName; benefi.SSN = SSN; benefi.RelationshipToEmployee = RelationshipToEmployee; benefi.DOB = DateOfBirth; benefi.PhoneNumber = PhoneNumber; benefi.PercentageOfBenefits = PercentageOfBenefits; benefi.Address = MailingAddress; benefi.CIty = City; benefi.State = State; benefi.ZipCode = ZipCode; db.Beneficiaries.Add(benefi); db.SaveChanges(); int result = Employee_id; return(Json(new { data = result }, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult PostBeneficiary(Beneficiary beneficiary) { var exists = db.Beneficiaries.Where(a => a.account_no == beneficiary.account_no && a.ben_account_no == beneficiary.ben_account_no).FirstOrDefault(); if (exists != null) { return(Ok("exists")); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } beneficiary.ben_id = random.Next(100000); db.Beneficiaries.Add(beneficiary); try { db.SaveChanges(); } catch (DbUpdateException) { if (BeneficiaryExists(beneficiary.ben_id)) { return(Conflict()); } else { throw; } } return(CreatedAtRoute("DefaultApi", new { id = beneficiary.ben_id }, beneficiary)); }
//akshta------------------------------------------------------------------------------------------------------------ public Boolean AddBeneficiary(Beneficiary benf) { int result = 0; SqlConnection con = getConnection(); { try { string QUERY = "INSERT INTO Beneficiary(Benf_name,Benf_acc_no,Benf_contact_no,Benf_email_id) VALUES (@Benf_name,@Benf_acc_no,@Benf_contact_no,@Benf_email_id)"; con.Open(); SqlCommand cmd = new SqlCommand(QUERY, con); cmd.Parameters.AddWithValue("@Benf_name", benf.Benf_name); cmd.Parameters.AddWithValue("@Benf_acc_no", benf.Benf_acc_no); cmd.Parameters.AddWithValue("@Benf_contact_no", benf.Benf_contact_no); cmd.Parameters.AddWithValue("@Benf_email_id", benf.Benf_email_id); result = cmd.ExecuteNonQuery(); con.Close(); } catch (SqlException se) { Console.Write(se.Message); } } return(result > 0 ? true : false); }
public async Task <IActionResult> OnGetAsync() { beneficiary = new Beneficiary(); List <Beneficiary> recipient = new List <Beneficiary>(); //get recipients client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.TryAddWithoutValidation("Authorization", "Bearer sk_test_f075718722a05eb8182c77beb0279ebe1d2249d2"); string beneficiaryRes = await client.GetStringAsync("https://api.paystack.co/transferrecipient"); BeneficiaryResponse beneficiaryData = JsonConvert.DeserializeObject <BeneficiaryResponse>(beneficiaryRes); if (beneficiaryData.status) { foreach (Models.Beneficiaries item in beneficiaryData.data) { //get values to set form fields. beneficiary.RecipientCode = item.recipient_code; //populate select list recipient.Add(new Beneficiary { RecipientCode = item.recipient_code, AccountName = item.name + " - " + item.details.account_number + "( " + item.details.bank_name + ")" }); //populate form fields ViewData["Recipients"] = new SelectList(recipient, "RecipientCode", "AccountName"); } } return(Page()); }
protected void dgBeneficiary_UpdateCommand(object source, DataGridCommandEventArgs e) { int id = (int)dgBeneficiary.DataKeys[e.Item.ItemIndex]; Beneficiary beneficiary = _presenter.GetBeneficiaryById(id); try { TextBox txtName = e.Item.FindControl("txtEdtBeneficiaryName") as TextBox; beneficiary.BeneficiaryName = txtName.Text; TextBox txtBranchName = e.Item.FindControl("txtEdtBranchName") as TextBox; beneficiary.BranchName = txtBranchName.Text; TextBox txtBankName = e.Item.FindControl("txtEdtBankName") as TextBox; beneficiary.BankName = txtBankName.Text; TextBox txtSortCode = e.Item.FindControl("txtEdtSortCode") as TextBox; beneficiary.SortCode = txtSortCode.Text; TextBox txtAccountNumber = e.Item.FindControl("txtEdtAccountNumber") as TextBox; beneficiary.AccountNumber = txtAccountNumber.Text; SaveBeneficiary(beneficiary); dgBeneficiary.EditItemIndex = -1; BindBeneficiaries(); } catch (Exception ex) { Master.ShowMessage(new AppMessage("Error: Unable to Update Beneficiary. " + ex.Message, ChurchERP.Enums.RMessageType.Error)); } }
private void dgvBeneficiary_RowEnter(object sender, DataGridViewCellEventArgs e) { int index = e.RowIndex; if (BeneficiaryListS.Count == 0) { beneficiary = BeneficairyList[index]; } else { beneficiary = BeneficiaryListS[index]; BeneficiaryListS.Clear(); } txtBname.Text = beneficiary.BeneficairyName; BenPaymentAccountList = PaymentsAccountController.SearchBenPaymentAcount(beneficiary.BeneficairyID); BeneficairyCrypoList = CryptoController.GetCrypto(beneficiary.BeneficairyID); BenbjectListe = PopSelectedBenAcount(BenPaymentAccountList, BeneficairyCrypoList); List <string> remove = new List <string>(); cbBAcounType.Items.Clear(); foreach (string item in BenbjectListe) { cbBAcounType.Items.Add(item); } BenbjectListe.Clear(); }
public async Task Create() { player.Play("Create"); var beneficiary1 = Beneficiaries.Beneficiary1; Beneficiary created = await client.CreateBeneficiaryAsync(beneficiary1); Assert.AreEqual(beneficiary1.BankAccountHolderName, created.BankAccountHolderName); Assert.AreEqual(beneficiary1.BankCountry, created.BankCountry); Assert.AreEqual(beneficiary1.Currency, created.Currency); Assert.AreEqual(beneficiary1.Name, created.Name); Assert.Contains(beneficiary1.BeneficiaryAddress[0], created.BeneficiaryAddress); Assert.AreEqual(beneficiary1.BeneficiaryCountry, created.BeneficiaryCountry); Assert.AreEqual(beneficiary1.BicSwift, created.BicSwift); Assert.AreEqual(beneficiary1.Iban, created.Iban); Assert.AreEqual(beneficiary1.DefaultBeneficiary, created.DefaultBeneficiary); Assert.Contains(beneficiary1.BankAddress[0], created.BankAddress); Assert.AreEqual(beneficiary1.BankName, created.BankName); Assert.AreEqual(beneficiary1.BankAccountType, created.BankAccountType); Assert.AreEqual(beneficiary1.BeneficiaryEntityType, created.BeneficiaryEntityType); Assert.AreEqual(beneficiary1.BeneficiaryCompanyName, created.BeneficiaryCompanyName); Assert.AreEqual(beneficiary1.BeneficiaryFirstName, created.BeneficiaryFirstName); Assert.AreEqual(beneficiary1.BeneficiaryLastName, created.BeneficiaryLastName); Assert.AreEqual(beneficiary1.BeneficiaryCity, created.BeneficiaryCity); Assert.AreEqual(beneficiary1.BeneficiaryPostcode, created.BeneficiaryPostcode); Assert.AreEqual(beneficiary1.BeneficiaryStateOrProvince, created.BeneficiaryStateOrProvince); Assert.AreEqual(beneficiary1.BeneficiaryDateOfBirth, created.BeneficiaryDateOfBirth); Assert.AreEqual(beneficiary1.BeneficiaryIdentificationType, created.BeneficiaryIdentificationType); }
public ActionResult NewPayment(PaymentViewModel model) { Beneficiary beneficiary = new Beneficiary(); Currency currency = new Currency(); beneficiary.Name = model.Beneficiary; currency.CurrencyCode = model.Currency; Payment payment = new Payment(model.Name, model.Amount, currency, beneficiary, model.Email, model.CreatedDate, model.PaymentDate, model.CreatedBy, new PaymentSource(model.Source), new PaymentType(model.Type), model.OptOut); //TODO: get current user var client = new RestClient("http://localhost:4000/api/payments/NewPayment"); var request = new RestRequest(Method.POST); var settings = new JsonSerializerSettings() { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat }; string body = JsonConvert.SerializeObject(payment, settings); request.AddParameter("Application/Json", body, ParameterType.RequestBody); var response = client.Execute(request); if (response.StatusCode == System.Net.HttpStatusCode.OK) { return(RedirectToAction("NewPayment", "Payments")); } else { ModelState.AddModelError("", "Something went wrong"); } return(RedirectToAction("Index", "Home")); }
public async Task <IActionResult> Add(Beneficiary beneficiary) { _unitOfWork.Beneficiary.Add(beneficiary); await _unitOfWork.SaveAllAsync(); return(Ok(beneficiary)); }
public override int GetHashCode() { int hash = 1; if (message_ != null) { hash ^= Message.GetHashCode(); } if (originator_ != null) { hash ^= Originator.GetHashCode(); } if (beneficiary_ != null) { hash ^= Beneficiary.GetHashCode(); } if (transfer_ != null) { hash ^= Transfer.GetHashCode(); } if (Comment.Length != 0) { hash ^= Comment.GetHashCode(); } if (vaspInfo_ != null) { hash ^= VaspInfo.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
// GET: Beneficiaries/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Beneficiary Beneficiary = db.Beneficiaries .Include(x => x.HIVStatus) .Include(x => x.KinshipToFamilyHead) .Include(x => x.OVCType) .Where(x => x.BeneficiaryID == id).FirstOrDefault(); if (Beneficiary == null) { return(HttpNotFound()); } List <ChildStatusHistory> childStatusHistoryList = beneficiaryStatusService.FetchChildStatusHistoryByBeneficiary(Beneficiary).ToList(); ViewBag.ChildStatusHistoryList = childStatusHistoryList; ViewBag.CurrentChildStatus = childStatusHistoryList.LastOrDefault(); ViewBag.ChildStatusList = beneficiaryStatusService.FindAllChildStatuses(); ViewBag.ChildStatusListToChild = beneficiaryStatusService.FindAllChildStatuses().Where(x => !x.Description.Equals("Adulto")); ViewBag.Kinships = db.SimpleEntities.Where(se => se.Type == "degree-of-kinship" && se.Code != "99").ToList(); ViewBag.OVCTypes = db.OVCTypes.Where(o => o.Description != "Indeterminado").ToList(); ViewBag.HIVStatuses = hivStatusService.findAllBeneficiaryStatuses(Beneficiary); SetPreviousAndCurrentViewIDs(null, id); return(View(Beneficiary)); }
static Dictionary<string, object> getValue(Beneficiary bf) { Dictionary<string, object> data = new Dictionary<string, object>(); data["Name"] = bf.Name; data["Block"] = bf.Block; data["GenderId"] = bf.GenderId; data["BirthYear"] = bf.BirthYear; data["EducationLevelId"] = bf.EducationLevelId; data["Disability"] = bf.Disability; data["Disabilities"] = bf.Disabilities; data["PrimaryOccupationId"] = bf.PrimaryOccupationId; data["PrimaryWorkDaysM"] = bf.PrimaryWorkDaysM; data["PrimaryDailyWage"] = bf.PrimaryDailyWage; data["SecondaryOccupationId"] = bf.SecondaryOccupationId; data["SecondaryWorkDaysM"] = bf.SecondaryWorkDaysM; data["SecondaryDailyWage"] = bf.SecondaryDailyWage; data["UniqueId"] = bf.UniqueId; data["StartDateYear"] = bf.StartDateYear; data["OrigEntryDate"] = FormatHelper.FormatOrigDate(bf.OrigEntryDate); return data; }