public bool IsRecordExist(EntityTestPara entDept) { bool flag = false; try { tblTestPara obj = (from tbl in objData.tblTestParas where tbl.IsDelete == false && tbl.TestId.Equals(entDept.TestId) && tbl.ParaName.ToUpper().ToString().Trim().Equals(entDept.ParaName.ToUpper().ToString().Trim()) select tbl).FirstOrDefault(); if (obj != null) { flag = true; } else { flag = false; } } catch (Exception ex) { throw ex; } return(flag); }
public int InsertTestWithPara(EntityTestPara entDept) { try { tblTestPara obj = new tblTestPara() { TestId = entDept.TestId, ParaName = entDept.ParaName, MinPara = entDept.MinPara, MaxPara = entDept.MaxPara }; objData.tblTestParas.InsertOnSubmit(obj); objData.SubmitChanges(); return(1); } catch (Exception ex) { throw ex; } }
public int UpdatePara(EntityTestPara entDept) { try { tblTestPara test = (from tbl in objData.tblTestParas where tbl.IsDelete == false && tbl.TstParID == entDept.TstParID select tbl).FirstOrDefault(); test.TestId = entDept.TestId; test.ParaName = entDept.ParaName; test.MinPara = entDept.MinPara; test.MaxPara = entDept.MaxPara; objData.SubmitChanges(); return(1); } catch (Exception ex) { throw ex; } }