Exemple #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string ContentID = Request.QueryString["ContentID"].ToString();
        OA.OAService service=new OA.OAService();
        DataSet ds = service.FileContent_Select("Subject,Content,Attachment_ID,Attachment_Name", "Content_ID=" + ContentID, "");
        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            lblText.Text = ds.Tables[0].Rows[0]["Subject"].ToString();
            tdContent.InnerHtml = ds.Tables[0].Rows[0]["Content"].ToString();

            // 添加附件信息
            string strDirName = ds.Tables[0].Rows[0]["Attachment_ID"].ToString();
            string strFiles = ds.Tables[0].Rows[0]["Attachment_Name"].ToString();

            string[] strfile = strFiles.Split('*');
            for (int i = 0; i < strfile.Length; i++)
            {
                // ../../OA/News/092/ckmsg.txt
                HyperLink hl = new HyperLink();
                string strPath = "..\\..\\..\\Attachment\\Files\\" + strDirName + "\\" + strfile[i];
                hl.NavigateUrl = strPath;
                hl.Text = strfile[i];
                hl.Style.Add("cursor", "hand");
                hl.Style.Add("font-Size", "14px");
                hl.Target = "black";
                DivAnnex.Controls.Add(hl);
                Label lbl = new Label();
                lbl.Width = 20;
                DivAnnex.Controls.Add(lbl);
            }
        }
    }
    protected void gdvFiles_Info_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        OA.OAService service = new OA.OAService();
        OA.BoardModel model = new OA.BoardModel();
        model.BOARD_ID =int.Parse(gdvFiles.DataKeys[e.RowIndex].Value.ToString());

        DataSet ds = service.BBS_Board_Delete(model, strAccount);
        if (ds != null && ds.Tables.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                string[] removes = dr["ATTACHMENT_ID"].ToString().Split('*');
                foreach (string strremove in removes)
                {
                    if (strremove != "")
                    {
                        System.IO.FileInfo info = new System.IO.FileInfo(Request.PhysicalApplicationPath + "\\Attachment\\BBS\\" + strremove);
                        info.Delete();
                    }
                }
            }
            Response.Write("<script>alert('删除成功!');</script>");
            DataBound();
        }
        else
            Response.Write("<script>alert('删除失败,请与管理员联系!');</script>");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["Content_ID"] != null)
        {
            OA.OAService service = new OA.OAService();
            DataSet ds= service.FileContent_Delete(Request.QueryString["Content_ID"].ToString());

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (dr["Attachment_Name"].ToString() != "")
                    {
                        string[] strAttentNames = dr["Attachment_Name"].ToString().Split('*');
                        foreach (string name in strAttentNames)
                        {
                            if (name != "")
                            {
                                System.IO.FileInfo file = new System.IO.FileInfo(Request.PhysicalApplicationPath + "\\Attachment\\Files\\" + dr["Attachment_ID"].ToString() + "\\" + name);
                                file.Delete();
                            }
                        }
                    }
                }
            }
            else
            {
                Response.Write("<script type='text/javascript'>alert('删除文件失败!');</script>");
            }
        }

        Response.Write("<script>window.opener=null;</script>");
        Response.Write("<script>window.close();</script>");
        Response.Write("<script> var url=parent.parent.document.all('hidUrl').value;location=url+'?Sort_ID=" + Request.QueryString["Sort_ID"].ToString() + "';</script>");
    }
 private void BindGridView()
 {
     OA.OAService service = new OA.OAService();
     DataSet ds = service.FileSort_Select("Sort_Name,Sort_ID", "Sort_Type='5' and Sort_Parent=0", "");
     wdTab_Info.DataSource = ds;
     wdTab_Info.DataBind();
 }
