Exemplo n.º 1
0
 /// <summary>
 /// Delete a zip code
 /// </summary>
 public virtual void DeleteDeliveryAreaZipCode(DeliveryZipCode zip)
 {
     string sql = "EXEC DeliveryAreas_DeleteZipCode @AreaId";
     var sqlParams = new List<SqlParameter>
     {
         new SqlParameter("AreaId", zip.AreaId)
     };
     _dbContext.ExecuteSqlCommand(sql, false, null, sqlParams.ToArray());
 }
Exemplo n.º 2
0
        public ActionResult UpdateDeliveryZipCode(DataSourceRequest command, DeliveryZipCode data)
        {
            if (!_permissionService.Authorize(StandardPermissionProvider.ManageShippingSettings))
                return AccessDeniedView();

            try
            {
                _shippingService.UpdateDeliveryAreaZipCode(data);
                return new HttpStatusCodeResult(200);
            }
            catch
            {
                return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Edit a zip code
 /// </summary>
 public virtual void UpdateDeliveryAreaZipCode(DeliveryZipCode zip)
 {
     string sql = "EXEC DeliveryAreas_UpdateZipCode @AreaId, @CityId, @Name, @ZipCode, @StateProvinceId, @ShippingChargeAmount";
     var sqlParams = new List<SqlParameter>
     {
         new SqlParameter("AreaId", zip.AreaId),
         new SqlParameter("CityId", zip.CityId), 
         new SqlParameter("Name", zip.Name), 
         new SqlParameter("ZipCode", zip.ZipCode),
         new SqlParameter("StateProvinceId", zip.StateProvinceId),
         new SqlParameter("ShippingChargeAmount", zip.ShippingChargeAmount)
     };
     _dbContext.ExecuteSqlCommand(sql, false, null, sqlParams.ToArray());
 }