public Recipient(RecipientDB rec) { if (rec != null) { this.Id = rec.Id; this.FullName = rec.FullName; this.CellPhone = rec.CellPhone; } }
public RecipientDB MapToRecipientDB() { RecipientDB recDb = new RecipientDB(); recDb.Id = this.Id; recDb.FullName = this.FullName; recDb.CellPhone = this.CellPhone; return(recDb); }
public JsonResult AddRecipient(Recipient toAdd) { RecipientDB addedRec = this.recRep.InsertRecipient(toAdd.MapToRecipientDB()); return(Json(addedRec, JsonRequestBehavior.AllowGet)); }