示例#1
0
        partial void Sale_Details_Updating(Sale_Detail entity)
        {
            var value = (from val in Sales
                         where val.Sale_ID.Equals(entity.Sale.Sale_ID)
                         select val).FirstOrDefault();

            value.Total = 0;
            entity.Sale = calculateTotal(value);        //if sale detail value is changed then
                                                        //recount total and update it.
        }
示例#2
0
 partial void Sale_Details_Inserted(Sale_Detail entity)
 {
     entity.Product.Stock_In_hand -= entity.Quantity;
     // subtracting the stock issued.
 }