Example #1
0
        /// <summary>
        /// ת���ʼ�����
        /// </summary>
        private void ForwardSet()
        {
            // ��ȡԭ�ʼ�����
            MailClass mailclass = new MailClass();
            SqlDataReader dataReader = null;

            try
            {
                try
                {
                    dataReader = mailclass.GetMailCompleteInfoDbreader(MailID);
                }
                catch
                {
                    Server.Transfer("../../Error.aspx");
                }

                if (dataReader.Read())
                {
                    string tmpStr = "<br/>" + dataReader[7].ToString();
                    tmpStr = tmpStr.Replace("<br/>", "\r\n>");
                    this.txtSubject.Text = "Fw::" + dataReader[4].ToString();
                    this.txtBody.Text = ",���!\n\n\n\n\n\n\n";
                    this.txtBody.Text += "=======������ת���ʼ�=======\n";
                    this.txtBody.Text += "ԭ�ʼ�����������:" + dataReader[1].ToString() + "\n";
                    this.txtBody.Text += "ԭ�ʼ������˴���:" + dataReader[10].ToString() + "\n";
                    this.txtBody.Text += tmpStr;

                }
                dataReader.Close();

                try
                {
                    dataReader = mailclass.GetMailAttInfoDbreader(MailID);
                }
                catch
                {
                    Server.Transfer("../../Error.aspx");
                }
                while (dataReader.Read())
                {
                    UDS.Components.MailAttachFile att = new MailAttachFile();
                    att.FileAttribute = 0;
                    att.FileSize = Int32.Parse(dataReader[1].ToString());
                    att.FileName = dataReader[0].ToString();
                    att.FileAuthor = Username;
                    att.FileCatlog = "�ʼ�";
                    att.FileVisualPath = dataReader[2].ToString();
                    upattlist.Add(att);
                }
                BindAttList();

            }
            finally
            {
                dataReader.Close();

            }
            mailclass = null;
        }
Example #2
0
        protected void ShowBodyDetail()
        {
            MailClass mailclass = new MailClass();
            SqlDataReader dataReader = null;
            try
            {
                 dataReader = mailclass.GetMailCompleteInfoDbreader(MailID);
            }
            catch
            {
                Server.Transfer("../../Error.aspx");
            }

            if(dataReader.Read())
            {
                this.lblSenderName.Text = dataReader["MailSender"].ToString();
                this.lblCcToAddr.Text   = UDS.Components.Staff.GetRealNameStrByUsernameStr(dataReader["MailCcToAddr"].ToString(),0);
                // �ж��Ƿ���ʾ�ܳ�����Ϣ�����û�
                string[] RecvAr = System.Text.RegularExpressions.Regex.Split(dataReader["MailBccToAddr"].ToString() ,",");
                for(int i=0;i<RecvAr.Length-1;i++)
                {	//�ж��ܳ������Ƿ�����Լ�
                    if( RecvAr[i].ToString()==UserCookie.Value.ToString())
                    {
                        //this.lblBccToAddr.Text = UserCookie.Value.ToString();
                        this.lblBccToAddr.Text = UDS.Components .Staff.GetRealNameByUsername(UserCookie.Value.ToString());
                    }
                }

                this.lblSubject.Text    = dataReader["MailSubject"].ToString();
                this.lblBody.Text       = dataReader["MailBody"].ToString();
                this.lblSendDate.Text   = dataReader["MailSendDate"].ToString();
                this.lblReceiverStr .Text = UDS.Components.Staff.GetRealNameStrByUsernameStr(dataReader["MailReceiverStr"].ToString(),0);
                this.lblProjectName .Text = dataReader["classname"].ToString();
            }
            dataReader.Close();

            // ��ʼ��ȡ������Ϣ

            try
            {
                dataReader = mailclass.GetMailAttInfoDbreader(MailID);
            }
            catch
            {
                Server.Transfer("../../Error.aspx");
            }

            while(dataReader.Read())
            {
                lblAttachFile.Text += "&nbsp;<a href='Download.aspx?destFileName="+Server.UrlEncode(dataReader[2].ToString())+"'>"+dataReader[0].ToString()+"("+dataReader[1].ToString()+" Byte)</a><br>";
            }
            dataReader.Close();

            mailclass = null;
        }
Example #3
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();
                        }
                }
            }
        }
Example #4
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();
                    }
                }
            }
        }