public int UpdateClientInfo(JCHVRF.Model.New.Client ObjClient) { using (IDbConnection conn = new OleDbConnection(projectDB)) { string processQuery = @"Update Client set CompanyName=@CompanyName, ContactName=@ContactName, StreetAddress=@StreetAddress, Suburb=@Suburb, Town=@Town, Country=@Country, GPSPosition=@GPSPosition, Phone=@Phone, ContactEmail=@ContactEmail, IdNumber=@IdNumber Where ID=@ID "; int rowUpdated = conn.Execute(processQuery, new { CompanyName = ObjClient.CompanyName, ContactName = ObjClient.ContactName, StreetAddress = ObjClient.StreetAddress, Suburb = ObjClient.Suburb, Town = ObjClient.TownCity, Country = ObjClient.Country, GPSPosition = ObjClient.GpsPosition, Phone = ObjClient.Phone, ContactEmail = ObjClient.ContactEmail, IdNumber = ObjClient.IdNumber, Id = ObjClient.Id }); return(rowUpdated); } }
public int InsertClientInfo(JCHVRF.Model.New.Client ObjClient) { using (IDbConnection conn = new OleDbConnection(projectDB)) { string processQuery = @"INSERT INTO Client (CompanyName,ContactName,StreetAddress,Suburb,Town,Country,GPSPosition,Phone,ContactEmail,IdNumber) VALUES (@CompanyName,@ContactName,@StreetAddress,@Suburb,@Town,@Country,@GPSPosition,@Phone,@ContactEmail,@IdNumber)"; int isInserted = conn.Execute(processQuery, new { CompanyName = ObjClient.CompanyName, ContactName = ObjClient.ContactName, StreetAddress = ObjClient.StreetAddress, Suburb = ObjClient.Suburb, Town = ObjClient.TownCity, Country = ObjClient.Country, GPSPosition = ObjClient.GpsPosition, Phone = ObjClient.Phone, ContactEmail = ObjClient.ContactEmail, IdNumber = ObjClient.IdNumber, }); return(isInserted); } }