Example #1
0
        public DataTable GetRow(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

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

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_ls_tblemployee_getrows", parameters, ds))
            {
                throw new Exception("Fail to execute sp_ls_tblemployee_getrows", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_ls_tblemployee_getrows. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #3
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 #4
0
        public DataTable LsApplicationOfferingLetterGetRow(Hashtable parameters)
        {
            DBWrapper dbw = DBWrapper.GetSqlClientWrapper();
            DataSet   ds  = new DataSet();

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

            dbw.ConnectionString = Shared.ConnectionString;
            if (!dbw.ExecuteSP("sp_reff_jenis_usaha_getrow", parameters, ds))
            {
                throw new Exception("Fail to execute sp_reff_jenis_usaha_getrow", new Exception(dbw.DBErrorMessage));
            }
            else
            {
                if (ds.Tables.Count <= 0)
                {
                    throw new Exception("Fail to sp_hr_jenjang_pendidikan_getrow. No row found.");
                }
                else
                {
                    return(ds.Tables[0]);
                }
            }
        }
Example #7
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 #8
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);
            }
        }