public ActionResult Edit(Int32 EmployeeId, FormCollection collection) { CCIRepository _repository = CCIRepository.CreateRepository(); UserModel _usermodel = new UserModel(); if (ModelState.IsValid) { _usermodel.EmployeeId = EmployeeId; //_usermodel.EmployeeId = Convert.ToInt32(collection["EmployeeId"]); _usermodel.EmployeeName = collection["EmployeeName"].ToString(); _usermodel.AccountName = collection["AccountName"].ToString(); _usermodel.EmailAddress = collection["EmailAddress"].ToString(); _usermodel.CostCenterId = Convert.ToInt32(collection["CostCenterId"]); _usermodel.MobileNumber = Convert.ToInt64(collection["MobileNumber"]); _usermodel.MobileAcNumber = Convert.ToInt32(collection["MobileAcNumber"]); _usermodel.DataCardNumber = Convert.ToInt32(collection["DataCardNumber"]); _usermodel.DatacardAcNumber = Convert.ToInt32(collection["DatacardAcNumber"]); _usermodel.OfficeLocation = collection["OfficeLocation"].ToString(); _repository.EditSingleData(_usermodel); } return(RedirectToAction("Index")); }