partial void DeleteSalesID(SalesID instance);
 partial void InsertSalesID(SalesID instance);
 partial void UpdateSalesID(SalesID instance);
Exemple #4
0
    ///*****SALES FUNCTIONS*****\\\
    // Returns Guid if success, a blank Guid if problems
    public Guid Generate_Sales_ID(Guid newUserId)
    {
        Guid result = new Guid();
        try
        {
             Guid newGuid = generateUniqueSalesID();
             SalesID sid = new SalesID
            {
                UserID = newUserId,
                SellerID = newGuid,
                DealRate = 5
            };

            db.SalesIDs.InsertOnSubmit(sid);
            db.SubmitChanges();
            result = newGuid;
        }
        catch (Exception e)
        {
            result = new Guid();
            log.Debug("There was an error while saving the new sales ID. Error occurs at '{0}' " + e);
        }
        return result;
    }