public IActionResult ShowAllUser() { var User_list = new List <UserWithIdentity>(_Userservice.Get()); var viewModel = new ShowAllUserViewModel() { Users = User_list }; return(View(viewModel)); }
public ActionResult Statisticts() { var Users = Userservice.Get().ToList(); List <int> Hours = new List <int>(); List <int> Status = new List <int>(); List <int> incomes = new List <int>(); List <int> outcomes = new List <int>(); Status.Add(Taskservice.GetNumOfProjectStatuses("DONE")); Status.Add(Taskservice.GetNumOfProjectStatuses("in progress")); Status.Add(Taskservice.GetNumOfProjectStatuses("new")); ViewBag.Status = Status; for (int i = 0; i < 12; i++) { DateTime date = new DateTime(DateTime.Today.Year, i + 1, 1); Hours.Add(Teamservice.GetHoursForMonth(date)); incomes.Add(Incomeservice.GetMounthlyIncomesSum(date)); outcomes.Add(Outcomeservice.GetMounthlyOutcomesSum(date)); } ViewBag.Hours = Hours; ViewBag.Incomes = incomes; ViewBag.Outcomes = outcomes; return(View()); }
public DeploymentToDisplay(Deployment document, ProjectService ProjectService, DatabaseService DatabaseService, Userservice Userservice) { _ProjectService = ProjectService; _DatabaseService = DatabaseService; _Userservice = Userservice; var _project = _ProjectService.Get(document.AttachedToProjectId); var project_string = _project.Name; var _db = _DatabaseService.Get(document.TargetDbId); var db_string = _db.Name; var _user = _Userservice.Get(document.SchemaCreatedByUserId); var user_string = _user.FullName; this.DeploymentId = document.DeploymentId; this.Name = document.Name; this.DeployMode = document.DeployMode; this.PlannedTimeOfDeployment = document.PlannedTimeOfDeployment; this.TimeOfDeployment = document.TimeOfDeployment; this.Details = document.Details; this.HasBeenDeployed = document.HasBeenDeployed; this.AttachedFeatureDescription = document.AttachedFeatureDescription; this.SchemaContent = document.SchemaContent; this.TargetDbId = document.TargetDbId; this.Nazwa_bd = db_string; this.SchemaCreatedByUserId = document.SchemaCreatedByUserId; this.Nazwa_user = user_string; this.AttachedToProjectId = document.AttachedToProjectId; this.Nazwa_project = project_string; }
public ActionResult ProjectShow(int id) { ViewBag.Status = ProjectStatusesService.Get(); var item = Projectservice.Single(id); ViewBag.Users = Userservice.Get(); return(View(item)); }
public IActionResult ShowDeployment() { var lista_projektow = new List <SelectListItem>(); var project_list = new List <Project>(_ProjectService.Get()); foreach (var document in project_list) { lista_projektow.Add(new SelectListItem { Selected = false, Text = document.Name, Value = document.ProjectId }); } var slist_project = new SelectList(lista_projektow, "Value", "Text"); var lista_baz = new List <SelectListItem>(); var db_list = new List <Database>(_DatabaseService.Get()); foreach (var document in db_list) { lista_baz.Add(new SelectListItem { Selected = false, Text = document.Name, Value = document.DatabaseId }); } var slist_database = new SelectList(lista_baz, "Value", "Text"); var lista_userow = new List <SelectListItem>(); var user_list = new List <UserWithIdentity>(_Userservice.Get()); foreach (var document in user_list) { lista_userow.Add(new SelectListItem { Selected = false, Text = document.FullName, Value = document.UserId }); } var slist_user = new SelectList(lista_userow, "Value", "Text"); var lista_deploymentowow = new List <SelectListItem>(); var deployment_list = new List <Deployment>(_DeploymentService.Get()); foreach (var document in deployment_list) { lista_deploymentowow.Add(new SelectListItem { Selected = false, Text = document.Name, Value = document.DeploymentId }); } var slist_deployment = new SelectList(lista_deploymentowow, "Value", "Text"); var viewModel = new ShowDeploymentViewModel() { SProjectlist = slist_project, SDatabaselist = slist_database, SUserlist = slist_user, SDeploymentlist = slist_deployment }; return(View(viewModel)); }
public ActionResult ProjectNew() { ViewBag.Users = Userservice.Get(); ViewBag.Status = ProjectStatusesService.Get(); return(View("ProjectEdit", new ProjectsViewModel() { StartDate = DateTime.Now, EndDate = DateTime.Now, AccountId = 1 })); }
public ActionResult Register(UsersLoginViewModel Users) { foreach (var us in Userservice.Get()) { if (us.Name == Users.Name) { ViewBag.RegisterUsers = "User name exists already"; return(View(Users)); } } Userservice.Save(Users as UsersViewModel); return(RedirectToAction("Login")); }
//[ValidateAntiForgeryToken] public ActionResult Login(UsersLoginViewModel Users) { foreach (var item in Userservice.Get()) { if (item.Name == Users.Name && item.Password == Users.Password) { Session["CurrentUsers"] = item; Userservice.UserId = item.Id; SignInRemember(Users.Name, true); return(RedirectToLocal(Users.ReturnUrl)); } } ViewBag.Login = "******"; return(View()); }
public ActionResult Teams(TeamsearchViewModel search) { // ViewBag.DatesProjects = Teamservice.DatesProjects(); var Projects = Projectservice.Get(); Projects.Insert(0, new ProjectsViewModel() { Id = 0, Name = "All" }); ViewBag.Projects = Projects; ViewBag.Search = search; var Users = Userservice.Get(); var items = Teamservice.GetHoursUsers(search); ViewBag.AlertMore180Hours = Teamservice.GetHoursMore180Dashboard(items); ViewBag.Dates = Teamservice.DatesBySearch(search.FromDate, search.ToDate); ViewBag.Users = Users; return(View(items)); }
public ActionResult Projectsave(ProjectsViewModel model) { if (ModelState.IsValid == false) { var Users = Userservice.Get(); ViewBag.Status = ProjectStatusesService.Get(); ViewBag.Users = new SelectList(Users, "Id", "Name"); return(View(model)); } Projectservice.Save(model); RolesService.New(Projectservice.GetLast(), "group mannager"); Userservice.Save(new RefUserProViewModel { UserId = ((UsersViewModel)Session["CurrentUsers"]).Id, IsOwner = true, ProjectId = Projectservice.GetLast(), ProjecrId = Projectservice.GetLast(), Task = new Services.Entities.TasksRoles { RoleId = RolesService.GetLast() } }); return(View("CloseAndRefresh")); }
public ActionResult Projects(ProjectsSearchViewModel search) { ViewBag.Projects = Projectservice.Get(); var items = Projectservice.Get(search, ((UsersViewModel)Session["CurrentUsers"]).Id).Where(p => p.StatusName != "disabled").ToList().ToList(); var Users = Userservice.Get(); Users.Insert(0, new UsersViewModel() { Id = 0, Name = "All" }); var u = Projectservice.Get(search); ViewBag.Users = Users; var status = ProjectStatusesService.Get(); status.Insert(0, new ProjectStatusesViewModel() { Id = 0, Name = "All" }); ViewBag.Status = status; ViewBag.Search = search; return(View(items)); }