public ActionResult Create([Bind(Include = "Id,FirstName,LastName,Email,Designation,Salary,HireDate,Address,City,ContactNo,AccountNo,Country,BirthDate,Gender,ProvidentFundOpted,ProvidentFundAmount,ProvidentFundPercentage,DepartmentId,ProvidentFundOptedDate,CNIC,Password,IsEmailSent")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", employee.DepartmentId); return(View(employee)); }
public ActionResult Create([Bind(Include = "LoanApplyId,EmployeeId,LoanCategory,LoanMoney,NoOfInstallments,InstallmentStartDate,InstallmentEndDate,RequestDate,LoanAgreement,LoanForProperty,LoanForAutomobile")] LoanApply loanApply) { if (ModelState.IsValid) { db.LoanApplies.Add(loanApply); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", loanApply.EmployeeId); ViewBag.LoanCategory = new SelectList(db.LoanCategories, "Id", "Type", loanApply.LoanCategory); ViewBag.LoanApplyId = new SelectList(db.LoanDocumentVerifies, "LoanId", "IsDefaulter", loanApply.LoanApplyId); ViewBag.LoanApplyId = new SelectList(db.LoanRequestStatus, "LoanId", "RequestStatus", loanApply.LoanApplyId); return(View(loanApply)); }
public ActionResult Register(Employee emp) { db.Employees.Add(emp); db.SaveChanges(); return(RedirectToAction("Login")); }