Пример #1
0
 public SalesRepresentative Get(int id = 0)
 {
     CurtDevDataContext db = new CurtDevDataContext();
     SalesRepresentative rep = new SalesRepresentative();
     try {
         rep = db.SalesRepresentatives.Where(x => x.salesRepID.Equals(id)).FirstOrDefault<SalesRepresentative>();
     } catch { };
     return rep;
 }
Пример #2
0
 public SalesRepresentative Save(int id = 0, string name = "", string code = "")
 {
     CurtDevDataContext db = new CurtDevDataContext();
     SalesRepresentative rep = new SalesRepresentative();
     if (id > 0) {
         try {
             rep = db.SalesRepresentatives.Where(x => x.salesRepID.Equals(id)).First<SalesRepresentative>();
             rep.name = name.Trim();
             rep.code = code.Trim();
             db.SubmitChanges();
         } catch {}
     } else {
         rep = new SalesRepresentative {
             name = name.Trim(),
             code = code.Trim()
         };
         db.SalesRepresentatives.InsertOnSubmit(rep);
         db.SubmitChanges();
     }
     return rep;
 }
Пример #3
0
 partial void DeleteSalesRepresentative(SalesRepresentative instance);
Пример #4
0
 partial void UpdateSalesRepresentative(SalesRepresentative instance);
Пример #5
0
 partial void InsertSalesRepresentative(SalesRepresentative instance);