Exemplo n.º 1
0
    void ShowInit()
    {
        if (!string.IsNullOrEmpty(Request.Params["File_Id"]))
        {
            try
            {
                Tunnel.BLL.Tunnel_bumf   btb = new Tunnel.BLL.Tunnel_bumf();
                Tunnel.Model.Tunnel_bumf mtb = new Tunnel.Model.Tunnel_bumf();
                Tunnel.BLL.Tunnel_form   tf  = new Tunnel.BLL.Tunnel_form();
                Tunnel.Model.Tunnel_form mtf = new Tunnel.Model.Tunnel_form();
                Tunnel.Common.Form_Class fc  = new Tunnel.Common.Form_Class();
                Tunnel.BLL.UserLogin     ul  = new Tunnel.BLL.UserLogin();
                mtb      = btb.GetModel(Convert.ToInt32(Request.Params["File_Id"]));
                formfile = getFile(mtb.b_file);//附件

                Label1.Text  = mtb.b_title;
                Label2.Text  = fc.From_Content(mtb.b_formcontent, mtb.b_content, true);//取得替换后的表单数据
                ul.UsbnLogin = ul.getUserModel(mtb.b_user);
                Label3.Text  = "发布人:" + ul.UsbnLogin.m_name + " 发布时间:" + mtb.b_time.ToString();
            }
            catch
            {
                Tunnel.Common.Message.back("不正确的ID"); return;
            }
        }
    }
Exemplo n.º 2
0
    void Bind()
    {
        mf  = bf.GetModel(int.Parse(DropDownList1.SelectedValue));
        mtf = tf.GetModel(mf.f_form);
        if (mtf == null)
        {
            Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return;
        }
        Label1.Text  = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据
        ul.UsbnLogin = ul.getUserModel(ul.LoginID);
        string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum);

        TextBox1.Text = bumname + mf.f_name;
        if (mf.f_isfile.ToString() == "1")
        {
            isuploads = false;
        }
        Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id);
        Repeater1.DataBind();
        if (Repeater1.Items.Count <= 0)
        {
            Label2.Text = "本公文未设置流程,将不能保存!"; HiddenField2.Value = "0";
        }
        else
        {
            Label2.Text = ""; HiddenField2.Value = "1";
        }
    }
Exemplo n.º 3
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     try
     {
         Tunnel.Model.Tunnel_Chat tc  = new Tunnel.Model.Tunnel_Chat();
         Tunnel.BLL.Tunnel_Chat   btc = new Tunnel.BLL.Tunnel_Chat();
         string content = TextBox1.Text;
         string tomen   = Request.Form["DropDownList1"];
         int    state   = 0;
         if (tomen != "0")
         {
             if (CheckBox1.Checked)
             {
                 state = 2;
                 Tunnel.Model.Tunnel_Remind tr = new Tunnel.Model.Tunnel_Remind();
                 Tunnel.BLL.Tunnel_Remind   br = new Tunnel.BLL.Tunnel_Remind();
                 tr.m_title    = "您有一条聊天信息" + "<font color=red>(待读)</font>";
                 tr.m_url      = "N_Chat/Default.aspx";
                 tr.m_touser   = Convert.ToInt32(tomen);
                 tr.m_time     = DateTime.Now;
                 tr.m_type     = 2;
                 tr.m_typeid   = 2;
                 tr.m_bid      = 1;
                 tr.m_callTime = DateTime.Now.AddSeconds(2);
                 tr.m_isread   = 0;
                 long messge = br.Add(tr);
             }
             else
             {
                 state = 1;
             }
         }
         Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
         ul.UsbnLogin     = ul.getUserModel(ul.LoginID);
         tc.Chat_Content  = content;
         tc.Chat_Date     = DateTime.Now;
         tc.Chat_State    = state;
         tc.Chat_UserID   = ul.LoginID;
         tc.Chat_UserName = ul.UsbnLogin.m_name;
         tc.Chat_ToUserID = Convert.ToInt32(tomen);
         btc.Add(tc);
         Response.Redirect("Chat_Bottom.aspx");
     }
     catch
     {
         return;
     }
 }
