Datagrid cell edit event
So I have a datagrid that I populate by a LINQ query:
public class dataservice
{
[OperationContract]
public List<LightOrder> GetOrder(string code)
{
// Add your operation implementation here
using (amazonproscoutEntities context = new amazonproscoutEntities())
{
return (from c in context.AmazonSKUs
where c.MerchantSKU.StartsWith(code)
select new LightOrder()
{
SKU = c.MerchantSKU,
开发者_如何学C productname = c.ItemName,
asin = c.ASIN,
//ourprice = c.OurPrice,
bbprice = c.Price,
quantity= c.TotalQty,
rank = c.Rank,
}
).Take<LightOrder>(500).ToList<LightOrder>();
}
}
// Add more operations here and mark them with [OperationContract]
}
public class LightOrder
{
public string SKU { get; set; }
public string productname { get; set; }
public string itemnumber { get; set; }
public string asin { get; set; }
//public Nullable<decimal> ourprice { get; set; }
public string bbprice { get; set; }
public string w1 { get; set; }
public string w2 { get; set; }
public string w3 { get; set; }
public string w4 { get; set; }
public int quantity { get; set; }
public string pendingorder { get; set; }
public string afner { get; set; }
public string order { get; set; }
public string total { get; set; }
public string profit { get; set; }
public string percent { get; set; }
public string rank { get; set; }
}
My question is if I change the cost cell and I change order, and I want it to tell me the total, how do I go about doing that with out losing my datagrid or writing to the db?
You can create temporary variables.
double tempCost;
double tempOrder;
double tempTotal;
精彩评论