//////////////////////////////////////////////////////////////////////////////////////////// FOR SELLERS protected void ddSalesPpl_SelectedIndexChanged(object sender, EventArgs e) { GoDine a = new GoDine(); if (!(ddSalesPpl.SelectedValue.Contains("---sellers---"))) { Guid UserID = a.UserName_2_Guid(ddSalesPpl.SelectedValue); Guid SellerID = a.getSellerFromUser(UserID).SellerID; SellerStats seller = a.SellerSts(SellerID); decimal paid = a.getPaidToSeller(SellerID); lblPaidSalesAmount.Text = "Amount left to pay for this seller = " + (seller.owed - paid).ToString("0.00"); } else { tbPaidAmount.Text = ""; } }
protected void Set_Table_Filtered(string filterSeller) { GoDine GD = new GoDine(); DataTable dt; DataClassesAlbertDataContext db; db = new DataClassesAlbertDataContext(); dt = new DataTable("Sellers"); var Sellers = from sl in db.SalesIDs select sl; dt.Columns.Add("Email", typeof(string)); dt.Columns.Add("NumberOfSales", typeof(string)); dt.Columns.Add("%CurrentDealRate", typeof(string)); dt.Columns.Add("$TotalOfGiftCardsSold", typeof(string)); dt.Columns.Add("$TotalIncomeFromSales", typeof(decimal)); dt.Columns.Add("$WePaidThem", typeof(decimal)); dt.Columns.Add("CreationDate", typeof(DateTime)); dt.Columns.Add("SellerID", typeof(string)); foreach (var seller in Sellers) { MembershipUser user = Membership.GetUser(seller.UserID); String username = user.UserName; if (username.Contains(filterSeller)) { SellerStats stats = GD.SellerSts(seller.SellerID); DataRow tablerow = dt.NewRow(); tablerow["Email"] = username; tablerow["NumberOfSales"] = stats.numSales.ToString(); tablerow["%CurrentDealRate"] = seller.DealRate.ToString("0.00"); tablerow["$TotalOfGiftCardsSold"] = stats.sold.ToString("0.00"); tablerow["$TotalIncomeFromSales"] = stats.owed; tablerow["$WePaidThem"] = GD.getPaidToSeller(seller.SellerID); tablerow["CreationDate"] = user.CreationDate; tablerow["SellerID"] = seller.SellerID.ToString(); dt.Rows.Add(tablerow); } } Session["dt"] = dt; GV.DataSource = dt; GV.AllowSorting = true; GV.AllowPaging = true; GV.PageSize = 50; //GV.Columns["Money"].ItemStyle.HorizontalAlign = HorizontalAlign.Right; GV.DataBind(); }