Example #1
0
        public Int64 InsertUpdateKitDetails(bool bIsSaveKit_Asset = true)
        {
            Int64              nKitID       = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objValue     = null;
            Object             objStatus    = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nKitID", this.nKitID, ParameterDirection.InputOutput, SqlDbType.BigInt);
                oDBParameter.Add("@sKitName", this.sKitName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sKitCode", this.sKitCode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sKitAbbrivation", this.sKitAbbrivation, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sKitDescription", this.sKitDescription, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@kitBarcode", this.kitBarcode, ParameterDirection.Input, SqlDbType.Image);

                oDBAccess.OpenConnection(true);
                oDBAccess.Execute("lgsp_INUP_KitMaster", oDBParameter, out objValue);

                if (objValue != null)
                {
                    nKitID = Convert.ToInt64(objValue);
                }
                if (nKitID == 0)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nKitID);
                }
                if (nKitID != 0 && bIsSaveKit_Asset)
                {
                    foreach (KitAsset item in lstKitDetails)
                    {
                        oDBParameter.clear();
                        oDBParameter.Add("@nKitID", nKitID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@nKitAssetID", item.nKitAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@nAssetCodeID", item.nAssetCodeID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@nAssetID", item.nAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@nStatus", 0, ParameterDirection.InputOutput, SqlDbType.Int);

                        oDBAccess.Execute("lgsp_INUP_KitAssetAssociation", oDBParameter, out objStatus);
                        int nStatus = 0;
                        if (objValue != null)
                        {
                            nStatus = Convert.ToInt32(objStatus);
                        }
                        if (nStatus <= 0)
                        {
                            oDBAccess.RollBack();
                            oDBAccess.CloseConnection(true);
                            return(nStatus);
                        }
                        if (nStatus == 2)
                        {
                            oDBAccess.RollBack();
                            oDBAccess.CloseConnection(true);
                            return(nStatus);
                        }
                    }
                }
                oDBAccess.Commit();
            }
            catch (Exception ex)
            {
                oDBAccess.RollBack();
                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(nKitID);
        }
Example #2
0
        public Int64 UpdateAssetCode()
        {
            Int64 nStatus = 0;

            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objStatus    = null;

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

                oDBParameter.clear();
                oDBParameter.Add("@nKitID", this.nKitID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nKitAssetID", this.nKitAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetID", this.nAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetCodeID", this.nAssetCodeID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nStatus", 0, ParameterDirection.InputOutput, SqlDbType.Int);
                oDBAccess.OpenConnection(false);
                oDBAccess.Execute("lgsp_INUP_KitAssetAssociation", oDBParameter, out objStatus);
                oDBAccess.CloseConnection(false);
                if (objStatus != null)
                {
                    nStatus = Convert.ToInt32(objStatus);
                }
                if (nStatus <= 0)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nStatus);
                }
                if (nStatus == 2)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nStatus);
                }
                oDBAccess.Commit();
                oDBAccess.CloseConnection(true);
            }
            catch (Exception ex)
            {
                oDBAccess.RollBack();
                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(nStatus);
        }
        public Int64 InsertUpdatePartyMaster()
        {
            Int64              _nPartyID    = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objValue     = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nPartyID", this.nPartyID, ParameterDirection.InputOutput, SqlDbType.BigInt);
                oDBParameter.Add("@sPartyCode", this.sPartyCode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPartyName", this.sPartyName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPartyAbbrivation", this.sPartyAbbrivation, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@nPartyTypeID", this.nPartyTypeID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@sAddressLine1", this.sAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAddressLine2", this.sAddressLine2, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCity", this.sCity, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sState", this.sState, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPincode", this.sPincode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCountry", this.sCountry, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sEmail", this.sEmail, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sFax", this.sFax, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAllPhoneNo", this.sAllPhoneNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sBillToAddressLine1", this.sBillToAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sBillToAddressLine2", this.sBillToAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sBillToPincode", this.sBillToAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sShipToAddressLine1", this.sShipToAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sShipToAddressLine2", this.sShipToAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sShipToPincode", this.sShipToPincode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sGSTNO", this.sGSTNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPANNO", this.sPANNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sTANNO", this.sTANNo, ParameterDirection.Input, SqlDbType.VarChar);


                oDBAccess.OpenConnection(false);
                oDBAccess.Execute("lgsp_INUP_PartyMaster", oDBParameter, out objValue);
                oDBAccess.CloseConnection(false);
                if (objValue != null)
                {
                    _nPartyID = Convert.ToInt64(objValue);
                }
            }
            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(_nPartyID);
        }
