Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            if (IdentityContext.UserID <= 0)
            {
                return;
            }

            UsersEntity user = new App.UserApplication().GetUser(IdentityContext.UserID);

            if (user == null || (user.Role != RolesEnum.PM && user.Role != RolesEnum.Sales && user.Role != RolesEnum.ADMIN))
            {
                return;
            }

            ProposalTrackerApplication app = new ProposalTrackerApplication();

            context.Response.ContentType = "text/plain";
            string tkId = context.Request["ticketId"] + "";
            string wrId = context.Request["wrId"] + "";

            int ticketId;

            if (!int.TryParse(tkId, out ticketId))
            {
                return;
            }
            int proposaltrackerId;

            if (!int.TryParse(wrId, out proposaltrackerId))
            {
                return;
            }

            app.DeleteRelation(proposaltrackerId, ticketId);
        }
Esempio n. 2
0
 public PaymentCheck()
 {
     BootStrap.Config();
     paymentManagerEmail = ConfigurationManager.AppSettings["PaymentManagerEmail"];
     teamEmail           = ConfigurationManager.AppSettings["TeamEmail"];
     proposalTrackerApp  = new ProposalTrackerApplication();
     projectApp          = new ProjectApplication();
     _invoicesApp        = new InvoicesApplication();
 }
Esempio n. 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            wrApp = new ProposalTrackerApplication();
            if (!IsPostBack)
            {
                InitProject();
                ddlProject.SelectedValue = QS("project", 0).ToString();
                ddlStatus.SelectedValue  = QS("status", 0).ToString();
                ddlCompany.SelectedValue = QS("companyId", 0).ToString();
                txtStartDate.Text        = QS("start").Trim();
                txtEndDate.Text          = QS("end").Trim();

                //ddlPayment.SelectedValue = QS("payment", 0).ToString();
                InitControl();
            }
        }
Esempio n. 4
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(',') + "]");
            }
        }
Esempio n. 5
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();
            }
        }