コード例 #1
0
        //=====================

        #region "DATABASE RELATED ROUTINE"

        public int AddRec_Accessories(string Proj_In, clsDB DB_In)
        //====================================================
        {
            int pCountRec = 0;

            try
            {
                string pFIELDS = "(fldProjectNo,fldTempSensor_Supplied,fldTempSensor_Name,fldTempSensor_Count," +
                                 "fldTempSensor_Type,fldWireClip_Supplied,fldWireClip_Count,fldWireClip_Size)";                                      //SB 10APR09

                string pINSERT = "INSERT INTO tblProject_Accessories";

                byte pTempSensor_Supplied = 0;
                if (mTempSensor.Supplied)
                {
                    pTempSensor_Supplied = 1;
                }
                else
                {
                    pTempSensor_Supplied = 0;
                }

                byte pWireClip_Supplied = 0;
                if (mWireClip.Supplied)
                {
                    pWireClip_Supplied = 1;
                }
                else
                {
                    pWireClip_Supplied = 0;
                }


                string pVALUES = "VALUES ('" + Proj_In + "',"
                                 + pTempSensor_Supplied + ",'"
                                 + mTempSensor.Name + "',"
                                 + mTempSensor.Count + ",'"
                                 + mTempSensor.Type.ToString() + "',"
                                 + pWireClip_Supplied + ","
                                 + mWireClip.Count + ",'"
                                 + mWireClip.Size.ToString() + "')";

                string pSQL = pINSERT + pFIELDS + pVALUES;

                pCountRec = DB_In.ExecuteCommand(pSQL);
            }
            catch (Exception pEXP)
            {
                MessageBox.Show("Add Record Error.\n" + pEXP.Message);
            }

            return(pCountRec);
        }
コード例 #2
0
        public clsSeal(clsUnit.eSystem UnitSystem_In, eType Type_In, clsDB DB_In, clsProduct CurrentProduct_In)
            : base(UnitSystem_In, Type_In, DB_In, CurrentProduct_In)
            //=====================================================================================================
        {
            //....Default Values:
            mDesign  = eDesign.Fixed;
            mLiningT = mc_DESIGN_LINING_THICK;

            //....Instantiate member object variables:
            mBlade         = new clsBlade();
            mDrainHoles    = new clsDrainHoles(this);
            mWireClipHoles = new clsWireClipHoles(this);
        }
コード例 #3
0
        public int UpdateRec_Accessories(string ProjNo_In, clsDB DB_In)
        //=============================================================
        {
            //....UPDATE Records.
            String pSET, pWHERE, pSQL;
            int    pCountRec = 0;

            try
            {
                byte pTempSensor_Supplied = 0;
                if (mTempSensor.Supplied)
                {
                    pTempSensor_Supplied = 1;
                }
                else
                {
                    pTempSensor_Supplied = 0;
                }

                byte pWireClip_Supplied = 0;
                if (mWireClip.Supplied)
                {
                    pWireClip_Supplied = 1;
                }
                else
                {
                    pWireClip_Supplied = 0;
                }


                pSET = " SET fldTempSensor_Supplied = " + pTempSensor_Supplied +
                       ", fldTempSensor_Name = '" + mTempSensor.Name +
                       "', fldTempSensor_Count = " + mTempSensor.Count +
                       ", fldTempSensor_Type = '" + mTempSensor.Type.ToString() +
                       "', fldWireClip_Supplied = " + pWireClip_Supplied +
                       ", fldWireClip_Count = " + mWireClip.Count +
                       ", fldWireClip_Size = '" + mWireClip.Size.ToString() + "'";

                pWHERE    = " WHERE fldProjectNo = '" + ProjNo_In + "'";
                pSQL      = "UPDATE tblProject_Accessories" + pSET + pWHERE;
                pCountRec = DB_In.ExecuteCommand(pSQL);
            }
            catch (Exception pEXP)
            {
                MessageBox.Show("Add Record Error.\n" + pEXP.Message);
            }

            return(pCountRec);
        }
