public void InsertLocation(Model.Location oData) { try { scb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = scb.ConnectionString; ddq.CommandText = "INSERT INTO TBL_LOCATION (LOCATION,STATUS) VALUES ('" + oData.LOCATION + "','" + oData.STATUS + "')"; ddq.ExecuteNonQuery(CommandType.Text); } catch (Exception ex) { } }
public void UpdateCategory(Model.Location oData) { try { scb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = scb.ConnectionString; ddq.CommandText = "UPDATE TBL_LOCATION SET LOCATION = '" + oData.LOCATION + "', STATUS = '" + oData.STATUS + "' WHERE [ID] = '" + oData.LOCATION_ID + "'"; ddq.ExecuteNonQuery(CommandType.Text); } catch (Exception ex) { } }
public Boolean isRecordExists(Model.Location oData) { try { scb.ConnectionString = sConnectionString; ddq = new DatabaseQuery.DBQuery(); ddq.ConnectionString = scb.ConnectionString; string sQuery = ""; sQuery = "SELECT * FROM TBL_LOCATION WHERE LOCATION = '" + oData.LOCATION + "'"; ddq.CommandText = sQuery; ds = ddq.GetDataset(CommandType.Text); return(ds.Tables[0].Rows.Count > 0 ? true : false); } catch (Exception ex) { return(true); } }