コード例 #1
0
    protected void btnDownFile_Click(object sender, EventArgs e)
    {
        int id = int.Parse(fileGrid.DataKeys[fileGrid.SelectedRowIndex][0].ToString());

        FineOffice.Modules.HD_Attachment model = fileBll.GetModel(d => d.ID == id);
        this.OutputStream(model.AttachmentData, model.FileName, model.XType);
    }
コード例 #2
0
    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
    private void InitModule()
    {
        if (Request["id"] == null)
        {
            return;
        }
        int id = int.Parse(Request["id"].ToString());

        hiddenID.Text = id.ToString();
        FineOffice.Modules.HD_Attachment model = attacthmentBll.GetModel(d => d.ID == id);
        txtFileName.Text = model.FileName;
    }
コード例 #4
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         FineOffice.Modules.HD_Attachment model = attacthmentBll.GetModel(d => d.ID == int.Parse(hiddenID.Text));
         model.FileName = txtFileName.Text.Trim();
         attacthmentBll.Update(model);
         PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference("refresh_File"));
     }
     catch (Exception ex)
     {
         Alert.ShowInParent(ex.Message);
     }
 }