当前位置: 首页>>代码示例>>C#>>正文


C# DataBase.GetTrackers方法代码示例

本文整理汇总了C#中DataBase.GetTrackers方法的典型用法代码示例。如果您正苦于以下问题:C# DataBase.GetTrackers方法的具体用法?C# DataBase.GetTrackers怎么用?C# DataBase.GetTrackers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataBase的用法示例。


在下文中一共展示了DataBase.GetTrackers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: gridViewManageShopItemsBodyList_SelectedIndexChanging

 protected void gridViewManageShopItemsBodyList_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
 {
     Log.Debug("Select shop item");
     ListItemCollection items = dropDownListManageShopItemsBodyInputItems.Items;
     ListItemCollection shops = dropDownListManageShopItemsBodyInputShops.Items;
     TableCell tableCellDateTime = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[0];
     TableCell tableCellItemCount = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[1];
     TableCell tableCellItem = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[4];
     TableCell tableCellShop = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[5];
     Guid itemId = Guid.Empty;
     Guid shopId = Guid.Empty;
     foreach (var item in items)
     {
         string text = ((ListItem)(item)).Text;
         if (text.Equals(tableCellItem.Text.Trim()))
         {
             itemId = new Guid(((ListItem)(item)).Value);
             break;
         }
     }
     if (itemId == Guid.Empty)
     {
         Log.Warn("Failed to get item id!");
         return;
     }
     foreach (var shop in shops)
     {
         string text = ((ListItem)(shop)).Text;
         if (text.Equals(tableCellShop.Text.Trim()))
         {
             shopId = new Guid(((ListItem)(shop)).Value);
             break;
         }
     }
     if (shopId == Guid.Empty)
     {
         Log.Warn("Failed to get shop id!");
         return;
     }
     int numberOfItems = Misc.String2Number(tableCellItemCount.Text.Trim());
     string dateTimeOfShopItem = tableCellDateTime.Text.Trim();
     DateTime dateTime = DateTime.Parse(dateTimeOfShopItem);
     Guid shopItemId = shopItems.GetShopItemId(dateTime, itemId, shopId, numberOfItems);
     textBoxManageShopItemsBodyTrackersInputShopItem.Text = shopItemId.ToString();
     textBoxManageShopItemsBodyTrackersInputDateTime.Text = dateTimeOfShopItem;
     textBoxManageShopItemsBodyTrackersInputSoldCount.Text = "0";
     DataBase dataBase = new DataBase();
     DataSet dataSet = dataBase.GetTrackers(shopItemId);
     PopulateTrackers(dataSet);
     int soldCount = 0;
     foreach (DataRow row in dataSet.Tables[Misc.DataTableNameOfTrackers].Rows)
     {
         soldCount+=Misc.String2Number(row.ItemArray.GetValue(1).ToString());
     }
     labelManageShopItemsBodyTrackersStatsTotalNumber.Text = numberOfItems.ToString();
     labelManageShopItemsBodyTrackersStatsSoldNumber.Text = soldCount.ToString();
     TableCell tableCellGross = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[2];
     TableCell tableCellNet = gridViewManageShopItemsBodyList.Rows[e.NewSelectedIndex].Cells[3];
     labelManageShopItemsBodyTrackersStatsGrossReceivedNumber.Text =
         (soldCount*Double.Parse(tableCellGross.Text.Trim())).ToString();
     labelManageShopItemsBodyTrackersStatsNetReceivedNumber.Text =
         (soldCount*Double.Parse(tableCellNet.Text.Trim())).ToString();
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:63,代码来源:ManageShopItems.aspx.cs

示例2: LinkButtonManageShopItemsBodyTrackersInputAddClick

 protected void LinkButtonManageShopItemsBodyTrackersInputAddClick(object sender, EventArgs e)
 {
     string shopItem = textBoxManageShopItemsBodyTrackersInputShopItem.Text;
     string soldCount = textBoxManageShopItemsBodyTrackersInputSoldCount.Text;
     if (String.IsNullOrEmpty(shopItem) ||
         String.IsNullOrEmpty(textBoxManageShopItemsBodyTrackersInputDateTime.Text) ||
         String.IsNullOrEmpty(soldCount))
     {
         labelManageShopItemsStatus.Text = "Select shop item first!";
         return;
     }
     Guid shopItemId = new Guid(shopItem);
     Tracker tracker = new Tracker() {ShopItemId = shopItemId, SoldCount = Misc.String2Number(soldCount)};
     DataBase dataBase = new DataBase();
     dataBase.InsertTracker(tracker);
     DataSet dataSet = dataBase.GetTrackers(shopItemId);
     PopulateTrackers(dataSet);
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:18,代码来源:ManageShopItems.aspx.cs


注:本文中的DataBase.GetTrackers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。