Exemplo n.º 4
0
 void Bind()
 {
     try
     {
         mf  = bf.GetModel(int.Parse(Request.Params["Flow"]));
         mtf = tf.GetModel(mf.f_form);
         if (mtf == null)
         {
             Tunnel.Common.Message.back("表单不存在或已删除,请与管理员联系"); return; return;
         }
         Label1.Text  = fc.From_Content(mtf.f_content, "", false);//取得替换后的表单数据
         ul.UsbnLogin = ul.getUserModel(ul.LoginID);
         string bumname = Tunnel.Common.GetValue.getDataValue("Tunnel_bum", "b_name", "b_id=" + ul.UsbnLogin.m_bum);
         TextBox1.Text = bumname + mf.f_name;
         if (mf.f_isfile.ToString() == "1")
         {
             isuploads = false;
         }
         if (mf.f_state.ToString() == "0")
         {
             scontent = "审核→"; issheng = true; isshen = true;
         }
         else
         {
             scontent = ""; issheng = false; isshen = false;
         }
         Repeater1.DataSource = bs.GetList("s_lid=" + mf.f_id);
         Repeater1.DataBind();
         if (Repeater1.Items.Count <= 0)
         {
             Label2.Text = "本申请未设置流程,将不能保存!"; HiddenField2.Value = "0";
         }
         else
         {
             Label2.Text = ""; HiddenField2.Value = "1";
         }
     }
     catch {
         Tunnel.Common.Message.back("不正确的ID"); return;
     }
 }
Exemplo n.º 5
0
    void ShowInit()
    {
        if (!string.IsNullOrEmpty(Request.Params["File_Id"]))
        {
            Tunnel.BLL.Tunnel_Cfile   tf = new Tunnel.BLL.Tunnel_Cfile();
            Tunnel.Model.Tunnel_Cfile mf = new Tunnel.Model.Tunnel_Cfile();


            mf           = tf.GetModel(Convert.ToInt32(Request.Params["File_Id"]));
            Label1.Text  = mf.f_title;
            Label2.Text  = mf.f_content;
            ul.UsbnLogin = ul.getUserModel(mf.f_user);
            Label3.Text  = "发布人:" + ul.UsbnLogin.m_name + " 发布时间:" + mf.f_date.ToString();
            file         = getFile(mf.f_file);


            DataSet ds = tc.GetList("c_fid=" + mf.f_id + " order by c_id asc");
            Repeater1.DataSource = ds;
            Repeater1.DataBind();
        }
    }
Exemplo n.º 6
0
 /// <summary>
 /// 显示对谁说
 /// </summary>
 /// <param name="toid"></param>
 /// <param name="state"></param>
 /// <returns></returns>
 public string gettoUser(string toid, string state)
 {
     Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
     ul.UsbnLogin = ul.getUserModel(Convert.ToInt32(toid));
     if (state == "1")
     {
         return("对 <span style='color:green'>" + ul.UsbnLogin.m_name + "</span> ");
     }
     else if (state == "2")
     {
         if (ul.LoginID.ToString().Equals(toid))
         {
             return("对 <span style='color:red'>你</span> 悄悄的");
         }
         else
         {
             return("对 <span style='color:red'>" + ul.UsbnLogin.m_name + "</span> 悄悄的");
         }
     }
     else
     {
         return("");
     }
 }
