public ActionResult operatorRegister(Operatortbl operRegModel) { dbPatientBillingEntities dbuserLogModel = new dbPatientBillingEntities(); usertbl usertblvals = new usertbl(); Operatortbl opertblvals = new Operatortbl(); using (dbPatientBillingEntities2 dbPatientModel = new dbPatientBillingEntities2()) { if (dbPatientModel.Operatortbls.Any(x => x.O_userName == operRegModel.O_userName)) { ViewBag.Duplicatemsg = "User already exist."; return(View("patientRegister", operRegModel)); } else { opertblvals.Operator_Name = operRegModel.Operator_Name; opertblvals.Gender = operRegModel.Gender; opertblvals.PhoneNo = operRegModel.PhoneNo; opertblvals.PhoneNo = operRegModel.PhoneNo; opertblvals.O_email = operRegModel.O_email; opertblvals.O_address = operRegModel.O_address; opertblvals.userType = operRegModel.userType; usertblvals.userType = opertblvals.userType; opertblvals.O_userName = operRegModel.O_userName; usertblvals.userName = opertblvals.O_userName; opertblvals.O_Password = operRegModel.O_Password; usertblvals.userpassword = opertblvals.O_Password; } dbPatientModel.Operatortbls.Add(opertblvals); dbuserLogModel.usertbls.Add(usertblvals); dbuserLogModel.SaveChanges(); dbPatientModel.SaveChanges(); } ModelState.Clear(); ViewBag.SuccessMessage = "Registration Succesfull."; return(View("operatorRegister", new Operatortbl())); }
public ActionResult operatorRegister() { Operatortbl operRegModel = new Operatortbl(); return(View(operRegModel)); }