Esempio n. 1
0
 // ����ȱʡֵ
 public void ShowAvailable()
 {
     ProjectClass pjt		 = new ProjectClass ();
     UserCookie	 = Request.Cookies["Username"];
     string Username = UserCookie.Value.ToString();
     int classID				 = Int32.Parse(ClassID);
     int cstRightToApproveDocument 	= 2;
     int cstRightToViewDocument		= 10;
     int cstRightToBuildNode		 	= 5;
     int cstDisplayMember			= 6;
     int cstTeamRight				= 7;
     int cstComposeMail				= 11;
     int cstDeliveryDoc				= 11;
     int cstProjectMove				= 12;
     int cstProjectCopy				= 12;
     int cstDeleteDocument			= 3;
     this.lblManageDirectory.Visible = pjt.GetAccessPermission(classID,Username,cstRightToBuildNode);
     this.lblDeliveryDoc.Visible     = pjt.GetAccessPermission(classID,Username,cstDeliveryDoc);
     this.lblShowMember.Visible      = pjt.GetAccessPermission(classID,Username,cstDisplayMember);
     this.lblManagePermission.Visible= pjt.GetAccessPermission(classID,Username,cstTeamRight);
     this.lnkbtnDelete.Visible       = pjt.GetAccessPermission(classID,Username,cstDeleteDocument);
     this.lblRemove .Visible			= pjt.GetAccessPermission(classID,Username,cstProjectMove);
     this.lblCopy .Visible			= pjt.GetAccessPermission(classID,Username,cstProjectMove);
     pjt								  = null;
 }
Esempio n. 2
0
        /// <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(); }
        }
Esempio n. 3
0
        /// <summary>
        /// ������post����
        /// </summary>
        private DocBody ProcessFormPost()
        {
            ProjectClass pjt  = new ProjectClass ();
            int cstRightToApproveDocument = 2;
            //����֤
            if(Request.IsAuthenticated)
            {

                // ���������ݲ���
                DocBody  docbody			= new DocBody();
                docbody.DocTitle			= this.txtTitle.Value;
                docbody.DocContent			= this.txtContent.Value;
                docbody.DocAddedBy			= Username;
                docbody.DocClassID			= Int32.Parse(ClassID);
                docbody.DocAddedDate        = DateTime.Now.ToString();
                docbody.DocApprover			= (pjt.GetAccessPermission(Int32.Parse(ClassID),Username,cstRightToApproveDocument))?Username:"";
                docbody.DocApproveDate		= (pjt.GetAccessPermission(Int32.Parse(ClassID),Username,cstRightToApproveDocument))?DateTime.Now.ToString():"";
                docbody.DocApproved         = (docbody.DocApprover =="")?0:1;
                docbody.DocAttribute        = 0;
                docbody.DocType				= 0;
                return docbody;
            }
            else
            {
                return null;
            }
        }
Esempio n. 4
0
        /// <summary>
        /// �ĵ��������������ĵ��������������
        /// </summary>
        private void DocProcess(MailMainBody mailbody,ArrayList upattlist)
        {
            string DocID = "";
            int cstRightToApproveDocument = 2;
            ProjectClass pjt = new ProjectClass();
            DocBody docbody = new DocBody();
            docbody.DocTitle			= mailbody.MailSubject;
            docbody.DocContent			= mailbody.MailBody;
            docbody.DocAddedBy			= mailbody.MailSender;
            docbody.DocClassID			= mailbody.MailClassID;
            docbody.DocAddedDate        = DateTime.Now.ToString();
            docbody.DocApprover			= (pjt.GetAccessPermission(Int32.Parse(ClassID),Username,cstRightToApproveDocument))?Username:"";
            docbody.DocApproveDate		= (pjt.GetAccessPermission(Int32.Parse(ClassID),Username,cstRightToApproveDocument))?DateTime.Now.ToString():"";
            docbody.DocApproved         = (docbody.DocApprover =="")?0:1;
            docbody.DocAttribute        = 0;
            docbody.DocType				= 0;

            DocumentClass doc = new DocumentClass();
            // ����ĵ�,������ID

            DocID = doc.AddDocBody(docbody);
            foreach(UDS.Components.MailAttachFile  att in upattlist)
            {
                try
                {
                    DocAttachFile docatt = new DocAttachFile();
                    //  Mail Attach File ��ת��ΪDoc Attach File
                    docatt.FileAttribute  = 0;
                    docatt.FileSize       = att.FileSize;
                    docatt.FileName	      = att.FileName;
                    docatt.FileAuthor     = Username;
                    docatt.FileCatlog     = "�ĵ�";
                    docatt.FileVisualPath = "Mail"+att.FileVisualPath;
                    docatt.FileAddedDate  = DateTime.Now.ToString();
                    docatt.DocID          = Int32.Parse(DocID);
                    // ת������

                    // �������ݿ⴦��
                    doc.AddAttach(docatt,Int32.Parse(DocID));

                }
                catch(Exception ioex)
                {
                    UDS.Components.Error.Log(ioex.ToString());
                    Server.Transfer("../../Error.aspx");
                }
            }
        }