Exemple #5
0
 private void BindGridView()
 {
     OA.OAService service = new OA.OAService();
     string strFiledValue = "disk_No,Disk_ID ,disk_Name,Disk_Path,Space_Limit,(case Order_By when 'nom' then '名称' when 'taile' then '大小' when 'type' then '类型' when 'mod' then '最后修改时间' end)+'('+(case Asc_Desc when 0 then '升序'  when 1 then '降序' END )+')'";
     DataSet ds = service.NetDisk_Select(strFiledValue, "1=1", "");
     wdTab_Info.DataSource = ds;
     wdTab_Info.DataBind();
 }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     OA.OAService oaservice = new OA.OAService();
     int iReturn = oaservice.EmailBox_Update(int.Parse(hidID.Value), txtNO.Text, txtName.Text, strAccount);
     if (iReturn > 0)
     {
         Response.Write("<script>window.location.href='EmailBox.aspx';parent.frames('_EmailLeft').location.href='Left.aspx';</script>");
     }
     else
         Response.Write("<script>alert('修改失败!');</script>");
 }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OA.OAService service = new OA.OAService();
        int iRetrun;
        iRetrun = service.NetDisk_Delete(int.Parse(Request.QueryString["Disk_ID"].ToString()));

        if (iRetrun <= 0)
        {
            Response.Write("<script type='text/javascript'>alert('存储数据库失败!');</script>");
            return;
        }
        Response.Redirect("Index.aspx");
    }
Exemple #8
0
 private void GetData()
 {
     OA.OAService service = new OA.OAService();
     DataSet ds = service.BBS_Board_GetList(strAccount) ;
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         gdvFiles.DataSource = ds;
         gdvFiles.DataBind();
     }
     else
     {
         DivNo.Style.Add("display", "bolck");
         divData.Style.Add("display", "none");
     }
 }
Exemple #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int iSortID = 0;
        string strURL = "SetUser_Index.aspx?url=Admin_Index.aspx&frm=_parent&";

        OA.OAService service = new OA.OAService();
        DataSet ds=new DataSet();

        if (Request.QueryString["Sort_ID"] != null)
        {
            iSortID = int.Parse(Request.QueryString["Sort_ID"].ToString());
            ds = service.FileSort_Select_BySort_Public(iSortID);
        }
        else
            ds = service.FileSort_Select_Public_byAccount(strAccount);

        ClientScriptManager jsCode = Page.ClientScript;
        Type jsType = Page.GetType();

        //构造JS函数
        strBuild.Append("function init(){");
        strBuild.Append("var obj = new WTree();");
        strBuild.Append("obj.add('0',-1,'文件柜', '', '', '', '../../../Images/file_folder.gif', '../../../Images/file_folder.gif', 'false');");

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (Request.QueryString["URL"] != null)
                    strURL = Request.QueryString["URL"].ToString() + "?";

                if (dr["Sort_Parent"].ToString() == "0")
                    strURL = strURL + "Base=True&";
                else
                    strURL = strURL + "Base=False&";

                strBuild.Append("obj.add(" + dr["Sort_ID"].ToString() + "," + dr["Sort_Parent"].ToString() + ",'" + dr["Sort_Name"].ToString()
                    + "','" + strURL + "Sort_ID=" + dr["Sort_ID"].ToString() +  "', '', '_FolderSortMain', '../../../../Images/Menu/1/tree_plus.gif', '../../../../Images/Menu/1/tree_minus.gif', 'false');");
            }
        }

        strBuild.Append("obj.Show(); }");

        if (!jsCode.IsClientScriptBlockRegistered(jsType, "init"))
        {
            jsCode.RegisterClientScriptBlock(jsType, "init", strBuild.ToString(), true);
        }
    }
