Ejemplo n.º 1
0
 public int SetShopItem(ShopItem item)
 {
     return JaneShopItemsDao.SetShopItem(item);
 }
Ejemplo n.º 2
0
        internal static int SetShopItem(ShopItem item)
        {
            if (item == null) return -1;

            SafeProcedure.ExecuteNonQuery(
             Database.GetDatabase(JaneDefine.DBInstanceName),
             "dbo.Shop_items_Set",
             delegate(IParameterSet parameters)
             {
                 parameters.AddWithValue("@Id", item.Id);
                 parameters.AddWithValue("@name", item.Name);
                 parameters.AddWithValue("@description", item.Description);
                 parameters.AddWithValue("@body", item.Body);
                 parameters.AddWithValue("@price", item.Price);
                 parameters.AddWithValue("@SImage", item.SImage);
                 parameters.AddWithValue("@LImage", item.LImage);
                 parameters.AddWithValue("@PublishDate", item.PublishDate);
                 parameters.AddWithValue("@AddUserId", item.AddUserID);
                 parameters.AddWithValue("@Status", (int)(item.Status));
                 parameters.AddWithValue("@Hits", (int)(item.Hits));
                 parameters.AddWithValue("@BaseCountEachdeliver", (int)(item.BaseCountEachdeliver));
                 parameters.AddWithValue("@Weight", item.Weight);
                 parameters.AddWithValue("@RetVal", DBNull.Value, ParameterDirectionWrap.ReturnValue);

             },
             delegate(IParameterSet outputParameters)
             {
                 item.Id = Convert.ToInt32(outputParameters.GetValue("@RetVal"));
             });

            return item.Id;
        }
Ejemplo n.º 3
0
 internal static ShopItem GetShopItem(int id, int hits)
 {
     ShopItem m = new ShopItem(id);
     if (id > 0)
     {
         SafeProcedure.ExecuteAndMapRecords(
                 Database.GetDatabase(JaneDefine.DBInstanceName),
              "dbo.Shop_items_Get",
              delegate(IRecord record)
              {
                  m.Id = record.GetInt32OrDefault(0, 0);
                  m.Name = record.GetStringOrEmpty(1);
                  m.Description = record.GetStringOrEmpty(2);
                  m.Price = record.GetDouble(3);
                  m.SImage = record.GetStringOrEmpty(4);
                  m.LImage = record.GetStringOrEmpty(5);
                  m.PublishDate = record.GetDateTimeOrEmpty(6);
                  m.AddUserID = record.GetInt32OrDefault(7, 0);
                  m.AddDate = record.GetDateTime(8);
                  m.Status = (PublishStatus)(record.GetInt32OrDefault(9, 0));
                  m.Body = record.GetStringOrEmpty(10);
                  m.Hits = record.GetInt32OrDefault(11,0);
                  m.BaseCountEachdeliver = record.GetInt32OrDefault(12, 5);
                  m.Weight = record.GetDouble(13);
              },
              id, hits);
     }
     return m;
 }
Ejemplo n.º 4
0
 internal static void MapList(IRecord record, List<ShopItem> list)
 {
     ShopItem m = new ShopItem();
     m.Id = record.GetInt32OrDefault(0, 0);
     m.Name = record.GetStringOrEmpty(1);
     m.Description = record.GetStringOrEmpty(2);
     m.Price = record.GetDouble(3);
     m.SImage = record.GetStringOrEmpty(4);
     m.LImage = record.GetStringOrEmpty(5);
     m.PublishDate = record.GetDateTimeOrEmpty(6);
     m.AddUserID = record.GetInt32OrDefault(7, 0);
     m.AddDate = record.GetDateTime(8);
     m.Status = (PublishStatus)(record.GetInt32OrDefault(9, 0));
     m.Body = record.GetStringOrEmpty(10);
     m.Hits = record.GetInt32OrDefault(11, 0);
     m.BaseCountEachdeliver = record.GetInt32OrDefault(12, 5);
     m.Weight = record.GetDouble(13);
     list.Add(m);
 }