Exemplo n.º 7
0
    //添加至信息表
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (titleId == 1)
        {
            if (!"0".Equals(Request.Form["DropDownList1"]))
            {
                string title       = this.tb_Title.Text.Trim();
                int    typeid      = Convert.ToInt32(this.DropDownList1.SelectedValue);
                int    sectype     = Convert.ToInt32(DropDownList2.SelectedValue);
                string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"];  //this.FCKeditor.Value;
                string imagepaht   = stringFormat(From_Content(htmlsourcce)).Trim();
                string content     = FCKeditor.Value;      //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText;
                int    userid      = ul.LoginID;
                if (!string.IsNullOrEmpty(imagepaht))
                {
                    if (imagepaht.Substring(0, 1) == "/")
                    {
                        imagepaht = imagepaht.Substring(1, imagepaht.Length - 1);
                    }
                    imagepaht = imagepaht.Replace("src=/sdoa/", "");
                }

                Tunnel.Model.Tunnel_InfoXJB model = new Tunnel.Model.Tunnel_InfoXJB();
                model.Id         = indexId;
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                model.Sectype    = sectype;
                HttpPostedFile hpf = file1.PostedFile;
                if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10)
                {
                    Response.Write("<script>alert('附件大小不能大于10MB');</script>");

                    return;
                }
                else
                {
                    CreateMdAndFilePaht(hpf);
                }
                if (filePaht.Equals(""))
                {
                    model.Files = Label3.Text;
                }
                else
                {
                    model.Files = filePaht; //infofiles
                }
                //string str = titleName;
                Tunnel.BLL.Tunnel_InfoXJB index = new Tunnel.BLL.Tunnel_InfoXJB();
                int relt = -1;
                relt = index.Update(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("修改成功!", "N_XJBManage.aspx");
                    string strsql = "";
                    strsql = "insert into tunnel_log(l_user,l_time,l_content,l_ip,l_sort) values(" + ul.LoginID + ",'" + DateTime.Now + "','公司事务>>项经部信息>>修改项经部信息。标题:" + model.Title + "','" + Tunnel.Common.Common.GetIp() + "',1)";
                    Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
                }
                else
                {
                    Tunnel.Common.Message.Show("修改失败!", "N_XJBManage.aspx");
                }

                // MessageBox(str, url);
            }
            else
            {
                Tunnel.Common.Message.Show("请选择子栏目!");
            }
        }
        else
        {
            if (!"0".Equals(Request.Form["DropDownList1"]))
            {
                string title       = this.tb_Title.Text.Trim();
                int    typeid      = Convert.ToInt32(this.DropDownList1.SelectedValue);
                int    sectype     = Convert.ToInt32(DropDownList2.SelectedValue);
                string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"];  //this.FCKeditor.Value;
                string imagepaht   = stringFormat(From_Content(htmlsourcce)).Trim();
                string content     = FCKeditor.Value;      //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText;
                int    userid      = ul.LoginID;
                if (!string.IsNullOrEmpty(imagepaht))
                {
                    if (imagepaht.Substring(0, 1) == "/")
                    {
                        imagepaht = imagepaht.Substring(1, imagepaht.Length - 1);
                    }
                    imagepaht = imagepaht.Replace("src=/sdoa/", "");
                }

                Tunnel.Model.Tunnel_InfoXJB model = new Tunnel.Model.Tunnel_InfoXJB();
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                model.Bum_bz     = ul.getUserModel(ul.LoginID).m_bum;
                model.Sectype    = sectype;
                HttpPostedFile hpf = file1.PostedFile;
                if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10)
                {
                    Response.Write("<script>alert('附件大小不能大于10MB');</script>");

                    return;
                }
                else
                {
                    CreateMdAndFilePaht(hpf);
                }
                model.Files = filePaht; //infofiles


                //string str = titleName;

                Tunnel.BLL.Tunnel_InfoXJB bllf = new Tunnel.BLL.Tunnel_InfoXJB();
                int relt = -1;
                relt = bllf.Add(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("增加成功!", "N_XJBManage.aspx");
                    string strsql = "";
                    strsql = "insert into tunnel_log(l_user,l_time,l_content,l_ip,l_sort) values(" + ul.LoginID + ",'" + DateTime.Now + "','公司事务>>项经部信息>>发布项经部信息。标题:" + model.Title + "','" + Tunnel.Common.Common.GetIp() + "',1)";
                    Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
                }
                else
                {
                    Tunnel.Common.Message.Show("增加失败!", "N_XJBManage.aspx");
                }

                // MessageBox(str, url);
            }
            else
            {
                Tunnel.Common.Message.Show("请选择子栏目!");
            }
        }
    }
