Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                tb_AttachmentService attSer = new tb_AttachmentService();
                List <tb_Attachment> atts   = attSer.GetListArray("");
                gvList.DataSource = atts;
                gvList.DataBind();


                tb_FolderService folderSer = new tb_FolderService();
                List <tb_Folder> allFolder = folderSer.GetListArray("");
                allFolder.Insert(0, new tb_Folder());
                ddlFolders.DataSource = allFolder;
                ddlFolders.DataBind();
                ddlFolders.DataTextField  = "Folder_NAME";
                ddlFolders.DataValueField = "Folder_ID";

                #region 是否有删除功能
                if (Session["currentUserId"] != null)
                {
                    VAN_OA.Dal.TB_AdminDeleteService deleteSer = new VAN_OA.Dal.TB_AdminDeleteService();
                    if (deleteSer.CheckIsExistByUserId(Convert.ToInt32(Session["currentUserId"])) == false)
                    {
                        gvList.Columns[6].Visible = false;
                    }
                }
                #endregion
            }
        }
Example #2
0
        private void show()
        {
            try
            {
                string sql = " ";
                if (txtMainName.Text.Trim() != "")
                {
                    sql += string.Format(" and mainName like '%{0}%'", txtMainName.Text);
                }
                if (txtFrom.Text != "")
                {
                    if (CommHelp.VerifesToDateTime(txtFrom.Text) == false)
                    {
                        base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('创建时间 格式错误!');</script>");
                        return;
                    }
                    sql += string.Format(" and createTime>='{0} 00:00:00'", txtFrom.Text);
                }
                if (txtTo.Text != "")
                {
                    if (CommHelp.VerifesToDateTime(txtTo.Text) == false)
                    {
                        base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('创建时间 格式错误!');</script>");
                        return;
                    }
                    sql += string.Format(" and createTime<='{0} 23:59:59'", txtTo.Text);
                }

                if (ddlFolders.Text != "0")
                {
                    sql += string.Format(" and tb_Attachment.folder_Id={0}", ddlFolders.Text);
                }
                tb_AttachmentService attSer = new tb_AttachmentService();
                List <tb_Attachment> atts   = attSer.GetListArray(sql);
                gvList.DataSource = atts;
                gvList.DataBind();
            }
            catch (Exception)
            {
            }
        }