private void Retrieve_D() //----------------------- { //....Ref. Radial_Rev11_27OCT11: Col. CC - 'SplitLine' & GC - 'AntiRotation' BearingDBEntities pBearingDBEntities = new BearingDBEntities(); if (mD_Desig == null || mD_Desig == "") { return; } if (mUnit.System == clsUnit.eSystem.English) { var pProject = (from pRec in pBearingDBEntities.tblManf_Pin_D where pRec.fldD_Desig == mD_Desig select pRec.fldD).ToList(); if (pProject.Count > 0) { mD = mDB.CheckDBDouble(pProject[0]); //....Retrieved in "in" } } else if (mUnit.System == clsUnit.eSystem.Metric && mD_Desig.Contains("M")) { //....Not yet in the database. Parse the D_Desig string (e.g. M3) to get the dia in mm. mD = Convert.ToDouble(mD_Desig.Remove(0, 1)) / 25.4; //....1 in = 25.4 mm. } }
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); }