Exemplo n.º 1
0
 /// <summary>
 /// 添加新销售订单主从表信息
 /// </summary>
 /// <param name="so">主表对象</param>
 /// <param name="sdlist">从表对象</param>
 /// <returns></returns>
 public bool AddNewSaleOrder(T_saleorder so, List <T_saledetail> sdlist)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(so).State = EntityState.Added;
         db.SaveChanges();
         foreach (var sd in sdlist)
         {
             sd.soid            = so.id;
             db.Entry(sd).State = EntityState.Added;
         }
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 2
0
 internal void updateSupplier(T_Suppliers supplier)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 3
0
 internal void DelCustomerAddress(T_Customer_address address)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(address).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// 添加新销售订单主表
 /// </summary>
 /// <param name="so">销售订单主表</param>
 /// <returns></returns>
 public bool AddNewSaleOrder(T_saleorder so)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(so).State = EntityState.Added;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 5
0
 public bool UpdateProduct(T_Product product)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(product).State = EntityState.Modified;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 6
0
 internal void UpdateCustomerAddress(T_Customer_address address)
 {
     using (var db = new MEMSContext())
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// 添加新的报价单产品明细
 /// </summary>
 /// <param name="qtprice"></param>
 public bool AddNewQtPrice(QtProduct qtprice)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry <T_quotationprice>(qtprice.qp).State = EntityState.Added;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 8
0
 internal void UpdateCustomerContacts(T_Customer_contacts contact)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(contact).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 9
0
 /// <summary>
 /// 删除报价单
 /// </summary>
 /// <param name="qt"></param>
 /// <returns></returns>
 public bool DeleteQuotation(T_quotation qt)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(qt).State = EntityState.Deleted;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 10
0
 /// <summary>
 /// 添加新的报价单
 /// </summary>
 /// <param name="newqt"></param>
 /// <returns></returns>
 public bool AddNewQuotation(T_quotation newqt)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(newqt).State = EntityState.Added;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 11
0
 internal void editCustomer(T_Customer customer)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Exemplo n.º 12
0
 internal void DelSupplierContacts(T_Suppliers_contacts contact)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(contact).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 13
0
 public bool DeleteCraft(T_Crafts craft)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(craft).State = EntityState.Deleted;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 14
0
 internal void delCustomer(T_Customer customer)
 {
     using (MEMSContext db = new MEMSContext())
     {
         //db.T_Customer.Remove(customer);
         var entityentry = db.Entry(customer);
         entityentry.State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
Exemplo n.º 15
0
 public bool UpdateSaleDetail(List <T_saledetail> sdlst)
 {
     using (MEMSContext db = new MEMSContext())
     {
         foreach (var d in sdlst)
         {
             db.Entry(d).State = EntityState.Modified;
         }
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 16
0
 //public List<SaleRev> getSaleRevList(int soid)
 //{
 //    using (MEMSContext db = new MEMSContext())
 //    {
 //        var rs=from r in db.T_SaleReceive
 //               join u in db.t_
 //    }
 //}
 public bool AddNewSaleRev(List <T_SaleReceive> revlst)
 {
     using (MEMSContext db = new MEMSContext())
     {
         foreach (var r in revlst)
         {
             db.Entry <T_SaleReceive>(r).State = EntityState.Added;
         }
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 17
0
 public bool AddNewCraftPricelst(List <T_CraftsPrice> ncplst, int pbid)
 {
     using (MEMSContext db = new MEMSContext())
     {
         foreach (var newcp in ncplst)
         {
             newcp.pricebasicid    = pbid;
             db.Entry(newcp).State = EntityState.Added;
         }
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// 返回pricebasicid
 /// </summary>
 /// <param name="price"></param>
 /// <returns></returns>
 public int AddProductPrice(T_ProductbasicPrice price)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(price).State = EntityState.Added;
         var success = db.SaveChanges() > 0 ? true : false;
         if (success)
         {
             return(price.id);
         }
         else
         {
             return(0);
         }
     }
 }
Exemplo n.º 19
0
 /// <summary>
 /// 添加新的报价单产品明细列表
 /// </summary>
 /// <param name="qtpricelst"></param>
 public bool AddNewQtPriceList(List <QtProduct> qtpricelst)
 {
     try
     {
         using (MEMSContext db = new MEMSContext())
         {
             foreach (var qp in qtpricelst)
             {
                 db.Entry <T_quotationprice>(qp.qp).State = EntityState.Added;
             }
             return(db.SaveChanges() > 0 ? true : false);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         throw ex;
     }
 }