Exemple #10
0
    string strAccount = string.Empty; //账号

    #endregion Fields

    #region Methods

    protected void Page_Load(object sender, EventArgs e)
    {
        OA.OAService service = new OA.OAService();

        //加载已设置的权限
        DataSet ds = service.FileSort_GetUsersByAccount(strAccount,int.Parse( Request.QueryString["Sort_ID"].ToString()));

        if (ds != null&&ds.Tables.Count>0&&ds.Tables[0].Rows.Count>0)
        {
            hidNew.Value = ds.Tables[0].Rows[0]["News_index"].ToString();
            hidManage.Value = ds.Tables[0].Rows[0]["Manages_index"].ToString();
            hidDown.Value = ds.Tables[0].Rows[0]["Downs_index"].ToString();
            hidOwner.Value = ds.Tables[0].Rows[0]["Owner_index"].ToString();
            hidBase.Value = ds.Tables[0].Rows[0]["Sort_Parent"].ToString().Equals("0") ? "True" : "False";
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string stroptType = Request.QueryString["opt"].ToString();
        int iSort_ID =int.Parse( Request.QueryString["Sort_ID"].ToString());
        string strContentIDs = Request.QueryString["ContentIDS"].ToString();

        OA.OAService service = new OA.OAService();
        int iReturn = service.FileContent_Paste(iSort_ID, stroptType, strContentIDs, DateTime.Now);

        if(iReturn<1)
            Response.Write("<script>alert('粘贴文件失败!');</script>");

        Response.Write("<script>window.opener=null;</script>");
        Response.Write("<script>window.close();</script>");

        Response.Write("<script>location='FileList.aspx?Sort_ID=" + iSort_ID.ToString() + "';</script>");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        OA.OAService service = new OA.OAService();
        string strSorceSort_ID=Request.QueryString["SorceSort_ID"].ToString();
        string strDeskParentID=Request.QueryString["DeskParentID"].ToString();
        string strType=Request.QueryString["opt"].ToString();
        int iReturn = service.FileSort_Paste(int.Parse(strSorceSort_ID), int.Parse(strDeskParentID), strType);

        if (iReturn < 1)
        {
            Response.Write("<script type='text/javascript'>alert('“粘贴”操作失败!');</script>");
            return;
        }

        Response.Write("<script>window.open(parent.document.all('hidlefturl').value,'_FolderSortLeft');</script>");
        Response.Write("<script>window.open(parent.document.all('hidFileNewurl').value+'?Sort_ID=" + strDeskParentID + "','_self');</script>");
    }
Exemple #13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OA.OAService service = new OA.OAService();
        DataSet ds = service.FileSort_Select_Share(strAccount);

        ClientScriptManager jsCode = Page.ClientScript;
        Type jsType = Page.GetType();

        //构造JS函数
        strBuild.Append("function init(){");
        strBuild.Append("var obj = new WTree();");
        strBuild.Append("obj.add('0',-1,'共享', '', '', '', '../../../Images/file_folder.gif', '../../../Images/file_folder.gif', 'false');");

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                string strURL = "../../FileContent/ShareFilelist.aspx";

                //共享图标
                string stricon = "../../../../Images/Menu/1/tree_plus.gif";
                string stropenicon = "../../../../Images/Menu/1/tree_minus.gif";
                string strPid = dr["ID"].ToString() + "_" + dr["Sort_Parent"].ToString();

                if (dr["Sort_Parent"].ToString().EndsWith("0"))
                {
                    stricon = "../../../../Images/Menu/2/endnode_share.gif";
                    stropenicon = "../../../../Images/Menu/2/endnode_share.gif";
                    strPid = "0";
                }

                string strId = dr["ID"].ToString() + "_" + dr["Sort_ID"].ToString();

                strBuild.Append("obj.add('" + strId + "','" + strPid + "','" + dr["Sort_Name"].ToString()
                    + "','" + strURL + "?Ismanage=" + dr["Manage_index"].ToString() + "&Sort_ID=" + dr["Sort_ID"].ToString() + "', '', '_FolderSortMain', '" + stricon + "', '" + stropenicon + "', 'false');");
            }
        }

        strBuild.Append("obj.Show(); }");

        if (!jsCode.IsClientScriptBlockRegistered(jsType, "init"))
        {
            jsCode.RegisterClientScriptBlock(jsType, "init", strBuild.ToString(), true);
        }
    }
