コード例 #1
0
    void LoadData(string filename = "", string no = "", string field = "")
    {
        Database db = new Database();

        string where = "where 1=1 ";
        if (!string.IsNullOrWhiteSpace(filename))
        {
            where += " and Files.title like '%' + @title + '%' ";
            db.AddParameter("@title", filename);
        }

        if (!string.IsNullOrWhiteSpace(no))
        {
            where += " and Files.[no] like '%' + @no + '%' ";
            db.AddParameter("@no", no);
        }

        if (!field.Equals("-1") && !string.IsNullOrWhiteSpace(field))
        {
            where += " and Files.[field] = @Field ";
            db.AddParameter("@Field", field);
        }

        string sql = "Select Files.*,FileType.Title as TypeName,FileTarget.Title as TargetName,FileStatus.Title as StatusName,FileSecurity.Title as SecurityName from ((((Files left join AdminUsers on (Files.AddedBy=AdminUsers.Id) inner join fileType on (Files.type=FileType.id) ) inner join FileTarget on (Files.Target=FileTarget.Id) ) inner join FileStatus on (files.Status=FileStatus.Id)) inner join FileSecurity on (Files.Security=FileSecurity.Id))" + where + " Order By Files.Id desc";

        System.Data.DataSet ds = db.ExecuteDataSet(sql);
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #2
0
    void LoadData(string title = "", string no = "", string type = "")
    {
        Database db = new Database();

        string where = " 1=1 ";
        if (!string.IsNullOrWhiteSpace(title))
        {
            where += " and Document.title like '%' + @title + '%' ";
            db.AddParameter("@title", title);
        }

        if (!string.IsNullOrWhiteSpace(no))
        {
            where += " and Document.no like '%' + @no + '%' ";
            db.AddParameter("@no", no);
        }

        if (!string.IsNullOrWhiteSpace(type) && !type.Equals("-1"))
        {
            where += " and Document.category=@category ";
            db.AddParameter("@category", type);
        }

        string sql = "Select Document.*,Cat1.title as CatName,cat2.title as SecName,cat3.title as LegalName from (((Document left join category as cat1 on (Document.Category=cat1.id)) left join category as cat2 on (Document.Security=cat2.id)) left join category as cat3 on (document.LegalStaus=cat3.id))  where " + where + " Order By Document.Id desc";

        System.Data.DataSet ds = db.ExecuteDataSet(sql);
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #3
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select * from " + tablename + " Order by id");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #4
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select files.title as filename,users.name as username,FileComment.* from ((FileComment inner join users on (FileComment.UserId=Users.id)) inner join files on (FileComment.FileId=files.id))  Order By FileComment.AddDate desc");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #5
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("Select * from users order by id desc");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #6
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select files.title as filename,users.name as username,category.title as ctitle,Filenotice.* from ((FileNotice inner join users on (FileNotice.UserId=Users.id)) inner join files on (FileNotice.FileId=files.id)) inner join category on (FileNotice.rason=category.id) Order By FileNotice.AddDate desc");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #7
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select Researcher.*,country.name as countryName from " + tablename + " inner join country on (Researcher.Country=Country.Id) order by Researcher.IsAproved desc, Researcher.Lang,Researcher.country" + ";" + "");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #8
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select Library.*,ResearchType.Title as TypeName from " + tablename + " inner join ResearchType on (Library.Type=ResearchType.Id) order by Library.Lang,Library.Type" + ";" + "");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #9
0
    void LoadData()
    {
        Database db = new Database();

        System.Data.DataSet ds = db.ExecuteDataSet("select users.username,users.name,msg.* from " + tablename + " inner join users on (Msg.[From] = Users.Id) where isnull(msg.ToId,-1)=-1 Order By Msg.Adddate desc");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
    }
コード例 #10
0
    void LoadData()
    {
        Database db = new Database();

        db.AddParameter("@id", Request.QueryString["id"]);
        System.Data.DataSet ds = db.ExecuteDataSet("select f1.title,f1.no,cd.* from (ConectedDoc as cd inner join  files as f1  on (cd.DetailDocId=f1.id))   where cd.masterDocId=@id");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
        name        += " - " + db.GetProName("Files", "Title", "id", Request.QueryString["id"]);
    }
コード例 #11
0
    void LoadData()
    {
        Database db = new Database();

        db.AddParameter("@id", Request.QueryString["id"]);
        System.Data.DataSet ds = db.ExecuteDataSet("select * from " + tablename + " where ResearcherId=@id");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
        name        += " " + db.GetProName("Researcher", "name", "id", Request.QueryString["id"]);
    }
コード例 #12
0
    void LoadData()
    {
        Database db = new Database();

        db.AddParameter("@id", Request.QueryString["id"]);
        System.Data.DataSet ds = db.ExecuteDataSet("select * from FilesAttach   where FilesAttach.FileId=@id");
        RepeaterLists.DataSource = ds.Tables[0];
        RepeaterLists.DataBind();
        Cache["dt1"] = ds.Tables[0];
        name        += " - " + db.GetProName("Files", "Title", "id", Request.QueryString["id"]);
    }
コード例 #13
0
 protected void ListView1_PagePropertiesChanged(object sender, EventArgs e)
 {
     if (Cache["dt1"] != null)
     {
         RepeaterLists.DataSource = (System.Data.DataTable)Cache["dt1"];
         RepeaterLists.DataBind();
     }
     else
     {
         LoadData();
     }
     CheckBox10.Checked = false;
 }