コード例 #1
0
 private void GetAllRows()
 {
     if (Selection == null)
     {
         if (all)
         {
             collection = controller.FetchAll(OrderBy, OwnerColumn, OwnerID);
             numrows    = controller.FetchAllCount(OwnerColumn, OwnerID);
         }
         else
         {
             collection = controller.FetchAllPaged((PageNumber - 1) * PageSize, PageSize, OrderBy, OwnerColumn, OwnerID);
             numrows    = controller.FetchAllCount(OwnerColumn, OwnerID);
         }
     }
     else
     {
         StringBuilder columns = new StringBuilder();
         columns.Append("KODEBPJ");
         columns.Append('\0');
         columns.Append("KODEKELENGKAPAN");
         columns.Append('\0');
         collection = controller.FetchSelected(columns.ToString().Split(new char[] { '\0' }, StringSplitOptions.RemoveEmptyEntries),
                                               Selection,
                                               OrderBy,
                                               OwnerColumn, OwnerID);
         numrows   = collection.Count;
         Selection = null;
     }
 }
コード例 #2
0
    private void GetSearchRows()
    {
        string oCol = OwnerColumn;
        string oID  = OwnerID;
        IDictionary <string, object> par = new Dictionary <string, object>();

        if (func.IsAdminUser() || func.GetsAdvSecurityMethod(strTableName) == "2")
        {
            oCol = string.Empty;
            oID  = string.Empty;
        }
        if (MasterTable == "PBJ")
        {
            par.Add("KODEBPJ", this.Session[strTableName + "_masterkey1"]);
        }
        if (MasterTable == "KELENGKAPAN")
        {
            par.Add("KODEKELENGKAPAN", this.Session[strTableName + "_masterkey1"]);
        }
        if (string.IsNullOrEmpty(SearchField))
        {
            if (par.Count > 0)
            {
                collection = controller.FetchByAllParameters(SearchOption, SearchFor, (PageNumber - 1) * PageSize, PageSize, OrderBy, OwnerColumn, OwnerID, par);
                numrows    = controller.FetchByAllParametersCount(SearchOption, SearchFor, oCol, oID, par);
            }
            else
            {
                collection = controller.FetchByAllParameters(SearchOption, SearchFor, (PageNumber - 1) * PageSize, PageSize, OrderBy, OwnerColumn, OwnerID);
                numrows    = controller.FetchByAllParametersCount(SearchOption, SearchFor, oCol, oID);
            }
        }
        else
        {
            if (par.Count > 0)
            {
                collection = controller.FetchByParameter(SearchField, SearchOption, SearchFor, (PageNumber - 1) * PageSize, PageSize, OrderBy, OwnerColumn, OwnerID, par);
                numrows    = controller.FetchByParameterCount(SearchField, SearchOption, SearchFor, oCol, oID, par);
            }
            else
            {
                collection = controller.FetchByParameter(SearchField, SearchOption, SearchFor, (PageNumber - 1) * PageSize, PageSize, OrderBy, OwnerColumn, OwnerID);
                numrows    = controller.FetchByParameterCount(SearchField, SearchOption, SearchFor, oCol, oID);
            }
        }
    }
コード例 #3
0
 private void GetData()
 {
     if (mastertable == "PBJ")
     {
         IDictionary <string, object> par = new Dictionary <string, object>();
         par.Add("KODEBPJ", this.Session[strTableName + "_masterkey1"]);
         collection = controller.FetchForDetails(par, OrderBy, OwnerColumn, OwnerID);
         numrows    = controller.FetchForDetailsCount(par, OwnerColumn, OwnerID);
     }
     if (mastertable == "KELENGKAPAN")
     {
         IDictionary <string, object> par = new Dictionary <string, object>();
         par.Add("KODEKELENGKAPAN", this.Session[strTableName + "_masterkey1"]);
         collection = controller.FetchForDetails(par, OrderBy, OwnerColumn, OwnerID);
         numrows    = controller.FetchForDetailsCount(par, OwnerColumn, OwnerID);
     }
 }
コード例 #4
0
    private void GetAdvancedSearchRows()
    {
        string[] asearchfield = this.Request.Form.GetValues("asearchfield[]");
        if (asearchfield == null)
        {
            asearchfield = Asearchfield;
        }
        IDictionary <string, object> par = new Dictionary <string, object>();

        if (MasterTable == "PBJ")
        {
            Asearchfor["KODEBPJ"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("KODEBPJ", this.Session[strTableName + "_masterkey1"]);
        }
        if (MasterTable == "KELENGKAPAN")
        {
            Asearchfor["KODEKELENGKAPAN"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("KODEKELENGKAPAN", this.Session[strTableName + "_masterkey1"]);
        }
        string oCol = OwnerColumn;
        string oID  = OwnerID;

        if (func.IsAdminUser() || func.GetsAdvSecurityMethod(strTableName) == "2")
        {
            oCol = string.Empty;
            oID  = string.Empty;
        }
        if (par.Count > 0)
        {
            collection = controller.FetchForAdvancedSearch(asearchfield,
                                                           Asearchopt,
                                                           Asearchfor,
                                                           Asearchfor2,
                                                           Asearchnot,
                                                           (Asearchtype == "and"),
                                                           (PageNumber - 1) * PageSize,
                                                           PageSize,
                                                           OrderBy,
                                                           oCol, oID, par);

            numrows = controller.FetchForAdvancedSearchCount(asearchfield,
                                                             Asearchopt,
                                                             Asearchfor,
                                                             Asearchfor2,
                                                             Asearchnot,
                                                             (Asearchtype == "and"),
                                                             (PageNumber - 1) * PageSize,
                                                             PageSize,
                                                             OrderBy,
                                                             oCol, oID, par);
        }
        else
        {
            collection = controller.FetchForAdvancedSearch(asearchfield,
                                                           Asearchopt,
                                                           Asearchfor,
                                                           Asearchfor2,
                                                           Asearchnot,
                                                           (Asearchtype == "and"),
                                                           (PageNumber - 1) * PageSize,
                                                           PageSize,
                                                           OrderBy,
                                                           oCol, oID);

            numrows = controller.FetchForAdvancedSearchCount(asearchfield,
                                                             Asearchopt,
                                                             Asearchfor,
                                                             Asearchfor2,
                                                             Asearchnot,
                                                             (Asearchtype == "and"),
                                                             (PageNumber - 1) * PageSize,
                                                             PageSize,
                                                             OrderBy,
                                                             oCol, oID);
        }
    }