public int GetWaitingforYouCount(string status) { List <TicketsEntity> list = null; GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); string keyWord = string.Empty; TicketsSearchConditionDTO dto = new TicketsSearchConditionDTO(); if (UserInfo.Role == RolesEnum.CLIENT) { dto.Company = UserInfo.CompanyID.ToString(); dto.Client = UserInfo.UserID.ToString(); } else if (UserInfo.Role == RolesEnum.ADMIN || UserInfo.Role == RolesEnum.PM) { dto.Company = ""; } dto.Project = GetOwnProjectID(); dto.OrderExpression = "ModifiedOn"; dto.OrderDirection = "desc"; dto.Client = UserInfo.UserID.ToString(); dto.IsInternal = false; dto.Status = status; dto.TicketType = string.Empty; request.TicketSc = dto; list = ticketAPP.GetTicketListBySearchConditionWithStatusWaitingProcess(request, out recordCount, 1, 0); return(recordCount); }
private void TicketsDataBind() { List <TicketsEntity> list = null; GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); int pageCount = 0; list = ticketAPP.GetOngoingTicketsList(UserInfo.ID, int.Parse(dto.Project), int.Parse(dto.Company), dto.Status.ToEnum <ClientTicketState>(), dto.TicketType.ToEnum <TicketsType>(), dto.KeyWord, false, CurrentPageIndex, anpOngoing.PageSize, dto.OrderExpression, dto.OrderDirection, out pageCount); if (pageCount > 0) { this.trNoTickets.Visible = false; this.rptTicketsList.Visible = true; rptTicketsList.DataSource = list; this.rptTicketsList.DataBind(); anpOngoing.RecordCount = pageCount; } else { this.trNoTickets.Visible = true; this.rptTicketsList.Visible = false; } }
private void TicketsDataBind() { string keyWord = this.txtKeyWord.Text.Trim(); int wid = QS("wid", 0); //GetProjectIdAndUserIDResponse response = ticketApp.GetProjectIdAndUserID(wid); //if (!CheckSecurity(response.CreateUserId) || keyWord.Length == 0) return; #region set value GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); dto = new TicketsSearchConditionDTO(); dto.OrderExpression = "CreatedOn"; dto.OrderDirection = "asc"; dto.KeyWord = keyWord; dto.Status = CanShowStatus(); dto.IsInternal = true;//true here, for unlimited dto.IsFeedBack = false; dto.FeedBackTicketsList = ""; int pid = QS("pid", 0); if (pid > 0) { dto.Project = pid.ToString(); } request.TicketSc = dto; #endregion List <string> ListNeedRemove = wrApp.GetAllRelationStringByWorkRequest(wid); list = ticketApp.GetTicketListBySearchCondition(request, out recordCount, page, anpUsers.PageSize); if (null != list && list.Count > 0) { trNoTickets.Visible = false; } foreach (string item in ListNeedRemove) { if (item.Length > 0) { int id = Convert.ToInt32(item); list.RemoveAll(x => x.TicketID == id); } } //int pid = QS("pid", 0); //if (pid > 0) // list = list.FindAll(x => x.ProjectID == pid); this.rptRelationTicketsList.DataSource = list; this.rptRelationTicketsList.DataBind(); anpUsers.RecordCount = recordCount; }
public void TicketsDataBind() { string keyWord = this.txtKeyWord.Text.Trim(); int tid = QS("tid", 0); GetProjectIdAndUserIDResponse response = ticketApp.GetProjectIdAndUserID(tid); if (!CheckSecurity(response.CreateUserId) || keyWord.Length == 0) { return; } #region set value GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); dto = new TicketsSearchConditionDTO(); dto.OrderExpression = hidOrderBy.Value; dto.OrderDirection = hidOrderDirection.Value; dto.KeyWord = keyWord; dto.Status = CanShowStatus(); dto.Project = response.ProjectId.ToString(); dto.IsInternal = true;//true here, for unlimited dto.IsFeedBack = false; dto.FeedBackTicketsList = ""; request.TicketSc = dto; #endregion string ListNeedRemove = trApp.GetAllRelationStringById(tid, true) + " " + tid; list = ticketApp.GetTicketListBySearchCondition(request, out recordCount, page, anpUsers.PageSize); if (null != list && list.Count > 0) { trNoTickets.Visible = false; } foreach (string item in ListNeedRemove.Split(' ')) { if (item.Length > 0) { int id = Convert.ToInt32(item); list.RemoveAll(x => x.TicketID == id); } } this.rptRelationTicketsList.DataSource = list; this.rptRelationTicketsList.DataBind(); anpUsers.RecordCount = recordCount; }
private void TicketsDataBind() { List <TicketsEntity> list = null; GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); TicketsApplication ticketAPP = new TicketsApplication(); TicketsSearchConditionDTO DTO = new TicketsSearchConditionDTO(); DTO.KeyWord = ""; DTO.Status = Convert.ToString((int)TicketsState.Draft); DTO.TicketType = ""; DTO.Project = ""; DTO.AssignedUser = ""; DTO.Company = ""; DTO.Client = ""; DTO.ClientPriority = ""; // DTO.PriorityView = true; request.TicketSc = DTO; //list = ticketAPP.GetTicketListBySearchCondition(request); //this.rptTicketsList.DataSource = list; //this.rptTicketsList.DataBind(); }
private void TicketsDataBind() { List <TicketsEntity> list = null; GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); #region set search condition value TicketsSearchConditionDTO DTO = new TicketsSearchConditionDTO(); string keyWord = this.txtKeyWord.Text.Trim(); string state = string.IsNullOrEmpty(ValidateDDLIsFirstIndexReturnEmpty(ddlStatus, true)) ? AllowStatus() : ValidateDDLIsFirstIndexReturnEmpty(ddlStatus, true); DTO.KeyWord = ReturnTicketId(keyWord).Trim().NoHTML(); DTO.Status = state; DTO.IsFeedBack = false; DTO.FeedBackTicketsList = ""; DTO.TicketType = ddlTicketType.SelectedValue; DTO.AssignedUser = UserInfo.ID.ToString(); //ValidateDDLIsFirstIndexReturnEmpty(ddlAssUser, true); DTO.Client = ""; DTO.ClientPriority = ValidateDDLIsFirstIndexReturnEmpty(ddlClientPriority, true); DTO.Company = ValidateDDLIsFirstIndexReturnEmpty(ddlCompany, true); DTO.OrderExpression = hidOrderBy.Value; DTO.OrderDirection = hidOrderDirection.Value; DTO.IsInternal = true;//true here, for unlimited if (pid.Length > 0) { DTO.Project = pid; ListItem li = ddlProject.Items.FindByValue(pid); if (li != null) { li.Selected = true; } } else if (this.ddlProject.SelectedIndex <= 0) { if (GetAllowPid().Length > 0) { DTO.Project = GetAllowPid(); } else { return; } } else { DTO.Project = ValidateDDLIsFirstIndexReturnEmpty(ddlProject, true); } request.TicketSc = DTO; #endregion int pm = 0; if (ddlStatus.SelectedValue != "") { if (int.Parse(ddlStatus.SelectedValue) == (int)TicketsState.Wait_PM_Feedback) { pm = UserInfo.UserID; } } list = ticketAPP.GetTicketListBySearchCondition(request, pm, out recordCount, page, anpUsers.PageSize); if (null == list || list.Count <= 0) { this.trNoTickets.Visible = true; } else { this.trNoTickets.Visible = false; } this.rptTicketsList.DataSource = list; this.rptTicketsList.DataBind(); anpUsers.RecordCount = recordCount; }
private void TicketsDataBind(string projectID) { List <TicketsEntity> list = null; GetTicketsListByConditionRequest request = new GetTicketsListByConditionRequest(); string keyWord = this.txtKeyWord.Text.Trim(); #region set search condition value dto = new TicketsSearchConditionDTO(); dto.OrderExpression = hidOrderBy.Value; dto.OrderDirection = hidOrderDirection.Value; dto.KeyWord = ReturnTicketId(keyWord).NoHTML(); dto.Status = ((int)TicketsState.Completed).ToString(); dto.IsInternal = false; if (UserInfo.Role == RolesEnum.ADMIN || UserInfo.Role == RolesEnum.PM) { dto.Company = "0"; } else { dto.Company = UserInfo.CompanyID.ToString(); dto.Client = UserInfo.UserID.ToString(); } if (!string.IsNullOrEmpty(projectID)) { dto.Project = projectID; } else { if (this.ddlProject.SelectedIndex <= 0) { dto.Project = "0"; } else { dto.Project = this.ddlProject.SelectedValue.ToString(); } } TicketsType ticketType = TicketsType.None; ticketType = (TicketsType)int.Parse(ddlTicketType.SelectedValue); #endregion int pageCount = ticketAPP.GetCompletedTicketsCount(UserInfo.ID, int.Parse(dto.Project), int.Parse(dto.Company), ticketType, dto.KeyWord); if (pageCount > 0) { list = ticketAPP.GetCompletedTicketsList(UserInfo.ID, int.Parse(dto.Project), int.Parse(dto.Company), ticketType , dto.KeyWord, anpUsers.CurrentPageIndex, anpUsers.PageSize, dto.OrderExpression, dto.OrderDirection); this.trNoTickets.Visible = false; } else { this.trNoTickets.Visible = true; } rptTicketsList.DataSource = list; this.rptTicketsList.DataBind(); anpUsers.RecordCount = pageCount; }