예제 #1
0
    protected void btnEnter_Click(object sender, EventArgs e)
    {
        if (tvwFolder.SelectedNode != null)
        {
            try
            {
                int?folderID = int.Parse(tvwFolder.SelectedNodeID);
                if (folderID.Value == 0)
                {
                    folderID = null;
                }
                List <string> ids = JsonToList <string>(CommonSerialize.Deserialize(hiddenFiles.Text).ToString());
                List <FineOffice.Modules.HD_Attachment> list = (from s in ids
                                                                select new FineOffice.Modules.HD_Attachment
                {
                    ID = int.Parse(s),
                    FolderID = folderID
                }).ToList();

                fileBll.Update(list);
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("refresh_File"));
            }
            catch (Exception ex)
            {
                Alert.ShowInParent(ex.Message);
            }
        }
    }
    protected void btnEnter_Click(object sender, EventArgs e)
    {
        int[]         selecteds = personGrid.SelectedRowIndexArray;
        List <string> ids       = JsonToList <string>(CommonSerialize.Deserialize(hiddenFiles.Text).ToString());

        List <FineOffice.Modules.HD_Attachment> list = new List <FineOffice.Modules.HD_Attachment>();

        foreach (int id in selecteds)
        {
            int personnelID = int.Parse(personGrid.DataKeys[id][0].ToString());
            if (personnelID == CookiePersonnel.ID)
            {
                continue;
            }
            foreach (string file in ids)
            {
                FineOffice.Modules.HD_Attachment newFile = new FineOffice.Modules.HD_Attachment
                {
                    ID       = int.Parse(file),
                    IsPublic = false,
                    SendID   = CookiePersonnel.ID,
                    SendTime = DateTime.Now,
                    Owner    = personnelID,
                };
                list.Add(newFile);
            }
        }

        fileBll.Add(list);
        PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
    }
예제 #3
0
    /// <summary>
    /// 批量移动文件到用户
    /// </summary>
    protected void btnCopyToPerson_Click(object sender, EventArgs e)
    {
        int[]         keys = fileGrid.SelectedRowIndexArray;
        List <string> ids  = new List <string>();

        for (int i = 0; i < keys.Length; i++)
        {
            ids.Add(fileGrid.DataKeys[keys[i]][0].ToString());
        }
        string files = CommonSerialize.Serialize(ListToJson(ids));

        copyPersonWin.Title     = "复制到共享硬盘";
        copyPersonWin.IFrameUrl = string.Format("../HardDisk/FrmCopyToPersonnel.aspx?files={0}", files);
        copyPersonWin.Hidden    = false;
    }
    /// <summary>
    /// 批量移动文件
    /// </summary>
    protected void btnMoveFile_Click(object sender, EventArgs e)
    {
        int[]         keys = fileGrid.SelectedRowIndexArray;
        List <string> ids  = new List <string>();

        for (int i = 0; i < keys.Length; i++)
        {
            ids.Add(fileGrid.DataKeys[keys[i]][0].ToString());
        }
        string files = CommonSerialize.Serialize(ListToJson(ids));

        moveWin.Title     = "移动文件至";
        moveWin.IFrameUrl = string.Format("../HardDisk/FrmMoveFiles.aspx?files={0}&ispublic={1}", files, "true");
        moveWin.Hidden    = false;
    }