예제 #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);
     }
 }
예제 #2
0
 public bool DeleteCraft(T_Crafts craft)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(craft).State = EntityState.Deleted;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
예제 #3
0
 internal void addNewCustomer(T_Customer newcustomer)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.T_Customer.Add(newcustomer);
         db.SaveChanges();
     }
 }
예제 #4
0
 internal void UpdateCustomerAddress(T_Customer_address address)
 {
     using (var db = new MEMSContext())
     {
         db.Entry(address).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #5
0
 public bool AddNewProduct(T_Product product)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.T_Product.Add(product);
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
예제 #6
0
 public bool UpdateProduct(T_Product product)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(product).State = EntityState.Modified;
         return(db.SaveChanges() > 0 ? true : false);
     }
 }
예제 #7
0
 internal void editCustomer(T_Customer customer)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #8
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);
     }
 }
예제 #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);
     }
 }
예제 #10
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);
     }
 }
예제 #11
0
 internal void UpdateCustomerContacts(T_Customer_contacts contact)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(contact).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #12
0
 internal void AddCustomerAddress(T_Customer_address address)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.T_Customer_address.Add(address);
         db.SaveChanges();
     }
 }
예제 #13
0
 internal void DelCustomerAddress(T_Customer_address address)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(address).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
예제 #14
0
 internal void DelSupplierContacts(T_Suppliers_contacts contact)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(contact).State = EntityState.Deleted;
         db.SaveChanges();
     }
 }
예제 #15
0
 internal void updateSupplier(T_Suppliers supplier)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.Entry(supplier).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
예제 #16
0
 internal void addNewSupplier(T_Suppliers newsupplier)
 {
     using (MEMSContext db = new MEMSContext())
     {
         db.T_Suppliers.Add(newsupplier);
         db.SaveChanges();
     }
 }
예제 #17
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);
     }
 }
예제 #18
0
        internal void AddSupplierContacts(T_Suppliers_contacts contact)
        {
            using (MEMSContext db = new MEMSContext())
            {
                db.T_Suppliers_contacts.Add(contact);

                db.SaveChanges();
            }
        }
예제 #19
0
        internal void AddCustomerContacts(T_Customer_contacts contact)
        {
            using (MEMSContext db = new MEMSContext())
            {
                db.T_Customer_contacts.Add(contact);

                db.SaveChanges();
            }
        }
예제 #20
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();
     }
 }
예제 #21
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);
     }
 }
예제 #22
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);
     }
 }
예제 #23
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);
     }
 }
예제 #24
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);
         }
     }
 }
예제 #25
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;
     }
 }