コード例 #1
0
 public string PutProperty(ClsAllProperties prProperty)
 {   // update
     try
     {
         int lcRecCount = ClsDbConnection.Execute("UPDATE PropertyInfo SET " +
                                                  "RegionName = @RegionName, PropertyAddress = @PropertyAddress, " +
                                                  "PropertyPrice = @PropertyPrice, PropertyDescription = @PropertyDesc, " +
                                                  "DateModified = @DateModified, IsAvailable = @IsAvailable, PropertyType = @PropertyType, " +
                                                  "PropertyArea = @PropertyArea, RateableValue = @RateableValue, PropertyTerm = @PropertyTerm, " +
                                                  "LetFee = @LetFee, Furnishing = @Furnishing " +
                                                  "WHERE PropertyId = @PropertyId",
                                                  preparePropertyParameters(prProperty));
         if (lcRecCount == 1)
         {
             return("One Property updated");
         }
         else
         {
             return("Unexpected artist update count: " + lcRecCount);
         }
     }
     catch (Exception ex)
     {
         return(ex.GetBaseException().Message);
     }
 }
コード例 #2
0
 public string DeleteProperty(string PropertyId)
 {
     try
     {
         int lcRecCount = ClsDbConnection.Execute(
             "DELETE FROM PropertyInfo WHERE PropertyId = @PropertyId", preparePropertyDeletionParameters(PropertyId));
         if (lcRecCount == 1)
         {
             return("One Property Deleted");
         }
         else
         {
             return("Unexpected property deletion count: " + lcRecCount);
         }
     }
     catch (Exception ex)
     {
         return(ex.GetBaseException().Message);
     }
 }
コード例 #3
0
 public string PostProperty(ClsAllProperties prProperty)
 {
     try
     {
         int lcRecCount = ClsDbConnection.Execute("INSERT INTO PropertyInfo " +
                                                  "(RegionName, PropertyAddress, PropertyPrice, PropertyDescription, DateModified, IsAvailable, PropertyType, PropertyArea, RateableValue, PropertyTerm, LetFee, Furnishing)" +
                                                  "VALUES (@RegionName, @PropertyAddress, @PropertyPrice, @PropertyDesc, @DateModified, @IsAvailable, @PropertyType, @PropertyArea, @RateableValue, @PropertyTerm, @LetFee, @Furnishing)",
                                                  preparePropertyParameters(prProperty));
         if (lcRecCount == 1)
         {
             return("Property Added");
         }
         else
         {
             return("Unexpected Property insert count" + lcRecCount);
         }
     }
     catch (Exception ex)
     {
         return(ex.GetBaseException().Message);
     }
 }