Example #1
0
        public DataSet GetLocationMaster()
        {
            DatabaseAccess     oDBAccess        = null;
            DatabaseParameters oDBParameter     = null;
            DataSet            _dsCompanyMaster = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_CSCMasterData", out _dsCompanyMaster);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(_dsCompanyMaster);
        }
Example #2
0
        public Int64 GetDeleteMasterType(int nMasterType, Int64 nID)
        {
            Int64              nSequencNo   = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nMasterType", nMasterType, ParameterDirection.Input, SqlDbType.Int);
                oDBParameter.Add("@nID", nID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Delete_MasterType", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    nSequencNo = Convert.ToInt64(_dt.Rows[0][0]);
                }
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(nSequencNo);
        }
Example #3
0
        public DataTable GetAssetCode()
        {
            DatabaseAccess oDBAccess   = null;
            DataTable      dtAssetCode = null;

            //DatabaseParameters oDBParameter = null;
            try
            {
                oDBAccess = new DatabaseAccess();
                //oDBParameter = new DatabaseParameters();

                //oDBParameter.clear();
                //oDBParameter.Add("@nAssetID", this.nAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                //oDBParameter.Add("@nAssetCodeID", this.nAssetCodeID, ParameterDirection.Input, SqlDbType.BigInt);
                //oDBParameter.Add("@sInitialCode", this.sInitialCode, ParameterDirection.Input, SqlDbType.VarChar);
                //oDBParameter.Add("@nSequenceNo", this.nSequenceNo, ParameterDirection.Input, SqlDbType.BigInt);
                //oDBParameter.Add("@sUniqueCode", this.sUniqueCode, ParameterDirection.Input, SqlDbType.VarChar);
                //oDBParameter.Add("@barcode", this.barcode, ParameterDirection.Input, SqlDbType.Image);
                //oDBParameter.Add("@dtShelfLife", this.dtShelfLife, ParameterDirection.Input, SqlDbType.DateTime);
                //oDBParameter.Add("@sShelfLifeUnit", this.sShelfLifeUnit, ParameterDirection.Input, SqlDbType.VarChar);
                //oDBParameter.Add("@dtRetirementDate", this.dtRetirementDate, ParameterDirection.Input, SqlDbType.DateTime);
                //oDBParameter.Add("@nStatus", 0, ParameterDirection.InputOutput, SqlDbType.Int);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_AllNotUsedAsset", out dtAssetCode);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
            }

            return(dtAssetCode);
        }
Example #4
0
        public Int64 GetSequenceNumber_Transaction(TransactionType oTransactionType)
        {
            Int64              nSequencNo   = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nTransactionType", oTransactionType.GetHashCode(), ParameterDirection.Input, SqlDbType.Int);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_SequenceNoTransaction", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
                if (_dt != null && _dt.Rows.Count > 0)
                {
                    nSequencNo = Convert.ToInt64(_dt.Rows[0][0]);
                }
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(nSequencNo);
        }
Example #5
0
        public DataTable GetLocationInformation(Int64 nLocationID)
        {
            DataSet            ds           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nLocationID", nLocationID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_LocationDetails", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(_dt);
        }
Example #6
0
        public DataTable GetMasterTypeDataBbValue(Int32 nMasterType, string sSearchString = "")
        {
            DataTable          dt           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nMasterType", nMasterType, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@sSearchString", sSearchString, ParameterDirection.Input, SqlDbType.VarChar);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_AllMastersData_Search", oDBParameter, out dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }
            return(dt);
        }
Example #7
0
        public DataTable GetKitAssetList(Int64 nKitID = 0)
        {
            DataTable          dt           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nKitID", nKitID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_KitAssetList", oDBParameter, out dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(true);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }
            return(dt);
        }
Example #8
0
        public DataSet GetAllMasterData_ByMainType(Int64 nAssetMainType)
        {
            DataSet            ds           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nAssetType", nAssetMainType, ParameterDirection.Input, SqlDbType.BigInt);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_AssetMasterData_ByMainType", oDBParameter, out ds);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }
            return(ds);
        }
        public DataTable GetListData(string sListType)
        {
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            DataTable          _dt          = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@sListType", sListType, ParameterDirection.Input, SqlDbType.VarChar);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_Get_ListData", oDBParameter, out _dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal.MessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }

            return(_dt);
        }
Example #10
0
        public DataTable GetAssetMainMasterType(Int32 nAssetType = 0)
        {
            DataTable          dt           = null;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nAssetType", nAssetType, ParameterDirection.Input, SqlDbType.VarChar);
                oDBAccess.OpenConnection(false);
                oDBAccess.Retrive("lgsp_getAssetMasterList", oDBParameter, out dt);
                oDBAccess.CloseConnection(false);
            }
            catch (Exception ex)
            {
                oDBAccess.CloseConnection(false);
                MessageBox.Show("Error: " + ex.ToString(), clsGlobal._sMessageboxCaption, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            finally
            {
                if (oDBAccess != null)
                {
                    oDBAccess.Dispose();
                    oDBAccess = null;
                }
                if (oDBParameter != null)
                {
                    oDBParameter.Dispose();
                    oDBParameter = null;
                }
            }
            return(dt);
        }