Exemple #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        OA.OAService service = new OA.OAService();
        DataSet ds = service.NetDisk_GetUsersByAccount(strAccount);

        ClientScriptManager jsCode = Page.ClientScript;
        Type jsType = Page.GetType();

        //构造JS函数
        strBuild.Append("function init(){");
        strBuild.Append("var obj = new WTree();");
        strBuild.Append("obj.add('top',-1,'网络办公', '', '', '', '../../Images/netdisk.gif', '../../Images/netdisk.gif', 'false','','',0,0,0);");

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count>0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (int.Parse(dr["User_Falg"].ToString()) > 0)
                {
                    string strpath = dr["Disk_Path"].ToString().Replace(@"\", @"\\");
                    string strname = dr["Disk_Name"].ToString();

                    string new_flag = dr["New_Falg"].ToString();
                    string manage_flag=dr["Manage_Falg"].ToString();
                    string down_flag=dr["Down_Falg"].ToString();
                    string size=dr["Space_Limit"].ToString();

                    strBuild.Append("obj.add('" + dr["Disk_Path"].ToString() + "','top','" + strname + "', 'FileList.aspx?size="+size+"&path="
                        +Server.UrlEncode( dr["Disk_Path"].ToString().Replace(@"\", @"\\") )
                        + "', '', '_netDiskMain', '../../../Images/Menu/1/tree_plus.gif', '../../../Images/Menu/1/tree_minus.gif','false','" + strname
                        + "','" + strpath.Replace(@"\\", @"\\\\") + "'," + new_flag + "," + manage_flag + "," +down_flag + ");");
                    //遍历文件夹
                    DirSearch(dr["Disk_Path"].ToString(), strname, strpath, new_flag, manage_flag, down_flag,size);
                }
            }
        }

        strBuild.Append("obj.Show(); }");

        if (!jsCode.IsClientScriptBlockRegistered(jsType, "init"))
        {
            jsCode.RegisterClientScriptBlock(jsType, "init", strBuild.ToString(), true);
        }
    }
Exemple #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["Sort_ID"] != null)
        {
            OA.OAService service = new OA.OAService();
            DataSet ds=service.FileSort_Delete(int.Parse(Request.QueryString["Sort_ID"].ToString()));

            if (ds != null && ds.Tables.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if (dr["Attachment_Name"].ToString() != "")
                    {
                        string[] strAttentNames = dr["Attachment_Name"].ToString().Split('*');
                        foreach (string name in strAttentNames)
                        {
                            if (name != "")
                            {
                                System.IO.FileInfo file = new System.IO.FileInfo(Request.PhysicalApplicationPath + "\\Attachment\\Files\\" + dr["Attachment_ID"].ToString() + "\\" + name);
                                file.Delete();
                            }
                        }
                    }
                }
            }
            else
            {
                Response.Write("<script type='text/javascript'>alert('文件柜删除失败!');</script>");
                return;
            }

            //if (iReturn < 0)
            //{
            //    Response.Write("<script type='text/javascript'>alert('文件柜删除失败!');</script>");
            //    return;
            //}
        }
        //Response.Redirect("Admin_Index.aspx");
        Response.Redirect(Request.QueryString["url"].ToString());
    }
Exemple #16
0
    /// <summary>
    /// 绑定到GridView
    /// </summary>
    private void BindGridView()
    {
        OA.OAService service = new OA.OAService();
        DataSet ds = service.Email_GetSendBox(strAccount);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            divData.Visible = true;
            DivNo.Visible = false;
            // 获取GridView排序数据列及排序方向
            string sortExpression = this.gdvFiles.Attributes["SortExpression"];
            string sortDirection = this.gdvFiles.Attributes["SortDirection"];

            // 根据GridView排序数据列及排序方向设置显示的默认数据视图
            if ((!string.IsNullOrEmpty(sortExpression)) && (!string.IsNullOrEmpty(sortDirection)))
            {
                ds.Tables[0].DefaultView.Sort = string.Format("{0} {1}", sortExpression, sortDirection);
            }
            // GridView绑定并显示数据
            this.gdvFiles.DataSource = ds.Tables[0];
            this.gdvFiles.DataBind();

            lblCount.Text = gdvFiles.PageCount.ToString();
            lblIndex.Text = (gdvFiles.PageIndex + 1).ToString();
            lblAll.Text = "  <font color='red' size='3'>" + ds.Tables[1].Rows[0][0].ToString() + "   </font>";
            //lblNewCount.Text = "  <font color='red' size='3'>" + ds.Tables[1].Rows[0][0].ToString() + "   </font>";
            SetLinkButton();

            if (!hidDelete.Value.Equals(""))
            {
                int lenght = hidDelete.Value.Split(',').Length - 1;
                lblNewCount.Text = "  <font color='red' size='3'>" + lenght.ToString() + "   </font>";
            }
            else
                lblNewCount.Text = "  <font color='red' size='3'>0</font>";
        }
        else
        {
            divData.Visible = false;
            DivNo.Visible = true;
        }
    }