Ejemplo n.º 1
0
        public void ProcessRequest(HttpContext context)
        {
            HttpResponse response  = context.Response;
            HttpRequest  request   = context.Request;
            int          projectID = QS(request.QueryString["projectID"], 0);

            if (projectID != 0)
            {
                ProposalTrackerApplication wrApp = new ProposalTrackerApplication();

                List <ProposalTrackerEntity> proposalTracker = wrApp.GetProposalTrackerByPid(projectID);

                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.Append("[");
                foreach (ProposalTrackerEntity Proposal in proposalTracker)
                {
                    stringBuilder.Append("{");
                    stringBuilder.AppendFormat("\"name\":\"{0}\",\"value\":\"{1}\"", Proposal.Title,
                                               Proposal.ProposalTrackerID);
                    stringBuilder.Append("},");
                }
                response.Write(stringBuilder.ToString().TrimEnd(',') + "]");
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (ticketID > 0)
                {
                    ticketsEntity = ticketApp.GetTickets(ticketID);

                    //创建者
                    TicketUsersEntity ticketUser = ticketApp.GetTicketCreateUser(ticketID);
                    UsersEntity       createUser = userApp.GetUser(ticketUser.UserID);
                    if (createUser.Role == RolesEnum.CLIENT)
                    {
                        HiddenField_TicketCreateId.Value = "-1";
                    }
                    else
                    {
                        HiddenField_TicketCreateId.Value = ticketUser.UserID.ToString();;
                    }


                    ProposalTrackerRelationEntity model = wrApp.GetProposalTrackerByTid(ticketID);
                    if (model != null && model.ID != 0)
                    {
                        ddl_Proposal.SelectedValue = model.WID.ToString();
                    }
                    ddlResponsibleUser.Items.Add(new ListItem("System", "-1"));
                }
                if (projectID > 0)
                {
                    ProposalTrackerApplication wrApp = new ProposalTrackerApplication();

                    List <ProposalTrackerEntity> proposalTracker = wrApp.GetProposalTrackerByPid(projectID);
                    ddl_Proposal.DataSource     = proposalTracker;
                    ddl_Proposal.DataValueField = "ProposalTrackerID";
                    ddl_Proposal.DataTextField  = "Title";
                    ddl_Proposal.DataBind();
                    ddl_Proposal.Items.Insert(0, new ListItem("Please select... ", ""));
                }
            }
            if (ticketsEntity != null)
            {
                if (!IsPostBack)
                {
                    if (ticketsEntity.Status >= TicketsState.PM_Reviewed &&
                        ticketsEntity.Status <= TicketsState.Estimation_Approved && ticketsEntity.TicketType == TicketsType.Bug)
                    {
                        dvChangeRequest.Style.Add("display", "block");
                    }
                    else
                    {
                        dvChangeRequest.Style.Add("display", "none");
                    }
                    litHead.Text = string.Format("Ticket ID: {0}, {1}&nbsp;&nbsp; ; &nbsp;&nbsp;Status: {2}"
                                                 , ticketsEntity.TicketID, ticketsEntity.Title, ticketsEntity.Status.ToText());
                    TicketUsersEntity ticketUsersEntity = ticketApp.GetTicketCreateUser(ticketsEntity.TicketID);
                    SetEstimation(ticketUsersEntity);
                    SetEditClient(ticketUsersEntity);
                    BindStatus();

                    txtProprosalName.Text = ticketsEntity.ProprosalName;
                    txtWorkPlanName.Text  = ticketsEntity.WorkPlanName;
                    txtWorkScope.Text     = ticketsEntity.WorkScope;
                    txtInvoice.Text       = ticketsEntity.Invoice;
                }
            }
            else
            {
                ShowFailMessageToClient();
            }
        }