本文整理汇总了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();
}
示例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);
}