コード例 #4
0
        public clsEndConfig(clsUnit.eSystem UnitSystem_In, eType Type_In,
                            clsDB DB_In, clsProduct CurrentProduct_In)
        //=================================================================
        {
            mUnit.System = UnitSystem_In;
            mType        = Type_In;

            mMountHoles = new clsMountHoles(this);

            mMat.Base         = "Bronze 660";
            mMat.LiningExists = false;
            mMat.Lining       = "None";

            mCurrentProduct = CurrentProduct_In;

            mDB = DB_In;
        }
コード例 #5
0
        public void RetrieveRec_Accessories(string ProjNo_In, clsDB DB_In)
        //================================================================
        {
            ////string pstrFIELDS, pstrFROM, pstrWHERE, pstrSQL;

            ////pstrFIELDS = "* ";
            ////pstrFROM = "FROM tblProject_Accessories ";
            ////pstrWHERE = "WHERE fldProjectNo = '" + ProjNo_In + "'";

            ////pstrSQL = "SELECT " + pstrFIELDS + pstrFROM + pstrWHERE;
            ////SqlConnection pConnection = new SqlConnection();   //SB 06JUL09

            ////SqlDataReader pDR = null;
            ////pDR = DB_In.GetDataReader(pstrSQL,ref pConnection);

            ////if (pDR.Read())
            ////{
            ////    mTempSensor.Supplied = DB_In.CheckDBBool(pDR, "fldTempSensor_Supplied");

            ////    if (mTempSensor.Supplied == true)        //PB 13APR09.
            ////    {
            ////        mTempSensor.Name = (eTempSensorName)Enum.Parse
            ////                           (typeof(eTempSensorName), DB_In.CheckDBString(pDR, "fldTempSensor_Name"));
            ////        mTempSensor.Count = DB_In.CheckDBInt(pDR, "fldTempSensor_Count");

            ////        mTempSensor.Type = (eTempSensorType)Enum.Parse
            ////                           (typeof(eTempSensorType), DB_In.CheckDBString(pDR, "fldTempSensor_Type"));
            ////    }


            ////    mWireClip.Supplied = DB_In.CheckDBBool(pDR, "fldWireClip_Supplied");

            ////    if (mWireClip.Supplied == true)           //PB 13APR09.
            ////    {
            ////        mWireClip.Count = DB_In.CheckDBInt(pDR, "fldWireClip_Count");
            ////        mWireClip.Size = (eWireClipSize)Enum.Parse
            ////                         (typeof(eWireClipSize),DB_In.CheckDBString(pDR, "fldWireClip_Size"));
            ////    }
            ////}

            ////pDR.Close();
            ////pDR = null;

            ////pConnection.Close();
        }
