Пример #1
0
    public void BindGv()
    {
        string selectedValue = this.ddlScope.SelectedValue;
        bool   isGetAll      = true;

        if (this.ViewState["search"].ToString() == "0")
        {
            selectedValue = this.tvFile.SelectedValue;
            isGetAll      = false;
        }
        int count = this.fileInfoBll.GetListArray(string.Concat(new string[]
        {
            " where id='",
            selectedValue,
            "'and ( userCodes like '%",
            base.UserCode,
            "%' or userCodes='00000000' )and IsValid='false'  order by CreateTime desc"
        })).Count;

        if (count > 0)
        {
            this.btn_Search.Enabled = true;
            this.lblMsgAleave.Text  = "";
            int allFilesCount = FileInfoBll.GetAllFilesCount(selectedValue, base.UserCode, this.txtStartTime.Text, this.txtEndTime.Text, this.txtFileName.Text.Trim(), WebUtil.GetBSize(this.txtStartSize.Text), WebUtil.GetBSize(this.txtEndSize.Text), this.txtFileOwner.Text.Trim(), isGetAll);
            this.AspNetPager1.RecordCount = allFilesCount;
            DataTable allFiles = FileInfoBll.GetAllFiles(selectedValue, base.UserCode, this.txtStartTime.Text, this.txtEndTime.Text, this.txtFileName.Text.Trim(), WebUtil.GetBSize(this.txtStartSize.Text), WebUtil.GetBSize(this.txtEndSize.Text), this.txtFileOwner.Text.Trim(), isGetAll, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);
            Common2.BindGvTable(allFiles, this.gvFile, true);
            return;
        }
        this.gvFile.DataBind();
        this.btn_Search.Enabled = false;
        this.lblMsgAleave.Text  = "<div style='color:Red; margin-left:20px; margin-top:20px; '>您没有该目录的权限,请与系统管理员联系。</div>";
    }
Пример #2
0
 protected void DelFileAndAdjunct(System.Collections.Generic.List <string> lstId)
 {
     foreach (string current in lstId)
     {
         DataTable children = FileInfoBll.GetChildren(current);
         foreach (DataRow dataRow in children.Rows)
         {
             string text = dataRow["Id"].ToString();
             string a    = dataRow["FileType"].ToString();
             if (a == "0")
             {
                 string fileName = dataRow["FileNewName"].ToString();
                 this.fileInfoBll.Delete(text);
                 this.DelFile(fileName);
             }
             else
             {
                 System.Collections.Generic.List <string> lstId2 = new System.Collections.Generic.List <string>
                 {
                     text
                 };
                 this.DelFileAndAdjunct(lstId2);
             }
         }
         this.fileInfoBll.Delete(current);
     }
 }
Пример #3
0
    protected void btnDel_Click(object sender, System.EventArgs e)
    {
        string value = this.hfldPurchaseChecked.Value;

        System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(value);
        string text = "已成功删除,并放入回收站!";

        try
        {
            foreach (string current in listFromJson)
            {
                FileInfoBll.MoveRecycle(current);
            }
        }
        catch
        {
            text = "删除失败!";
        }
        base.RegisterLoadEvent(string.Concat(new object[]
        {
            "function() {alert('系统提示:\\n\\n",
            text,
            "');location='FileInfoList.aspx?id=",
            this.tvFile.SelectedValue,
            "&did=",
            this.ddlScope.SelectedValue,
            "&search=",
            this.ViewState["search"],
            "'}"
        }));
    }
Пример #4
0
    public void BindGv()
    {
        int recycleRecord = FileInfoBll.GetRecycleRecord(base.UserCode);

        this.AspNetPager1.RecordCount = recycleRecord;
        DataTable recycleInfo = FileInfoBll.GetRecycleInfo(base.UserCode, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);

        this.gvFile.DataSource = recycleInfo;
        this.gvFile.DataBind();
    }
Пример #5
0
    public void BindGv()
    {
        string selectedValue = this.tvFile.SelectedValue;
        int    flodersCount  = FileInfoBll.GetFlodersCount(selectedValue);

        this.AspNetPager1.RecordCount = flodersCount;
        DataTable folders = FileInfoBll.GetFolders(selectedValue, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);

        Common2.BindGvTable(folders, this.gvFile, true);
    }
