Ejemplo n.º 1
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if(!Page.IsPostBack)
            {

                HttpCookie UserCookie = Request.Cookies["Username"];
                string Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
                string TaskID		  = (Request.QueryString["TaskID"]!=null)?Request.QueryString["TaskID"].ToString():"0";
                string Action		  = (Request.QueryString["Action"]!=null)?Request.QueryString["Action"].ToString():"0";
                string CID			  = (Request.QueryString["CID"]!=null)?Request.QueryString["CID"].ToString():"0";
                bool delflag = false;
                Task tsk = new Task();
                if(Action=="1")
                {
                    try
                    {
                        tsk.DeleteTaskComment(Int32.Parse(CID));
                        Response.Redirect("TaskComment.aspx?TaskID="+TaskID);

                    }
                    catch(Exception ex)
                    {
                        UDS.Components.Error .Log(ex.ToString());
                        Server.Transfer("../Error.aspx");
                    }

                }

                TaskClass tc = tsk.GetTaskDetail(Int32.Parse(TaskID));
                if(tc.ArrangedBy == Username) delflag=true;
                SqlDataReader dataReader = null;
                dataReader = tsk.GetTaskComment(Int32.Parse(TaskID));
                this.lt.Text = "<table class=gbtext style='BORDER-COLLAPSE: collapse'>";
                try
                {
                    while (dataReader.Read())
                    {
                        this.lt.Text += "<tr><td>" + dataReader["Comment"].ToString() + "<br>------------<br><font color=red>" + UDS.Components.Staff.GetRealNameByUsername(dataReader["Username"].ToString()) + "  ";
                        this.lt.Text += (delflag) ? "<a href='TaskComment.aspx?Action=1&TaskID=" + TaskID + "&CID=" + dataReader["ID"].ToString() + "'>ɾ��</a>" : "";
                        this.lt.Text += "  </font><br><bR>";
                        this.lt.Text += "</td></tr>";
                    }
                    this.lt.Text += "</table>";
                }
                finally
                {
                    dataReader.Close();
                }

            }
        }
Ejemplo n.º 2
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     if(!Page.IsPostBack)
     {
         HttpCookie UserCookie = Request.Cookies["Username"];
         SqlDataReader dataReader = null;
         Username	  = UserCookie.Value.ToString();
         TaskID		  = (Request.QueryString["TaskID"]!=null)?Request.QueryString["TaskID"].ToString():"0";
         Date		  = (Request.QueryString["Date"]!=null)?Request.QueryString["Date"].ToString():DateTime.Today.ToShortDateString();
         Task task	  = new Task();
         TaskClass tsk = task.GetTaskDetail(Int32.Parse(TaskID));
         dataReader	  = task.GetTaskStatus(Int32.Parse(TaskID));
         this.dgList.DataSource = dataReader;
         this.dgList.DataBind();
         dataReader.Close();
         PopulateData(tsk);
         tsk = null;
         task = null;
         TaskCommentFrm.Attributes["src"] = "TaskComment.aspx?TaskID="+TaskID;
     }
 }
Ejemplo n.º 3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            Task task	  = new Task();
            if(!Page.IsPostBack)
            {
                HttpCookie UserCookie = Request.Cookies["Username"];
                Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
                TaskID		  = (Request.QueryString["TaskID"]!=null)?Request.QueryString["TaskID"].ToString():"0";
                Date		  = (Request.QueryString["Date"]!=null)?Request.QueryString["Date"].ToString():DateTime.Today.ToShortDateString();

                TaskClass tsk = task.GetTaskDetail(Int32.Parse(TaskID));
                if(tsk.ArrangedBy==Username)
                {
                    this.btnDelete .Visible = true;
                    this.btnFinish .Visible = true;
                    this.btnCancel.Visible = false;
                    this.btnAccept.Visible = false;
                }

                PopulateData(tsk);
                tsk = null;

                TaskCommentFrm.Attributes["src"] = "TaskComment.aspx?TaskID="+TaskID;
                this.btnFinish .Attributes["onclick"] = "javascript:return confirm('��ȷ����?')";
                this.btnDelete.Attributes["onclick"] = "javascript:return confirm('��ȷ��Ҫɾ����������?')";
            }

            SetStatus();
            int status = task.GetTaskStatusBySomeone(Int32.Parse(TaskID),Username);
            if(status==2)
            {
                this.btnAccept.Enabled = false;
                this.btnCancel .Enabled = false;
                this.btnFinish .Enabled = false;
            }
        }