コード例 #6
0
ファイル: clsProduct.cs プロジェクト: anirbanmete/BearingCAD
        //....Class Constructor
        //public clsProduct(clsUnit.eSystem UnitSystem_In, clsBearing.eType Type_In, clsBearing_Radial_FP.eDesign Design_In,
        //                  clsEndConfig.eType [] EndConfigType_In, clsDB DB_In)
        ////================================================================================================================
        //{
        //    mUnit.System = UnitSystem_In;

        //    //Main Component.
        //    //---------------
        //    //
        //    if (Type_In == clsBearing.eType.Radial)
        //    {
        //        if (Design_In == clsBearing_Radial.eDesign.Flexure_Pivot)
        //        {
        //            mBearing = new clsBearing_Radial_FP(UnitSystem_In, Type_In, Design_In, DB_In, this);
        //        }
        //    }


        //    //End Configurations:
        //    //-------------------
        //    //
        //    mEndConfig = new clsEndConfig[2];
        //    for (int i = 0; i < 2; i++)
        //    {
        //        if (EndConfigType_In [i]== clsEndConfig.eType.Seal)                                 //....End Seal.
        //        {
        //            mEndConfig[i] = new clsSeal (UnitSystem_In, EndConfigType_In [i], DB_In, this);
        //        }
        //        else if (EndConfigType_In[i] == clsEndConfig.eType.Thrust_Bearing_TL)               //....End TB.
        //        {
        //            mEndConfig[i] = new clsBearing_Thrust_TL (UnitSystem_In, EndConfigType_In [i], DB_In, this);
        //        }
        //    }


        //    //Accessories.
        //    //---------------
        //    //
        //    mAccessories = new clsAccessories();
        //}


        public clsProduct(clsUnit.eSystem UnitSystem_In, clsDB DB_In)
        //===========================================================
        {
            //PB 23JAN13. At the time of instantiation of this object, the Bearing Type & Bearing Design, EndConfig [0,1] Types are
            //....known. Hence, instantiate mBearing & mEndConfig [0,1] using the above info. To be done in the future.

            //  Initialize.
            //  -----------
            //
            //....Unit System.
            mUnit        = new clsUnit();       //....Default unit = English (automatically).
            mUnit.System = UnitSystem_In;


            //....Bearing.
            //mBearing = new clsBearing_Radial_FP(clsUnit.eSystem.English, clsBearing.eType.Radial,
            //                                    clsBearing_Radial.eDesign.Flexure_Pivot, DB_In, this);

            mBearing = new clsBearing_Radial_FP(mUnit.System, clsBearing.eType.Radial,
                                                clsBearing_Radial.eDesign.Flexure_Pivot, DB_In, this);

            //....End Configurations:
            clsEndConfig.eType[] pEndConfig = new clsEndConfig.eType[2];

            for (int i = 0; i < pEndConfig.Length; i++)
            {
                pEndConfig[i] = clsEndConfig.eType.Seal;        //....Default cofigs = [Seal, Seal]
            }
            mEndConfig = new clsEndConfig[2];

            for (int i = 0; i < 2; i++)
            {
                mEndConfig[i] = new clsSeal(mUnit.System, pEndConfig[i], DB_In, this);
            }


            //....Accessories.
            mAccessories = new clsAccessories();
        }
コード例 #7
0
ファイル: clsDrill.cs プロジェクト: anirbanmete/BearingCAD
        public static Double D(String D_Desig_In)
        //========================================
        {
            //....Returns Diameter in inch.
            clsDB             pDB = new clsDB();
            BearingDBEntities pBearingDBEntities = new BearingDBEntities();
            Double            pD = 0.0F;

            if (D_Desig_In != null)
            {
                var pProject = (from pRec in pBearingDBEntities.tblManf_Drill where pRec.fldD_Desig == D_Desig_In select pRec.fldD).ToList();
                if (pProject.Count > 0)
                {
                    pD = pDB.CheckDBDouble(pProject[0]);
                }
                else if (!D_Desig_In.Contains("/"))
                {
                    pD = modMain.ConvTextToDouble(D_Desig_In);
                }
            }
            return(pD);
        }
コード例 #8
0
ファイル: clsUser.cs プロジェクト: anirbanmete/BearingCAD
        private void RetriveUserCredentials()
        //===================================
        {
            clsDB pDB = new clsDB();

            string pWHERE, pSQL;

            pSQL   = "SELECT * FROM tblUser ";
            pWHERE = "WHERE fldName ='" + mUserName + "'";
            pSQL   = pSQL + pWHERE;

            SqlConnection pConnection = new SqlConnection();       //SB 06JUL09

            SqlDataReader pDR = pDB.GetDataReader(pSQL, ref pConnection);

            if (pDR.Read())
            {
                mPassword  = pDB.CheckDBString(pDR, "fldPassword");
                mInitials  = pDB.CheckDBString(pDR, "fldInitials");
                mPrivilege = pDB.CheckDBString(pDR, "fldPrivilege");
            }
            pDR.Close();
            pConnection.Close();
        }
コード例 #9
0
 //....Class Constructor
 public clsBearing_Radial(clsUnit.eSystem UnitSystem_In, eType Type_In, eDesign Design_In, clsDB DB_In)
     : base(UnitSystem_In, Type_In, Design_In, DB_In)
     //====================================================================================================
 {
     mDesign = Design_In;
 }