Пример #6
0
    protected void DelDirectory(System.Collections.Generic.List <string> ids)
    {
        string    arrayToInStr      = StringUtility.GetArrayToInStr(ids.ToArray());
        DataTable repeatDirectoryId = FileInfoBll.GetRepeatDirectoryId(arrayToInStr);

        System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
        foreach (DataRow dataRow in repeatDirectoryId.Rows)
        {
            string item = dataRow["id"].ToString();
            list.Add(item);
        }
        if (repeatDirectoryId != null && repeatDirectoryId.Rows.Count > 0)
        {
            this.DelFileAndAdjunct(list);
        }
    }
Пример #7
0
    protected void btnRecover_Click(object sender, System.EventArgs e)
    {
        string value = this.hfldPurchaseChecked.Value;

        System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(value);
        try
        {
            foreach (string current in listFromJson)
            {
                FileInfoBll.Recover(current, base.UserCode);
            }
            base.RegisterScript("alert('系统提示:\\n\\n 恢复成功!');location=location;");
        }
        catch
        {
            base.RegisterScript("alert('系统提示:\\n\\n 恢复失败!');");
        }
    }
Пример #8
0
    protected void btnDel_Click(object sender, System.EventArgs e)
    {
        string value = this.hfldPurchaseChecked.Value;

        System.Collections.Generic.List <string> listFromJson = JsonHelper.GetListFromJson(value);
        try
        {
            foreach (string current in listFromJson)
            {
                FileInfoBll.MoveRecycle(current);
            }
            base.RegisterScript("alert('系统提示:\\n\\n 已成功删除,并放入回收站!');location='FileTypeList.aspx?id=" + this.tvFile.SelectedValue + "'");
        }
        catch
        {
            base.RegisterScript("alert('系统提示:\\n\\n 删除失败!');");
        }
    }
Пример #9
0
    protected void bindSelUser()
    {
        string a = base.Request["showType"];

        System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
        if (a == "1")
        {
            string        id          = base.Request["showId"];
            FileInfoBll   fileInfoBll = new FileInfoBll();
            FileInfoModel model       = fileInfoBll.GetModel(id);
            if (model != null)
            {
                list = this.getUserCodes(model.UserCodes);
            }
        }
        else
        {
            if (a == "2")
            {
                string            id2             = base.Request["showId"];
                PersonalFileBll   personalFileBll = new PersonalFileBll();
                PersonalFileModel model2          = personalFileBll.GetModel(id2);
                if (model2 != null)
                {
                    list = this.getUserCodes(model2.ShareUsers);
                    this.hfldNoSelCodes.Value = "00000000," + model2.FileOwner;
                }
            }
            else
            {
                if (a == "3")
                {
                    string progressId = base.Request["progressId"];
                    list = cn.justwin.BLL.ProgressManagement.Privilege.GetUserCodes(progressId);
                }
                else
                {
                    list = cn.justwin.BLL.Privilege.Privilege.GetUserCodes(base.Request["RelationsTable"], base.Request["RelationsKey"]);
                }
            }
        }
        this.hdId.Value = string.Join(",", list.ToArray()) + ",";
        this.AddUsers(list);
    }
Пример #10
0
    public static string imageUrl(FileInfoModel var, string usercode)
    {
        FileInfoBll fileInfoBll = new FileInfoBll();
        string      result;

        if (!var.UserCodes.Contains(usercode))
        {
            result = "/images/tree/FileInfo/folderSubtract2.png";
            if (fileInfoBll.GetListArray(" where parentId='" + var.Id + "' AND IsValid=0 ").Count > 0)
            {
                result = "/images/tree/FileInfo/folderAdd2.png";
            }
        }
        else
        {
            result = "/images/tree/FileInfo/folderSubtract.png";
            if (fileInfoBll.GetListArray(" where parentId='" + var.Id + "' AND IsValid=0 ").Count > 0)
            {
                result = "/images/tree/FileInfo/folderAdd.png";
            }
        }
        return(result);
    }