private void CmdOkClick(object sender, EventArgs e) { var rowObject = viewProjects.GetFocusedRow() as ProjectDto; if (rowObject == null) return; // Check if the user select a valid object if (rowObject.Id <= 0 && rowObject.Code == null) return; Tag = new ProjectFactory().GetProject(new ProjectRequest { ProjectId = rowObject.Id, Project = rowObject }).Project; DialogResult = DialogResult.OK; }
public ActionResult CreateProjectInform(string projectCode = "") { // Security needed if (projectCode != string.Empty) { var request = new ProjectRequest() { ProjectCode = projectCode }; var response = new ProjectFactory().GetProjectByCode(request); if(response.Project != null) { var model = new ProjectInformModel(); model.Project = response.Project; model.DateCreated = DateTime.Now; model.DateModified = DateTime.Now; model.InspectorName = SessionManager.FullName; return View(model); } } return View(); }
private void SaveProject() { var request = new ProjectRequest(); _project.Tasks = GetTask(); request.Project = _project; var id = new ProjectFactory().SaveProject(request).ProjectId; _project = new ProjectFactory().GetProject( new ProjectRequest { ProjectId = id}).Project; }
public JsonResult GetActiveProjects() { var jsonData = new ProjectFactory().GetActiveProjects(); return Json(jsonData, JsonRequestBehavior.AllowGet); }
private void CopyProject() { var request = new ProjectRequest(); _project.Tasks = GetTask(); request.Project = _project; var newProject = new ProjectFactory().CopyProject(request).Project; newProject.Name = @"Copia de " + newProject.Name; var projectManager = new ProjectManager { MdiParent = ParentForm}; projectManager.Show(); projectManager.LoadProject(newProject); }