Exemple #1
0
        /// <summary>
        /// ���޸�ʱ����
        /// </summary>
        private void PopulateReviseData()
        {
            SqlDataReader dataReader = null;
            ProjectClass prj = new ProjectClass();
            try
            {
                dataReader = prj.GetProjectDetail(Int32.Parse(ClassID));
                dataReader.Read();
                this.txtClassName.Value = dataReader[0].ToString();
                this.txtBrief.Value     = dataReader[7].ToString();
                this.txtScale .Value    = dataReader[6].ToString();
                this.txtStartDate.Text = dataReader.IsDBNull(3) ? "" : DateTime.Parse(dataReader[3].ToString()).ToString("yyyy-MM-dd");
                this.txtEndDate.Text = dataReader.IsDBNull(4) ? "" : DateTime.Parse(dataReader[4].ToString()).ToString("yyyy-MM-dd");
                this.Status.SelectedIndex = Int32.Parse(dataReader[5].ToString());
                prj = null;
                dataReader = null;
            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.ToString());
                Server.Transfer("../Error.aspx");

            }
        }
Exemple #2
0
        private void PopulateData(TaskClass tsk)
        {
            string ClassName = "",Type="";

            switch (tsk.Type) {
            case 1:
                Type="����";
                break;
            case 2:
                Type="��";
                break;
            case 3:
                Type="����";
                break;
            case 4:
                Type="�绰";
                break;
            case 5:
                Type="�߷�";
                break;
            case 6:
                Type="���";
                break;
            case 7:
                Type="����";
                break;
            case 8:
                Type="����";
                break;

            }

            this.lblSubject .Text		= tsk.Subject ;
            this.lblDetail .Text		= tsk.Detail ;
            this.lblStartTime .Text		= (DateTime.Parse(tsk.StartTime).ToShortTimeString()=="0:00")?DateTime.Parse(tsk.StartTime).ToShortDateString()+" 8:00":tsk.StartTime;
            this.lblEndTime .Text		= (DateTime.Parse(tsk.EndTime).ToShortTimeString()=="0:00")?DateTime.Parse(tsk.EndTime).ToShortDateString()+" 18:00":tsk.EndTime;
            this.lblArrangedBy .Text	= UDS.Components .Staff.GetRealNameByUsername(tsk.ArrangedBy) ;
            this.lblCooperator .Text    = UDS.Components .Staff.GetRealNameStrByUsernameStr(tsk.CooperatorList,0) ;

            this.lblType.Text			= Type;
            this.lblAttribute.Text		= tsk.Attribute.ToString()=="1"?"��ռ����":"��ʱ����";
            if(tsk.ProjectID!=0)
            {
                ProjectClass prj = new ProjectClass();
                SqlDataReader dataReader =  prj.GetProjectDetail(tsk.ProjectID);
                try
                {
                    if (dataReader.Read())
                        ClassName = dataReader["ClassName"].ToString();
                }
                finally
                {
                    dataReader.Close();
                }
                prj = null;
            }
            this.lblProjectID .Text = (tsk.ProjectID ==0)?"��":"<a href='#' onclick=javascript:window.close();window.dialogArguments.location='../UnitiveDocument/Project.aspx?classID="+tsk.ProjectID .ToString()+"'>"+ClassName+"</a>";
        }