public ActionResult GenerateTask(TaskViewModel taskView) { OperationTbl tbl = new OperationTbl(); tbl.AirportFrom = taskView.AirportFrom; tbl.AirportTo = taskView.AirportTo; tbl.Cabin = taskView.CabindName; tbl.CaptainID = Convert.ToInt32(taskView.CaptinId); tbl.Client = taskView.Client; tbl.FirstOfficerID = Convert.ToInt32(taskView.firstOfficerId); tbl.FlightNumber = taskView.FlightNumber; tbl.Landing = taskView.Landing; tbl.OperationDate = taskView.Calender; tbl.OperationDay = Convert.ToInt32(taskView.DayId); tbl.PAX = taskView.Pax; tbl.REG = taskView.Reg; tbl.TakeOFF = taskView.TakeOff; db.OperationTbls.Add(tbl); db.SaveChanges(); return(RedirectToAction("GenerateTask")); }