private void InitProject() { ProjectApplication projApp = new ProjectApplication(); List <ProjectDetailDTO> list = projApp.GetUserProjects(UserInfo); if (!string.IsNullOrEmpty(WorkRequestID)) { WorkRequestEntity workRequestEntity = wqApp.Get(int.Parse(WorkRequestID)); ProjectsEntity projectsEntity = projApp.Get(workRequestEntity.ProjectID); if (!projApp.IsProjectHasPM(projectsEntity.ProjectID, UserInfo.UserID)) { list.Add(new ProjectDetailDTO() { Title = projectsEntity.Title, ID = projectsEntity.ProjectID }); } } if (list.Count > 1 || list.Count == 0) { list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "Please select...", "0"); } else if (list.Count == 1) { list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { int wid = QS("id", 0); if (wid <= 0) { this.ShowArgumentErrorMessageToClient(); return; } else { AddWorkRequest1.WorkRequestID = wid.ToString(); RelationTicketsList1.WorkRequestID = wid.ToString(); WorkRequestEntity entity = wrApp.Get(wid); if (entity != null) { AddWorkRequest1.wrEntity = entity; RelationTicketsList1.ProjectID = entity.ProjectID.ToString(); AddWorkRequest1.IsAdd = false; } else { this.ShowArgumentErrorMessageToClient(); return; } RelationTicketsList1.ProjectID = entity.ProjectID.ToString(); BindDocuments(wid); BindNotes(wid); } } }