Exemplo n.º 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("NIP");
         columns.Append('\0');
         columns.Append("KODEPBJ");
         columns.Append('\0');
         collection = controller.FetchSelected(columns.ToString().Split(new char[] { '\0' }, StringSplitOptions.RemoveEmptyEntries),
                                               Selection,
                                               OrderBy,
                                               OwnerColumn, OwnerID);
         numrows   = collection.Count;
         Selection = null;
     }
 }
Exemplo n.º 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 == "AKTOR")
        {
            par.Add("NIP", this.Session[strTableName + "_masterkey1"]);
        }
        if (MasterTable == "PBJ")
        {
            par.Add("KODEPBJ", 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);
            }
        }
    }
Exemplo n.º 3
0
 private void GetData()
 {
     if (mastertable == "AKTOR")
     {
         IDictionary <string, object> par = new Dictionary <string, object>();
         par.Add("NIP", this.Session[strTableName + "_masterkey1"]);
         collection = controller.FetchForDetails(par, OrderBy, OwnerColumn, OwnerID);
         numrows    = controller.FetchForDetailsCount(par, OwnerColumn, OwnerID);
     }
     if (mastertable == "PBJ")
     {
         IDictionary <string, object> par = new Dictionary <string, object>();
         par.Add("KODEPBJ", this.Session[strTableName + "_masterkey1"]);
         collection = controller.FetchForDetails(par, OrderBy, OwnerColumn, OwnerID);
         numrows    = controller.FetchForDetailsCount(par, OwnerColumn, OwnerID);
     }
 }
Exemplo n.º 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 == "AKTOR")
        {
            Asearchfor["NIP"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("NIP", this.Session[strTableName + "_masterkey1"]);
        }
        if (MasterTable == "PBJ")
        {
            Asearchfor["KODEPBJ"] = (string)this.Session[strTableName + "_masterkey1"];
            par.Add("KODEPBJ", 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);
        }
    }