partial void DeleteGrucoxFTPTestSession(GrucoxFTPTestSession instance);
partial void InsertGrucoxFTPTestSession(GrucoxFTPTestSession instance);
partial void UpdateGrucoxFTPTestSession(GrucoxFTPTestSession instance);
public static bool StoreData_FTPTest_RemoteDB(DataClasses.FTPTestConcForward FTPTestConcForwards, int UserID) { DataClasses.GrucoxFTPTestSession FTPtest = new GrucoxFTPTestSession(); FTPtest.DeviceUID = (new Grucox.DataManager(CalibrationSettings.Default.DataManagerConnectionString)).GetDeviceMacAddress(); FTPtest.LiveUserID = UserID; FTPtest.SessionDate = DateTime.Now.Subtract(TimeSpan.FromMinutes(10)); FTPtest.FTPConcForwards = Convert.ToDecimal(FTPTestConcForwards.FTPConcForwards.Value); DataClasses.GrucoxDataClassesRemoteDBDataContext dc; var matchedItem = new object(); try { dc = new DataClasses.GrucoxDataClassesRemoteDBDataContext(); matchedItem = (from sessions in dc.GetTable<DataClasses.GrucoxFTPTestSession>() //************************************** where sessions.ItemID == FTPtest.ItemID //******Check if customer already exists select sessions).SingleOrDefault(); //************************************** } catch (Exception) { return false; } if (matchedItem == null) //If customer does not exist { try { dc.GrucoxFTPTestSessions.InsertOnSubmit(FTPtest); dc.GrucoxFTPTestSessions.Context.SubmitChanges(); //Add the new customer to the Customers Table return true; } catch (Exception ex) { return false; } } else //Customer already exists { try { dc.SubmitChanges(); return true; } catch (Exception ex) { return false; } } }