Example #4
0
        public Int64 UpdateAssetCode()
        {
            Int64 nStatus = 0;

            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objStatus    = 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.Execute("lgsp_INUP_AssetCode", oDBParameter, out objStatus);
                oDBAccess.CloseConnection(false);
                if (objStatus != null)
                {
                    nStatus = Convert.ToInt32(objStatus);
                }
                if (nStatus <= 0)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nStatus);
                }
                if (nStatus == 2)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nStatus);
                }
                oDBAccess.Commit();
                //oDBAccess.CloseConnection(true);
            }
            catch (Exception ex)
            {
                oDBAccess.RollBack();
                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(nStatus);
        }
Example #5
0
        public Int64 InsertUpdateAsset(bool bIsSaveAsset_Code = true)
        {
            Int64              nAssetID     = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objValue     = null;
            Object             objStatus    = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nAssetID", this.nAssetID, ParameterDirection.InputOutput, SqlDbType.BigInt);
                oDBParameter.Add("@nCompanyID", this.nCompanyID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetMainTypeID", this.nAssetMainTypeID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetTypeID", this.nAssetTypeID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetTypeOneID", this.nAssetTypeOneID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetMaterialID", this.nAssetMaterialID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nAssetVendorID", this.nAssetVendorID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nDensityID", this.nDensityID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nColorID", this.nColorID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@sHSNCode", this.sHSNCode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAssetName", this.sAssetName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAssetAbbrivation", this.sAssetAbbrivation, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sDescription", this.sAssetDescription, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@dtIntroductionDate", this.dtIntroductionDate, ParameterDirection.Input, SqlDbType.DateTime);
                oDBParameter.Add("@dtReorderDate", this.dtReorderDate, ParameterDirection.Input, SqlDbType.DateTime);
                oDBParameter.Add("@sReorderDays", this.sReorderDays, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sReorderQuntity", this.sReorderQuntity, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sRate", this.sAssetRate, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sMake", this.sAssetMake, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sSizeOrCapacity", this.sAssetSizeOrCapacity, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sQuality", this.sAssetQuality, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sDimention", this.sAssetDimention, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWeight", this.sAssetWeight, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWattage", this.sWattage, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sSpan", this.sSpan, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAttachment", this.sAttachment, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAttachmentName", this.sAttachmentName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sLength", this.sLength, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCoreOrPole", this.sCoreOrPole, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sAmps", this.sAmps, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPlug", this.sPlug, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sPower", this.sPower, ParameterDirection.Input, SqlDbType.VarChar);

                oDBAccess.OpenConnection(true);
                oDBAccess.Execute("lgsp_INUP_AssetMaster", oDBParameter, out objValue);

                if (objValue != null)
                {
                    nAssetID = Convert.ToInt64(objValue);
                }
                if (nAssetID == 0)
                {
                    oDBAccess.RollBack();
                    oDBAccess.CloseConnection(true);
                    return(nAssetID);
                }
                if (nAssetID != 0)
                {
                    foreach (AssetCode item in lstAssetCode)
                    {
                        oDBParameter.clear();
                        oDBParameter.Add("@nAssetID", nAssetID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@nAssetCodeID", item.nAssetCodeID, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@sInitialCode", item.sInitialCode, ParameterDirection.Input, SqlDbType.VarChar);
                        oDBParameter.Add("@nSequenceNo", item.nSequenceNo, ParameterDirection.Input, SqlDbType.BigInt);
                        oDBParameter.Add("@sUniqueCode", item.sUniqueCode, ParameterDirection.Input, SqlDbType.VarChar);
                        oDBParameter.Add("@barcode", item.barcode, ParameterDirection.Input, SqlDbType.Image);
                        oDBParameter.Add("@dtShelfLife", item.dtShelfLife, ParameterDirection.Input, SqlDbType.DateTime);
                        oDBParameter.Add("@sShelfLifeUnit", item.sShelfLifeUnit, ParameterDirection.Input, SqlDbType.VarChar);
                        oDBParameter.Add("@dtRetirementDate", item.dtRetirementDate, ParameterDirection.Input, SqlDbType.DateTime);
                        oDBParameter.Add("@nStatus", 0, ParameterDirection.InputOutput, SqlDbType.Int);

                        oDBAccess.Execute("lgsp_INUP_AssetCode", oDBParameter, out objStatus);
                        int nStatus = 0;
                        if (objValue != null)
                        {
                            nStatus = Convert.ToInt32(objStatus);
                        }
                        if (nStatus <= 0)
                        {
                            oDBAccess.RollBack();
                            oDBAccess.CloseConnection(true);
                            return(nStatus);
                        }
                        if (nStatus == 2)
                        {
                            oDBAccess.RollBack();
                            oDBAccess.CloseConnection(true);
                            return(nStatus);
                        }
                    }
                }
                oDBAccess.Commit();
                //oDBAccess.CloseConnection(true);
            }
            catch (Exception ex)
            {
                oDBAccess.RollBack();
                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(nAssetID);
        }
        public Int64 InsertUpdateCompanyMaster()
        {
            Int64              _nCompanyID  = 0;
            DatabaseAccess     oDBAccess    = null;
            DatabaseParameters oDBParameter = null;
            Object             objValue     = null;

            try
            {
                oDBAccess    = new DatabaseAccess();
                oDBParameter = new DatabaseParameters();
                oDBParameter.clear();
                oDBParameter.Add("@nCompanyID", this.nCompanyID, ParameterDirection.InputOutput, SqlDbType.BigInt);
                oDBParameter.Add("@sCompanyName", this.sCompanyName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompanyCode", this.sCompanyCode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompAbbrivation", this.sCompAbbrivation, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@nCompanyTypeID", this.nCompanyTypeID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@sCompanySignatory", this.sCompSignatoryID, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompAddressLine1", this.sCompAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompAddressLine2", this.sCompAddressLine2, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompCity", this.sCompCity, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompState", this.sCompState, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompCountry", this.sCompCountry, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompPincode", this.sCompPincode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompEmail", this.sCompEmail, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompWebsite", this.sCompWebsite, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompAllPhoneNo", this.sCompAllPhoneNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompFax", this.sCompFax, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompHSN_SACCode", this.sCompHSN_SACCode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompGSTNo", this.sCompGSTNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sCompPANNo", this.sCompPANNo, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@dtCompanyFormedOn", this.dtCompanyFormedDate, ParameterDirection.Input, SqlDbType.DateTime);

                oDBParameter.Add("@sTransporterID", this.sTransporterID, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sTransDocumentDate", this.sTransDocumentDate, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sTransDocumentName", this.sTransDocumentName, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sTransDocumentNumber", this.sTransDocumentNumber, ParameterDirection.Input, SqlDbType.VarChar);

                oDBParameter.Add("@sWHAddressLine1", this.sWHAddressLine1, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHAddressLine2", this.sWHAddressLine2, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHCity", this.sWHCity, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHState", this.sWHState, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHCountry", this.sWHCountry, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHPincode", this.sWHPincode, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@nWHSupervisorID", this.nWHSupervisorID, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@sWHAllPhoneNo", this.sWHAllPhoneNo, ParameterDirection.Input, SqlDbType.VarChar);

                oDBParameter.Add("@imgCompHeader", this.imgCompHeader, ParameterDirection.Input, SqlDbType.Image);
                oDBParameter.Add("@imgCompFooter", this.imgCompFooter, ParameterDirection.Input, SqlDbType.Image);
                oDBParameter.Add("@imgTerms_Condition", this.imgTerms_Condition, ParameterDirection.Input, SqlDbType.Image);
                oDBParameter.Add("@sTerms_Condition", this.sTerms_Condition, ParameterDirection.Input, SqlDbType.VarChar);
                oDBParameter.Add("@nTerms_ConditionType", this.nTerms_ConditionType, ParameterDirection.Input, SqlDbType.Int);

                oDBParameter.Add("@nTransportationID", this.nCompTransportID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nWarehouseID", this.nCompWarehouseID, ParameterDirection.Input, SqlDbType.BigInt);
                oDBParameter.Add("@nImageID", this.nCompImageID, ParameterDirection.Input, SqlDbType.BigInt);

                oDBAccess.OpenConnection(false);
                oDBAccess.Execute("lgsp_INUP_CompanyMasters", oDBParameter, out objValue);
                oDBAccess.CloseConnection(false);
                if (objValue != null)
                {
                    _nCompanyID = Convert.ToInt64(objValue);
                }
            }
            catch (Exception ex)
            {
                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(_nCompanyID);
        }