示例#1
0
 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;
 }
示例#2
0
 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();
 }
示例#3
0
        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;
        }
示例#4
0
 public JsonResult GetActiveProjects()
 {
     var jsonData = new ProjectFactory().GetActiveProjects();
     return Json(jsonData, JsonRequestBehavior.AllowGet);
 }
示例#5
0
        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);
        }