public ActionResult Create(FormCollection collection) { try { // TODO: Add insert logic here var cm = new CustomerModel() { CustomerCode = collection["CustomerCode"].ToString(), CustomerName = collection["CustomerName"].ToString(), ContactPersonName = collection["ContactPersonName"].ToString(), AddressLine1 = collection["AddressLine1"].ToString(), AddressLine2 = collection["AddressLine2"].ToString(), AddressLine3 = collection["AddressLine3"].ToString(), Telephone1 = collection["Telephone1"].ToString(), Telephone2 = collection["Telephone1"].ToString(), CountryCode = collection["CountryCode"].ToString(), CountryName = collection["CountryName"].ToString(), Fax1 = collection["Fax1"].ToString(), Fax2 = collection["Fax2"].ToString(), Email = collection["Email"].ToString(), Remarks = collection["Remarks"].ToString(), CustomerType = collection["MoveToList"].ToString(), InstallationDate = collection["InstallationDate"].ToString(), ExpiryDate = collection["ExpiryDate"].ToString() }; cm.AddCust(cm); return RedirectToAction("Index"); } catch(Exception ex) { Response.Write(ex.ToString()); return View(); } }