Ejemplo n.º 1
0
 internal static Customer ToCustomer(this CustomerInfoVm customerInfo)
 {
     return(new Customer
     {
         Name = customerInfo.Name,
         Email = customerInfo.Email,
         Phone = customerInfo.Phone
     });
 }
Ejemplo n.º 2
0
 // GET: Admin
 public ActionResult Index()
 {
     using (Insurance2Entities db = new Insurance2Entities())
     {
         var customerInfos   = db.CustomerInfoes.ToList();
         var customerInfoVms = new List <CustomerInfoVm>();
         foreach (var customerInfo in customerInfos)
         {
             var customerInfoVm = new CustomerInfoVm();
             customerInfoVm.Id           = customerInfo.Id;
             customerInfoVm.FirstName    = customerInfo.FirstName;
             customerInfoVm.LastName     = customerInfo.LastName;
             customerInfoVm.EmailAddress = customerInfo.EmailAddress;
             customerInfoVm.Quote        = customerInfo.Quote.ToString();
             customerInfoVms.Add(customerInfoVm);
         }
         return(View(customerInfoVms));
     }
 }