Пример #1
0
 /// <summary>
 /// This method deletes a record in the table.
 /// Change this method to alter how records are deleted.
 /// </summary>
 /// <param name=entity>entity</param>
 public void Delete(ProfitMargin entity)
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     db.ProfitMargins.Attach(entity);
     db.ProfitMargins.Remove(entity);
     db.SubmitChanges();
 }
Пример #2
0
 /// <summary>
 /// This method updates a record in the table.
 /// Change this method to alter how records are updated.
 /// </summary>
 /// <param name=original_entity>original_entity</param>
 /// <param name=entity>entity</param>
 public void Update(ProfitMargin original_entity, ProfitMargin entity)
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     db.ProfitMargins.Attach(original_entity);
     original_entity.Name         = entity.Name;
     original_entity.Percentage   = entity.Percentage;
     original_entity.ModifiedDate = entity.ModifiedDate;
     db.SubmitChanges();
 }
Пример #3
0
 /// <summary>
 /// This method retrieves ProfitMargin by Company.
 /// Change this method to alter how records are retrieved.
 /// </summary>
 /// <param name=CompanyId>CompanyId</param>
 public IQueryable <ProfitMargin> GetProfitMarginByCompany(Int32 CompanyId)
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     return(db.ProfitMargins.Where(x => x.CompanyId == CompanyId));
 }
Пример #4
0
 /// <summary>
 /// This method retrieves a single ProfitMargin.
 /// Change this method to alter how that record is received.
 /// </summary>
 /// <param name=ProfitMarginId>ProfitMarginId</param>
 /// <param name=CompanyId>CompanyId</param>
 public ProfitMargin GetProfitMargin(Int32 ProfitMarginId, Int32 CompanyId)
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     return(db.ProfitMargins.Where(x => x.ProfitMarginId == ProfitMarginId && x.CompanyId == CompanyId).FirstOrDefault());
 }
Пример #5
0
 /// <summary>
 /// This method retrieves all ProfitMargins.
 /// Change this method to alter how records are retrieved.
 /// </summary>
 public IQueryable <ProfitMargin> GetAllProfitMargins()
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     return(db.ProfitMargins);
 }
Пример #6
0
 /// <summary>
 /// This method inserts a new record in the table.
 /// Change this method to alter how records are inserted.
 /// </summary>
 /// <param name=entity>entity</param>
 public void Insert(ProfitMargin entity)
 {
     Vivina.InfoControl.DataClasses.InfoControlDataContext db = DataManager.CreateContext <InfoControlDataContext>();
     db.ProfitMargins.Add(entity);
     db.SubmitChanges();
 }