public DataTable GetRowsBySuppStatus(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_tblsupplier_getrows_bysuppstatus", parameters, ds))
            {
                throw new Exception("Fail to sp_sys_tblsupplier_getrows_bysuppstatus sp_sys_tblsupplier_getrows", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_tblsupplier_getrows_bysuppstatus. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
        public DataTable GetRowsAsForListCustomerPerSupplier(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_tblsupplier_getrows_asforlistcustomerpersupplier", parameters, ds))
            {
                throw new Exception("Fail to execute sp_sys_tblsupplier_getrows_asforlistcustomerpersupplier", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_tblsupplier_getrows_asforlistcustomerpersupplier. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #3
0
        public DataTable GetRowsAsForLeaseReject(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_company_getrows_asforleasereject", parameters, ds))
            {
                throw new Exception("Fail to execute sp_sys_company_getrows_asforleasereject", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_company_getrows_asforleasereject. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #4
0
        public DataTable GetRowByGroupCode(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_master_group_role_getrows_by_group_code", parameters, ds))
            {
                throw new Exception("Fail to execute sp_master_group_role_getrows_by_group_code", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_master_group_role_getrows_by_group_code. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
        public DataTable GetRowsTempBalanceGrid(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("xsp_Temp_HR_CUTI_KUOTA_getrows", parameters, ds))
            {
                throw new Exception("Fail to execute xsp_Temp_HR_CUTI_KUOTA_getrows", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to xsp_Temp_HR_CUTI_KUOTA_getrows. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #6
0
        public DataTable RentalAdjustmentLetterGetRow(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_rpt_ls_amortschedule2doc_getrow", parameters, ds))
            {
                throw new Exception("Fail to execute sp_rpt_ls_amortschedule2doc_getrow", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_rpt_ls_amortschedule2doc_getrow. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #7
0
        public DataTable GetRowsCHAsforIndustryCode(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_client_getrows_plusindustrycodechannelling", parameters, ds))
            {
                throw new Exception("Fail to execute sp_sys_client_getrows_plusindustrycodechannelling", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_client_getrows_plusindustrycodechannelling. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
        public DataTable GetRowsForLookUp(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_clientgroup_getrows_for_lookup", parameters, ds))
            {
                throw new Exception("Fail to execute sp_sys_clientgroup_getrows_for_lookup", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_clientgroup_getrows_for_lookup. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #9
0
        public object GetRowsTerminate(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_pl_amort_getrows_terminate", parameters, ds))
            {
                throw new Exception("Fail to execute sp_pl_amort_getrows_terminate", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_pl_amort_getrows_terminate. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #10
0
        public DataTable CheckName(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_sys_client_checkname", parameters, ds))
            {
                throw new Exception("Fail to execute sp_sys_client_checkname", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_sys_client_checkname. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #11
0
        public DataTable ValidateLogin(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_master_user_validate_login", parameters, ds))
            {
                throw new Exception("Fail to execute sp_master_user_validate_login", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Invalid user id/password.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #12
0
        public DataTable GetRowForGLinkFeeDetail(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_ls_tblglmiscfee_getrow_asforglinkfeedetail", parameters, ds))
            {
                throw new Exception("Fail to execute sp_ls_tblglmiscfee_getrow_asforglinkfeedetail", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_ls_tblglmiscfee_getrow_asforglinkfeedetail. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #13
0
        public DataTable GetRowsAsForChannelling(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_rpt_ch_akad_getrowsasforchannelling", parameters, ds))
            {
                throw new Exception("Fail to execute sp_rpt_ch_akad_getrowsasforchannelling", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_rpt_ch_akad_getrowsasforchannelling. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #14
0
        public DataTable GetRowsRenewalPolicies(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_rpt_ls_insreg_renewal_getrows", parameters, ds))
            {
                throw new Exception("Fail to execute sp_rpt_ls_insreg_renewal_getrows", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_rpt_ls_insreg_renewal_getrows. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #15
0
        public DataTable GetRowsForOperationReports(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_master_report_getrows_operationreport", parameters, ds))
            {
                throw new Exception("Fail to execute sp_master_report_getrows_operationreport", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_master_report_getrows_operationreport. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #16
0
        public DataTable GetRow(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_EmpGradeHistory_getrow", parameters, ds))
            {
                throw new Exception("Fail to execute sp_EmpGradeHistory_getrow", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_EmpGradeHistory_getrow. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #17
0
        public DataTable GetRow(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("SP_MST_JABATAN_GETROW", parameters, ds))
            {
                throw new Exception("Fail to execute SP_MST_JABATAN_GETROW", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to SP_MST_JABATAN_GETROW. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #18
0
        public DataRow GetRow(string TableName, string SPName, Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP(SPName, parameters, ds))
            {
                throw new Exception("Fail to execute " + SPName, new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to " + SPName + ". No row found.");
                }
                else
                {
                    return(ds.Tables[0].Rows[0]);
                }
            }
        }
Example #19
0
        public DataTable GetTarikData(string xsp, Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.OtherConnectionString;
            if (!dbw.ExecuteSP(xsp, parameters, ds))
            {
                throw new Exception("Fail to " + xsp, new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to " + xsp + ". No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #20
0
        //public object Insert(string sTableName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sTableName + SPInsertSuffix;

        //    if (!dbw.ExecuteSP(sp, htParameters))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }

        //    return true;
        //}

        //public object Insert(string sTableName, Hashtable htParameters, ref string oReturnValue)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sTableName + SPInsertSuffix;

        //    if (!dbw.ExecuteSP(sp, htParameters, ref oReturnValue))
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));

        //    return true;
        //}

        //public object Insert(string sTableName, Hashtable htParameters, ref int oReturnValue)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sTableName + SPInsertSuffix;

        //    if (!dbw.ExecuteSP(sp, htParameters, ref oReturnValue))
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));

        //    return true;
        //}

        //public object Update(string sTableName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sTableName + SPUpdateSuffix;

        //    if (!dbw.ExecuteSP(sp, htParameters))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }

        //    return true;
        //}

        //public object Update(string sTableName, string sSPName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sSPName;

        //    if (!dbw.ExecuteSP(sp, htParameters))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }

        //    return true;
        //}

        //public object Delete(string sTableName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    string sp = SPNamePrefix + sTableName + SPDeleteSuffix;

        //    if (!dbw.ExecuteSP(sp, htParameters))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }

        //    return true;
        //}

        //public DataRow GetRow(string sTableName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    DataSet ds = new DataSet();
        //    string sp = SPNamePrefix + sTableName + SPGetRowSuffix;


        //    if (!dbw.ExecuteSP(sp, htParameters, ds))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }
        //    else
        //    {
        //        if (ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
        //            throw new Exception("Fail to execute " + sp + ". No row found.");
        //        else
        //            return ds.Tables[0].Rows[0];
        //    }
        //}

        //public DataRow GetRow(string sTableName, string sSPName, Hashtable htParameters)
        //{
        //    DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
        //    DataSet ds = new DataSet();
        //    string sp = SPNamePrefix + sSPName;


        //    if (!dbw.ExecuteSP(sp, htParameters, ds))
        //    {
        //        throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
        //    }
        //    else
        //    {
        //        if (ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0)
        //            throw new Exception("Fail to execute " + sp + ". No row found.");
        //        else
        //            return ds.Tables[0].Rows[0];
        //    }
        //}

        public DataTable GetRows(string sTableName, Hashtable htParameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();
            //string sp = SPNamePrefix + sTableName + SPGetRowsSuffix;
            string sp = sTableName;


            if (!dbw.ExecuteSP(sp, htParameters, ds))
            {
                throw new Exception("Fail to execute " + sp, new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to execute " + sp + ". No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #21
0
        public DataTable ExecuteExcelReport(string spReportName, string spResultName, Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

            dbw.ConnectionString = Shared.ConnectionString;

            if (spReportName != null && spResultName != null)
            {
                if (dbw.ExecuteSP(spReportName, parameters))
                {
                    if (!dbw.ExecuteSP(spResultName, parameters, ds))
                    {
                        throw new Exception(spResultName, new Exception(dbw.DBErrorMessage));
                    }
                    else
                    {
                        if (ds.Tables.Count <= 0)
                        {
                            throw new Exception("Fail to " + spResultName + ". No row found.");
                        }
                        else
                        {
                            return(ds.Tables[0]);
                        }
                    }
                }
                else
                {
                    throw new Exception(spReportName);
                }
            }
            else if (spReportName == null)
            {
                if (!dbw.ExecuteSP(spResultName, parameters, ds))
                {
                    throw new Exception(spResultName, new Exception(dbw.DBErrorMessage));
                }
                else
                {
                    if (ds.Tables.Count <= 0)
                    {
                        throw new Exception("Fail to " + spResultName + ". No row found.");
                    }
                    else
                    {
                        return(ds.Tables[0]);
                    }
                }
            }
            else if (spResultName == null)
            {
                if (!dbw.ExecuteSP(spReportName, parameters))
                {
                    throw new Exception(spReportName, new Exception(dbw.DBErrorMessage));
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                return(null);
            }
        }