Exemplo n.º 1
0
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            int emid = Convert.ToInt32(Session["EmployeeId"]);

            try
            {
                for (int i = 0; i < gvFile.Rows.Count; i++)
                {
                    CheckBox ckb = gvFile.Rows[i].FindControl("ckbChoose") as CheckBox;
                    if (ckb.Checked == true)
                    {
                        int fileid = Convert.ToInt32(gvFile.DataKeys[i].Value);

                        FileInfo.DelDocumentOf(fileid, emid);
                        if (MessageInfo.IsMessageOfFile(fileid.ToString()))
                        {
                            MessageInfo.DelMsgOfBoth(fileid.ToString(), emid);
                        }
                    }
                }
                gvDataBind();
            }
            catch (Exception Ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "Save", "alert('错误信息:" + Ex.Message + "');", true);
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int fileid = Int32.Parse(Request.QueryString["fileid"]);//获取文件的ID

            int emid = Convert.ToInt32(Session["EmployeeId"]);

            CanYou.OA.BLL.FileInfo.UpdateDocument(fileid, emid);

            if (MessageInfo.IsMessageOfFile(fileid.ToString()))
            {
                //删除消息
                MessageInfo.DelMsgOfBoth(fileid.ToString(), emid);
            }

            CanYou.OA.BLL.FileInfo file = new CanYou.OA.BLL.FileInfo(fileid);
            string fileName             = file.FileName;

            //获取桌面路径
            //string DeskPath = Convert.ToString(System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
            //string DeskPath = Server.MapPath("~\\Files\\File");
            DownLoads(fileName);
        }