示例#1
0
 public CustomerFacility(Guid customerfacilityid, Address address, Territory territory, Customer customer)
 {
     this.customerfacilityid= customerfacilityid;
     this.address= address;
     this.territory= territory;
     this.customer= customer;
 }
示例#2
0
        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);
        }
示例#3
0
文件: Order.cs 项目: tsubik/SFASystem
 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;
 }
示例#4
0
        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;
        }
示例#5
0
 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;
 }