Exemplo n.º 8
0
    /// <summary>
    /// 发送邮件并保存到服务器
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Button1_Click(object sender, EventArgs e)
    {
        //获得所需参数
        string strTo = tb_toname.Text.Trim();

        strToIds = id_toValue.Value.Trim();
        string         strTitle   = tb_Title.Text.Trim();
        string         strContent = tb_content.Text.Trim().Replace("\r\n", @"<br \>").Replace("原信息内容:", "");
        HttpPostedFile hpf        = file1.PostedFile;

        if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10)
        {
            Response.Write("<script>alert('附件大小不能大于10MB');</script>");

            return;
        }
        else
        {
            CreateMdAndFilePaht(hpf);
        }

        //写入数据库

        Tunnel.BLL.Tunnel_mail   rbll  = new Tunnel.BLL.Tunnel_mail();
        Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
        model.m_title   = strTitle;
        model.m_content = strContent;
        model.m_file    = filePaht;
        model.m_time    = DateTime.Now;
        model.m_from    = ul.LoginID;
        model.m_sort    = 0; // 0未删除、1删除
        model.m_state   = 0; // 0未读、1已读
        model.m_Ip      = Tunnel.Common.Common.GetIp();
        if (strToIds.LastIndexOf(',') > 0)
        {
            strToIds = strToIds.Remove(strToIds.LastIndexOf(','), 1);
        }
        string[] arr   = strToIds.Split(',');
        int      relt1 = -1;

        foreach (string s in arr)
        {
            bool state = true;
            for (int i = 1; i <= 2; i++)
            {
                if (i == 1)
                {
                    model.m_Main = 1; //标记是自己发的
                    model.m_to   = Convert.ToInt32(s);
                    relt1        = rbll.Add(model);
                }
                else
                {
                    model.m_Main = 0; //标记是发给别人的
                    model.m_to   = Convert.ToInt32(s);
                    relt1        = rbll.Add(model);
                    //-------添加消息提示--------
                    Tunnel.Model.Tunnel_Remind remindmodel = new Tunnel.Model.Tunnel_Remind();
                    remindmodel.m_isread   = 0;
                    remindmodel.m_time     = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    remindmodel.m_title    = "新的站内消息,发件人:" + ul.getUserModel(model.m_from).m_name + "。时间:" + DateTime.Now + "<font color=red>(未读)</font>";
                    remindmodel.m_touser   = model.m_to;
                    remindmodel.m_url      = "N_Exchange/N_Message/N_MessageView.aspx?Id=" + relt1;
                    remindmodel.m_type     = 2;
                    remindmodel.m_typeid   = relt1;
                    remindmodel.m_callTime = Convert.ToDateTime("1800-01-01");
                    Tunnel.BLL.Tunnel_Remind rd = new Tunnel.BLL.Tunnel_Remind();
                    rd.Add(remindmodel);
                }
                if (relt1 == 0)
                {
                    state = false;
                    break;
                }
            }
            if (state == false)
            {
                break;
            }
        }

        string str = "站内信息发送";
        string url = "N_MessageOld.aspx";

        if (relt1 > 0)
        {
            str += "成功!";
        }
        else
        {
            str += "失败!";
        }

        MessageBox(str, url);
    }
Exemplo n.º 9
0
    public void PageBind2()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_InfoXJB";
        pb.FldName       = "id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;
        int count = 0;

        pb.DoCount = 1;
        if (key.Length > 0)
        {
            key += " and Title like '%" + TextBox1.Text + "%'";
        }
        else
        {
            key += " 1=1 and Title like '%" + TextBox1.Text + "%'";
        }
        if (ul.LoginID == 1 || ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
        {
            key += " and typeid in (92,93,94,95,96,97,98,99,100,101,102,103) ";
        }
        else
        {
            key += " and typeid in (92,93,94,95,96,97,98,99,100,101,102,103) and bum_bz= " + ul.getUserModel(ul.LoginID).m_bum.ToString() + " and userid=" + ul.LoginID;
        }
        where      += key;
        pb.StrWhere = key + " and del=0";
        mbll.GetList(pb, ref count); //获取总条数

        pb.DoCount = 0;
        List <Tunnel.Model.Tunnel_InfoXJB> modelList = new List <Tunnel.Model.Tunnel_InfoXJB>();

        modelList = mbll.GetList3(pb, ref count);//获取分页结果


        //数据绑定
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();

        //数据分页
        MTCPager1.PageSize    = pageSize;
        MTCPager1.RecordCount = count;
        MTCPager1.PageIndex   = cuttentPage;
        if (count <= pb.PageSize)
        {
            MTCPager1.Visible = false;
        }
        else
        {
            MTCPager1.Visible = true;
        }
    }