コード例 #1
0
ファイル: ProjectDetail.aspx.cs プロジェクト: blfsir/benzoa
        /// <summary>
        /// ��ʾ����
        /// </summary>
        private void PopulateData()
        {
            #region ��ʼ������
            DataTable dataTable      = new DataTable();
            SqlDataReader dataReader = null;
            ProjectClass pjt		 = new ProjectClass ();
            MailClass mail			 = new MailClass();
            DocumentClass doc		 = new DocumentClass();
            #endregion
                #region ��ȡ��Ŀ��Ϣ
                dataReader = pjt.GetClassInfo(classID);
                try
                {
                    if (dataReader.Read())
                    {
                        this.lblClassName.Text = dataReader[0].ToString();
                        this.lblParentClassName.Text = dataReader[2].ToString();
                        this.lblBuildDate.Text = dataReader[3].ToString();
                        this.lblEndDate.Text = dataReader[4].ToString();
                        this.lblFinishedScale.Text = dataReader[8].ToString();
                        this.lblDescription.Text = dataReader[7].ToString();

                    }
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ��ȡ����Ŀ��Ϣ
                dataReader = pjt.GetSubClassInfo(classID);
                try
                {
                    while (dataReader.Read())
                    {
                        this.lblSubClass.Text += "<a href='Switch.aspx?Action=1&ClassID=" + dataReader[0].ToString() + "'>" + dataReader[1].ToString() + "</a>&nbsp;&nbsp;";
                    }
                    if (this.lblSubClass.Text == "") this.lblSubClass.Text = "��";
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ��ȡ��Ŀ��Ա��Ϣ
                dataReader = pjt.GetMemberInClass(classID);
                try
                {
                    while (dataReader.Read())
                    {
                        this.lblMember.Text += "<a href='Mail/Compose.aspx?Action=3"
                        + "&ClassID=" + classID.ToString()
                        + "&Username="******"Staff_Name"].ToString()
                        + "&Name=" + Server.UrlEncode(dataReader["RealName"].ToString())
                        + "'>"
                        + dataReader["RealName"].ToString()
                        + "</a> &nbsp;&nbsp;";
                    }
                    if (this.lblMember.Text == "") this.lblMember.Text = "��";
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ��ȡ��Ŀ�ϼ���������Ϣ
                dataReader = pjt.GetParentLeader(classID);
                try
                {
                    if (dataReader.Read())
                    {
                        this.lblParentLeader.Text += "<a href='Mail/Compose.aspx?Action=3"
                            + "&ClassID=" + classID.ToString()
                            + "&Username="******"Staff_Name"].ToString()
                            + "&Name=" + Server.UrlEncode(dataReader["RealName"].ToString())
                            + "'>"
                            + dataReader["RealName"].ToString()
                            + "</a> &nbsp;&nbsp;";
                    }
                    if (this.lblParentLeader.Text == "") this.lblParentLeader.Text = "��";
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ��ȡ��Ŀ��������Ϣ
                dataReader = pjt.GetLeader(classID);
                try
                {
                    while (dataReader.Read())
                    {
                        this.lblLeader.Text += "<a href='Mail/Compose.aspx?Action=3"
                            + "&ClassID=" + classID.ToString()
                            + "&Username="******"Staff_Name"].ToString()
                            + "&Name=" + Server.UrlEncode(dataReader["RealName"].ToString())
                            + "'>"
                            + dataReader["RealName"].ToString()
                            + "</a> &nbsp;&nbsp;";
                    }
                    if (this.lblLeader.Text == "") this.lblLeader.Text = "��";
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                //dataReader = null;

            finally
            {
                dataReader.Close();
            }
                #endregion
        }
コード例 #2
0
ファイル: Project.aspx.cs プロジェクト: blfsir/benzoa
        /// <summary>
        /// ��ʾ����
        /// </summary>
        private void PopulateData()
        {
            #region ��ʼ������
            SqlDataReader dataReader = null;
            //try
            //{
                DataTable dataTable = new DataTable();

                ProjectClass pjt = new ProjectClass();
                MailClass mail = new MailClass();
                DocumentClass doc = new DocumentClass();
            #endregion

                #region ��ȡ��Ŀ��Ϣ
                dataReader = pjt.GetClassInfo(classID);
                try
                {
                    if (dataReader.Read())
                    {
                        this.lblClassName.Text = dataReader[0].ToString();
                        //			this.lblParentClassName.Text = dataReader[2].ToString();
                        //			this.lblBuildDate.Text	     = dataReader[3].ToString();
                        //			this.lblEndDate.Text		 = dataReader[4].ToString();
                        //			this.lblFinishedScale.Text   = dataReader[8].ToString();
                        //			this.lblDescription.Text	 = dataReader[7].ToString();

                    }
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ��ȡ��Ŀ��Ա��Ϣ
                dataReader = pjt.GetMemberInClass(classID);
                int i = 0;
                try
                {
                    while (dataReader.Read())
                    {
                        if (i < 3)
                            this.lblMember.Text += "<a href='Mail/Compose.aspx?Action=3"
                                + "&ClassID=" + classID.ToString()
                                + "&Username="******"Staff_Name"].ToString()
                                + "&Name=" + Server.UrlEncode(dataReader["RealName"].ToString())
                                + "'>"
                                + dataReader["RealName"].ToString()
                                + "</a> &nbsp;&nbsp;";
                        i++;
                    }
                    if (i >= 3) this.lblMember.Text += "..";
                    if (this.lblMember.Text == "") this.lblMember.Text = "";
                }
                catch (Exception ex)
                {
                    UDS.Components.Error.Log(ex.ToString());
                    Server.Transfer("../Error.aspx");
                }
                dataReader = null;
                #endregion

                #region ����Ȩ����ʾ��ع��ܱ���
                // ����ȱʡֵ
                int cstRightToApproveDocument = 2;
                int cstRightToViewDocument = 10;
                int cstRightToBuildNode = 5;
                int cstDisplayMember = 6;
                int cstTeamRight = 7;
                int cstComposeMail = 11;
                int cstDeliveryDoc = 11;
                int cstProjectMove = 12;
                this.lblManageProject.Visible = pjt.GetAccessPermission(classID, Username, cstRightToBuildNode);
              //          this.imgManageProject.Visible = this.lblManageProject.Visible;
                this.lblManageDirectory.Visible = pjt.GetAccessPermission(classID, Username, cstRightToBuildNode);
            //            this.imgManageDirectory.Visible = this.lblManageDirectory.Visible;
                this.lblComposeMail.Visible = pjt.GetAccessPermission(classID, Username, cstComposeMail);
            //        this.imgComposeMail.Visible = this.lblComposeMail.Visible;
                this.lblDeliveryDoc.Visible = pjt.GetAccessPermission(classID, Username, cstDeliveryDoc);
              //              this.imgDeliveryDoc.Visible = this.lblDeliveryDoc.Visible;
                this.lblShowMember.Visible = pjt.GetAccessPermission(classID, Username, cstDisplayMember);
            //                this.imgShowMember.Visible = this.lblShowMember.Visible;
                this.lblManagePermission.Visible = pjt.GetAccessPermission(classID, Username, cstTeamRight);
              //      this.imgManagePermission.Visible = this.lblManagePermission.Visible;
                this.lblRemove.Visible = pjt.GetAccessPermission(classID, Username, cstProjectMove);
            //    this.imgRemove.Visible = this.lblRemove.Visible;

                //			this.tr1.Visible				  = pjt.GetAccessPermission(classID,Username,cstRightToViewDocument);
                //			this.tr3.Visible 				  = pjt.GetAccessPermission(classID,Username,cstRightToApproveDocument);

                this.line1.Visible = pjt.GetAccessPermission(classID, Username, cstRightToViewDocument);
                //this.IMG1.Visible = this.line1.Visible;
                this.dgDocList.Visible = this.line1.Visible;
              //  this.imgSubscribe.Visible = this.line1.Visible;
                this.lblSubscribe.Visible = this.line1.Visible;
                this.line2.Visible = pjt.GetAccessPermission(classID, Username, cstRightToApproveDocument);
                //this.IMG3.Visible = this.line2.Visible;
                this.dgAppDocList.Visible = this.line2.Visible;

                #endregion

                #region ����Ȩ��ȡ���ʼ�����
                /// <summary>
                /// ��ij�û���ȡ���ʼ�����
                /// </summary>

                dataTable = mail.GetClassMails(classID, Server.UrlDecode(Request.Cookies["UserName"].Value));
                dgMailList.DataSource = dataTable.DefaultView;
                dgMailList.DataBind();

                mail = null;

                #endregion

                #region ����Ȩ��ȡ���ĵ�����
                /// <summary>
                /// ��ij�û����ĵ�����ȡ��
                /// </summary>
                if (pjt.GetAccessPermission(classID, Username, cstRightToViewDocument) || bSubscription)
                {
                    dataTable = doc.GetClassDocs(classID);
                    dgDocList.DataSource = dataTable.DefaultView;
                    dgDocList.DataBind();
                    dataTable = null;
                }
                else
                {
                    //				IMG1.Visible	  = false;
                    //				IMG4.Visible      = false;
                    dgDocList.Visible = false;
                }
                #endregion

                #region ����Ȩ��ȡ��ij��Ŀ�������ĵ�����
                /// <summary>
                /// ��ij��Ŀ�������ĵ�����ȡ��
                /// </summary>
                if (pjt.GetAccessPermission(classID, Username, cstRightToApproveDocument))
                {
                    dataTable = doc.GetApproveClassDocs(classID);
                    dgAppDocList.DataSource = dataTable.DefaultView;
                    dgAppDocList.DataBind();
                    dataTable = null;
                    doc = null;
                }
                else
                {
                    //IMG3.Visible = false;
                    dgAppDocList.Visible = false;
                    lblApp.Visible = false;
                }
                #endregion

            //}
            //finally
            //{ dataReader.Close(); }
        }
コード例 #3
0
ファイル: MemberListView.aspx.cs プロジェクト: blfsir/benzoa
        private void sms_all(int ii)
        {
            string sql			  = "";//����ѡ��ij�ԱID����
            bool sqlFlag		  = true;
            foreach(DataGridItem dgi in this.dgMemberList.Items)
            {
                CheckBox cb=(CheckBox)(dgi.Cells[0].Controls[1]);
                if (cb.Checked==true)
                {
                    int i		= dgi.ItemIndex;
                    string id	= dgMemberList.DataKeys[i].ToString();
                    if (sqlFlag)
                    {
                        sql+=""+id;
                        sqlFlag=false;
                    }
                    else
                    {
                        sql+=" ,";
                        sql+=id;
                    }
                }
            }

            SqlDataReader dr_this;//��ѡ����Ա
            UDS.Components.Staff sta=new UDS.Components.Staff();
            dr_this=sta.GetStaffInfo(sql);

            SqlDataReader dr_allTeam;//������Ա
            Team steam=new Team();
            dr_allTeam=steam.GetStaffInTeam(Convert.ToInt32(ClassID));

            SqlDataReader dr_allTeamMaster;//�����鳤
            ProjectClass prj=new ProjectClass();
            dr_allTeamMaster=prj.GetLeader(Convert.ToInt32(ClassID));

            SqlDataReader dataReader;//��Ŀ��Ϣ
            dataReader = prj.GetClassInfo(Convert.ToInt32(ClassID));
            string Team_name="";//��Ŀ����
            try
            {
                if (dataReader.Read())
                {
                    Team_name = dataReader[0].ToString() + ",";
                }
                dataReader.Close();
                dataReader = null;

                string Staff_name = "";//��ѡ����Ա����
                while (dr_this.Read())
                {
                    Staff_name += dr_this["RealName"].ToString() + ",";
                }
                dr_this.Close();
                dr_this = null;

                string name_teamMaster = "";//�����鳤������
                while (dr_allTeamMaster.Read())
                {
                    name_teamMaster += dr_allTeamMaster["RealName"].ToString() + ",";
                }
                dr_allTeamMaster.Close();
                dr_allTeamMaster = null;

                SMS sm = new SMS();
                //�����������
                while (dr_allTeam.Read())//iΪ0��ʾ������,iΪ1��ʾ������,iΪ2��ʾ��Ϊ�鳤
                {
                    if (ii == 0)
                        sm.SendMsg(Username, dr_allTeam["Staff_name"].ToString(), Team_name + " ��Ŀ��Ա��:" + Staff_name + "�Ѿ����뱾��Ŀ,�ش�֪ͨ.", 1, DateTime.Now, "", 0, 0);
                    else if (ii == 1)
                        sm.SendMsg(Username, dr_allTeam["Staff_name"].ToString(), "Ա��:" + Staff_name + "�Ѿ�������Ŀ:" + Team_name + ",�ش�֪ͨ.", 1, DateTime.Now, "", 0, 0);
                    else if (ii == 2)
                        sm.SendMsg(Username, dr_allTeam["Staff_name"].ToString(), Team_name + " ��Ŀ��Ա��:" + Staff_name + "�Ѿ����" + name_teamMaster + ",��Ϊ��Ŀ�鳤,�ش�֪ͨ.", 1, DateTime.Now, "", 0, 0);
                }
                sm = null;
                dr_allTeam.Close();
                dr_allTeam = null;
            }
            finally
            {
                dr_allTeam.Close();
                dr_allTeamMaster.Close();
                dr_this.Close();
                dataReader.Close();
            }
        }