Esempio n. 1
0
    /// <summary>
    /// 页面数据绑定
    /// </summary>
    public void PageBind()
    {
        if (Id == 0)
        {
            return;
        }
        Tunnel.Model.Tunnel_mail        model     = new Tunnel.Model.Tunnel_mail();
        List <Tunnel.Model.Tunnel_mail> modelList = new List <Tunnel.Model.Tunnel_mail>();

        model = tbll.GetModel(Id);
        modelList.Add(model);
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();

        if (model.m_Main == 0 && model.m_state == 0)
        {
            Tunnel.Model.Tunnel_mail modelUp = new Tunnel.Model.Tunnel_mail();
            modelUp.m_id    = Id;
            modelUp.m_state = 1;
            modelUp.m_from  = ul.LoginID;
            modelUp.m_Ip    = Tunnel.Common.Common.GetIp();
            tbll.Update(modelUp);

            Tunnel.Model.Tunnel_mail modelUp2 = new Tunnel.Model.Tunnel_mail();
            modelUp2.m_id    = Id - 1;
            modelUp2.m_state = 1;
            modelUp2.m_from  = ul.LoginID;
            modelUp2.m_Ip    = Tunnel.Common.Common.GetIp();
            tbll.Update(modelUp2);
            string strsql = "delete Tunnel_Remind where m_typeid=" + Id + " and m_type=2";
            Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
        }
    }
Esempio n. 2
0
    /// <summary>
    ///  创建文件及路径参数

    /// </summary>
    public void CreateMdAndFilePaht(HttpPostedFile hpf)
    {
        //string wordMd = Request.PhysicalApplicationPath.Replace(HttpRuntime.AppDomainAppVirtualPath.Replace("/", "") + "\\", "");
        string upPaht     = "upload";
        string createPaht = "\\Messge";
        string fileSaveMd = createPaht + ul.LoginID + "\\";

        fileDirectory = Request.PhysicalApplicationPath + upPaht + createPaht;
        if (Tunnel.Common.Common.CreateMd(fileDirectory) == 0)
        {
            fileDirectory = fileDirectory + fileSaveMd;
            if (Tunnel.Common.Common.CreateMd(fileDirectory) == 0)
            {
                upDbFilePaht = upPaht + createPaht + fileSaveMd;
                fileName     = DateTime.Now.ToString("yyyyMMddHHmmssffff");
            }
        }
        if (hpf.ContentLength > 0)
        {
            if (!string.IsNullOrEmpty(hpf.FileName))
            {
                fileName = fileName + System.IO.Path.GetExtension(hpf.FileName);
            }
            else
            {
                fileName = fileName + hpf.ContentType;
            }
            filePaht      = upDbFilePaht + fileName;
            fileDirectory = fileDirectory + fileName;
            hpf.SaveAs(fileDirectory);
        }
        else
        {
            if (classid == 2)
            {
                Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
                Tunnel.BLL.Tunnel_mail   mbll  = new Tunnel.BLL.Tunnel_mail();
                model = mbll.GetModel(Convert.ToInt64(Id));
                if (model.m_file.Trim().Equals(""))
                {
                    filePaht = string.Empty;
                }
                else
                {
                    filePaht = upDbFilePaht + fileName + model.m_file.Substring(model.m_file.LastIndexOf('.'));
                    File.Copy(Request.PhysicalApplicationPath + model.m_file, fileDirectory + fileName + model.m_file.Substring(model.m_file.LastIndexOf('.')));
                }
            }
            else
            {
                filePaht = string.Empty;
            }
        }
    }
Esempio n. 3
0
 private void PageBind2(int mailId)
 {
     Tunnel.BLL.Tunnel_mail   mail  = new Tunnel.BLL.Tunnel_mail();
     Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
     model           = mail.GetModel(mailId);
     tb_Title.Text   = "转发:" + model.m_title;
     tb_content.Text = "原信息内容:\n" + model.m_content.Replace(@"<br \>", "\n") + "\n" + model.m_time.ToString() + "\n-------------------------------\n";
     if (!model.m_file.Trim().Equals(""))
     {
         Label1.Text   += model.m_file.Substring(model.m_file.LastIndexOf('\\'));
         Label1.Visible = true;
         Label2.Visible = true;
     }
 }
Esempio n. 4
0
    private void PageBind(int mailId)
    {
        Tunnel.BLL.Tunnel_mail   mail  = new Tunnel.BLL.Tunnel_mail();
        Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
        model           = mail.GetModel(mailId);
        tb_Title.Text   = "回复:" + model.m_title;
        tb_content.Text = "原信息内容:\n" + model.m_content.Replace(@"<br \>", "\n") + "\n" + model.m_time.ToString() + "\n-------------------------------\n";
        Tunnel.BLL.Tunnel_menber   menb = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber mmol = new Tunnel.Model.Tunnel_menber();
        mmol             = menb.GetModel(model.m_from);
        tb_toname.Text   = mmol.m_name + ",";
        id_toValue.Value = model.m_from.ToString() + ",";
        string priv_name = mmol.m_name;
        long   priv_id   = mmol.m_id;
        char   d         = '"';

        td_tomail.InnerHtml = priv_name + "<IMG id=" + priv_name + priv_id + " onclick=" + "'" + "removeimg(" + d + priv_name + d + "," + d + priv_id + d + ");" + "'" + " src=" + d + "../../image/remove.png" + d + ">,";
    }