public String getEmpName(String empid) { tbEmp emp = new tbEmp(); emp = _repository.getProfileAttributes(empid); String empname = emp == null ? string.Empty : emp.EmpName ?? string.Empty; return(empname); }
public ActionResult EditProfile() { String empID = HttpContext.User.Identity.Name; var emp = new tbEmp(); emp.EmpID = empID; ProfileService profileService=new ProfileService(); emp.EmpName = profileService.getEmpName(empID) == null ? String.Empty : profileService.getEmpName(empID); emp.Phone = profileService.getPhone(empID) == null ? String.Empty : profileService.getPhone(empID); emp.Location = profileService.getLocation(empID) == null ? String.Empty : profileService.getLocation(empID); emp.Email = profileService.getEmail(empID) == null ? String.Empty : profileService.getEmail(empID); return View(emp); }
public ActionResult EditProfile(tbEmp emp) { ProfileService profileService = new ProfileService(); if (profileService.setProfileAttributes(emp)) { return(View(emp)); } else { return (View("Error")); } }
public ActionResult EditProfile() { String empID = HttpContext.User.Identity.Name; var emp = new tbEmp(); emp.EmpID = empID; ProfileService profileService = new ProfileService(); emp.EmpName = profileService.getEmpName(empID) == null ? String.Empty : profileService.getEmpName(empID); emp.Phone = profileService.getPhone(empID) == null ? String.Empty : profileService.getPhone(empID); emp.Location = profileService.getLocation(empID) == null ? String.Empty : profileService.getLocation(empID); emp.Email = profileService.getEmail(empID) == null ? String.Empty : profileService.getEmail(empID); return(View(emp)); }
public bool setProfileAttributes(tbEmp emp) { try { CSCPortalDataContext _dataContext = new CSCPortalDataContext(); var empchanged = (from emp1 in _dataContext.tbEmps select emp1).Where(x => x.EmpID == emp.EmpID).FirstOrDefault(); empchanged.EmpName = emp.EmpName; empchanged.Location = emp.Location; empchanged.Phone = emp.Phone; empchanged.Email = emp.Email; _dataContext.SubmitChanges(); } catch (Exception e) { return(false); } return(true); }
public MembershipCreateStatus CreateUser(string userName, string password, string email, String empname) { if (String.IsNullOrEmpty(userName)) { throw new ArgumentException("Value cannot be null or empty.", "userName"); } if (String.IsNullOrEmpty(password)) { throw new ArgumentException("Value cannot be null or empty.", "password"); } if (String.IsNullOrEmpty(email)) { throw new ArgumentException("Value cannot be null or empty.", "email"); } MembershipCreateStatus status = new MembershipCreateStatus(); try { using (TransactionScope scope = new TransactionScope()) { _provider.CreateUser(userName, password, email, null, null, true, null, out status); var emp = new tbEmp(); emp.EmpID = userName; emp.Email = email; emp.EmpName = empname; _dataContext.tbEmps.InsertOnSubmit(emp); _dataContext.SubmitChanges(); scope.Complete(); } } catch (Exception e) { } finally { } return(status); }
public bool setProfileAttributes(tbEmp emp) { var status = _repository.setProfileAttributes(emp); return(status); }
public bool setProfileAttributes(tbEmp emp) { var status=_repository.setProfileAttributes(emp); return status; }
public String getEmpName(String empid) { tbEmp emp = new tbEmp(); emp=_repository.getProfileAttributes(empid) ; String empname = emp==null ? string.Empty : emp.EmpName?? string.Empty; return empname; }
public bool setProfileAttributes(tbEmp emp) { try { CSCPortalDataContext _dataContext = new CSCPortalDataContext(); var empchanged=(from emp1 in _dataContext.tbEmps select emp1).Where(x=> x.EmpID==emp.EmpID).FirstOrDefault(); empchanged.EmpName=emp.EmpName; empchanged.Location=emp.Location; empchanged.Phone=emp.Phone; empchanged.Email = emp.Email; _dataContext.SubmitChanges(); } catch (Exception e) { return false; } return true; }
public MembershipCreateStatus CreateUser(string userName, string password, string email,String empname) { if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName"); if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password"); if (String.IsNullOrEmpty(email)) throw new ArgumentException("Value cannot be null or empty.", "email"); MembershipCreateStatus status= new MembershipCreateStatus(); try { using (TransactionScope scope = new TransactionScope()) { _provider.CreateUser(userName, password, email, null, null, true, null, out status); var emp = new tbEmp(); emp.EmpID = userName; emp.Email = email; emp.EmpName = empname; _dataContext.tbEmps.InsertOnSubmit(emp); _dataContext.SubmitChanges(); scope.Complete(); } } catch (Exception e) { } finally { } return status; }
public ActionResult EditProfile(tbEmp emp) { ProfileService profileService = new ProfileService(); if (profileService.setProfileAttributes(emp)) return View(emp); else return View("Error"); }