Esempio n. 5
0
        public void MailIncoming(string MailID,string ClassID)
        {
            SqlDataReader dataReader = null;

            if(MailID!=""&&ClassID!="")
            {
                try
                {
                    throw new Exception("�������");

                    String Username = Request.Cookies["Username"].Value.ToString();
                    MailClass mailclass = new MailClass();
                    ProjectClass pjt = new ProjectClass();
                    DocBody docbody = new DocBody();
                    DocumentClass doc = new DocumentClass();

                    dataReader = mailclass.GetMailCompleteInfoDbreader(MailID);
                    if (dataReader.Read())
                    {
                        int cstRightToApproveDocument = 2;

                        docbody.DocTitle = dataReader["MailSubject"].ToString();
                        docbody.DocContent = dataReader["MailBody"].ToString(); ;
                        docbody.DocAddedBy = dataReader["MailSender"].ToString(); ;
                        docbody.DocClassID = Int32.Parse(ClassID);
                        docbody.DocAddedDate = DateTime.Now.ToString();
                        docbody.DocApprover = (pjt.GetAccessPermission(Int32.Parse(ClassID), Username, cstRightToApproveDocument)) ? Username : "";
                        docbody.DocApproveDate = (pjt.GetAccessPermission(Int32.Parse(ClassID), Username, cstRightToApproveDocument)) ? DateTime.Now.ToString() : "";
                        docbody.DocApproved = (docbody.DocApprover == "") ? 0 : 1;
                        docbody.DocAttribute = 0;
                        docbody.DocType = 0;

                    }
                    dataReader.Close();
                    string DocID = doc.AddDocBody(docbody);

                    dataReader = mailclass.GetMailAttInfoDbreader(MailID);
                    while (dataReader.Read())
                    {
                        DocAttachFile docatt = new DocAttachFile();
                        docatt.FileAttribute = 0;
                        docatt.FileSize = Int32.Parse(dataReader["FileSize"].ToString());
                        docatt.FileName = dataReader["FileName"].ToString();
                        docatt.FileAuthor = Username;
                        docatt.FileCatlog = "�ĵ�";
                        docatt.FileVisualPath = "Mail" + dataReader["FileVisualPath"].ToString();
                        docatt.FileAddedDate = DateTime.Now.ToString();
                        docatt.DocID = Int32.Parse(DocID);
                        doc.AddAttach(docatt, Int32.Parse(DocID));
                    }

                    dataReader = null;
                    pjt = null;
                    docbody = null;
                }
                catch (Exception oe)
                {
                    throw new Exception(oe.Message);
                }
                finally
                {
                    if(null != dataReader)
                        if (!dataReader.IsClosed)
                        {
                            dataReader.Close();
                        }
                }
            }
        }
Esempio n. 6
0
        public void MailIncoming(string MailID,string ClassID)
        {
            if(MailID!=""&&ClassID!="")
            {
                SqlDataReader dataReader = null;
                try
                {
                    String Username = Server.UrlDecode(Request.Cookies["UserName"].Value);
                    MailClass mailclass = new MailClass();

                    ProjectClass pjt = new ProjectClass();
                    DocBody docbody = new DocBody();
                    DocumentClass doc = new DocumentClass();

                    dataReader = mailclass.GetMailCompleteInfoDbreader(MailID);
                    if (dataReader.Read())
                    {
                        int cstRightToApproveDocument = 2;

                        docbody.DocTitle = dataReader["MailSubject"].ToString();
                        docbody.DocContent = dataReader["MailBody"].ToString(); ;
                        docbody.DocAddedBy = dataReader["MailSender"].ToString(); ;
                        docbody.DocClassID = Int32.Parse(ClassID);
                        docbody.DocAddedDate = DateTime.Now.ToString();
                        docbody.DocApprover = (pjt.GetAccessPermission(Int32.Parse(ClassID), Username, cstRightToApproveDocument)) ? Username : "";
                        docbody.DocApproveDate = (pjt.GetAccessPermission(Int32.Parse(ClassID), Username, cstRightToApproveDocument)) ? DateTime.Now.ToString() : "";
                        docbody.DocApproved = (docbody.DocApprover == "") ? 0 : 1;
                        docbody.DocAttribute = 0;
                        docbody.DocType = 0;

                    }
                    dataReader.Close();
                    string DocID = doc.AddDocBody(docbody);

                    dataReader = mailclass.GetMailAttInfoDbreader(MailID);
                    while (dataReader.Read())
                    {
                        DocAttachFile docatt = new DocAttachFile();
                        docatt.FileAttribute = 0;
                        docatt.FileSize = Int32.Parse(dataReader["FileSize"].ToString());
                        docatt.FileName = dataReader["FileName"].ToString();
                        docatt.FileAuthor = Username;
                        docatt.FileCatlog = "�ĵ�";
                        docatt.FileVisualPath = "Mail" + dataReader["FileVisualPath"].ToString();
                        docatt.FileAddedDate = DateTime.Now.ToString();
                        docatt.DocID = Int32.Parse(DocID);
                        doc.AddAttach(docatt, Int32.Parse(DocID));
                    }

                   // dataReader = null;
                    if (dataReader != null)
                    {
                        dataReader.Close();
                    }
                    pjt = null;
                    docbody = null;

                    Response.Write("<script language=javascript>alert('�鵵�ɹ�!');</script>");
                }
                catch (Exception oe)
                {
                    UDS.Components.Error.Log(oe.ToString());
                    Server.Transfer("../Error.aspx");
                }
                finally
                {
                    if (dataReader != null)
                    {
                        dataReader.Close();
                    }
                }
            }
        }