public CustomerFacility(Guid customerfacilityid, Address address, Territory territory, Customer customer) { this.customerfacilityid= customerfacilityid; this.address= address; this.territory= territory; this.customer= customer; }
public static void UpdateTerritory(Territory territory) { string sqlQuery = "UPDATE Territory SET ParentTerritoryID=@ParentTerritoryID, FullDescription=@FullDescription, Name=@Name WHERE TerritoryID='" + territory.TerritoryID+"'"; DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery); DBHelper.AddInParameter(dbCommand, "ParentTerritoryID", DbType.Guid, territory.ParentTerritoryID); DBHelper.AddInParameter(dbCommand, "FullDescription", DbType.String, territory.FullDescription); DBHelper.AddInParameter(dbCommand, "Name", DbType.String, territory.Name); DBHelper.ExecuteNonQuery(dbCommand); }
public Order(Guid orderid, CustomerFacility customerfacility, Territory territory, Employee employee, Dictionary orderstatus, string identifier, DateTime orderdate, decimal subtotal, decimal taxamount, decimal total) { this.orderid= orderid; this.customerfacility= customerfacility; this.territory= territory; this.employee= employee; this.orderstatus= orderstatus; this.identifier= identifier; this.orderdate= orderdate; this.subtotal= subtotal; this.taxamount= taxamount; this.total= total; }
public static Territory InsertTerritory(Territory territory) { string sqlQuery = "INSERT INTO Territory(TerritoryID,ParentTerritoryID,FullDescription,Name) " + " VALUES(@TerritoryID,@ParentTerritoryID,@FullDescription,@Name);SELECT @@Identity"; if (territory.TerritoryID == Guid.Empty) territory.TerritoryID = Guid.NewGuid(); else return null; DbCommand dbCommand = DBHelper.GetDBCommand(sqlQuery); DBHelper.AddInParameter(dbCommand, "TerritoryID", DbType.Guid, territory.TerritoryID); DBHelper.AddInParameter(dbCommand, "ParentTerritoryID", DbType.Guid, territory.ParentTerritoryID); DBHelper.AddInParameter(dbCommand, "FullDescription", DbType.String, territory.FullDescription); DBHelper.AddInParameter(dbCommand, "Name", DbType.String, territory.Name); return territory; }
private static Territory GetTerritoryFromReader(IDataReader dataReader) { Territory territory = new Territory(); territory.TerritoryID = DBHelper.GetGuid(dataReader, "TerritoryID"); territory.ParentTerritoryID = DBHelper.GetGuid(dataReader, "ParentTerritoryID"); territory.Name = DBHelper.GetString(dataReader, "Name"); territory.FullDescription = DBHelper.GetString(dataReader, "FullDescription"); return territory; }