public string getPriceVersion(int pid) { using (MEMSContext db = new MEMSContext()) { var rst = from p in db.T_ProductbasicPrice where p.productid == pid orderby p.id descending select p; var lastver = rst.FirstOrDefault(); if (lastver == null) { return("01"); } else { if (lastver.version.Substring(0, 8) == DateTime.Now.ToString("yyyyMMdd")) { var ver = lastver.version.Substring(8, 2); int num = Convert.ToInt32(ver) + 1; ver = num.ToString("D2"); return(ver); } else { return("01"); } } } }
public bool UpdateProduct(T_Product product) { using (MEMSContext db = new MEMSContext()) { db.Entry(product).State = EntityState.Modified; return(db.SaveChanges() > 0 ? true : false); } }
public bool AddNewProduct(T_Product product) { using (MEMSContext db = new MEMSContext()) { db.T_Product.Add(product); return(db.SaveChanges() > 0 ? true : false); } }
/// <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); } }
/// <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); } }
/// <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); } }
/// <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); } }
internal void DelSupplierContacts(T_Suppliers_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.Entry(contact).State = EntityState.Deleted; db.SaveChanges(); } }
public bool DeleteCraft(T_Crafts craft) { using (MEMSContext db = new MEMSContext()) { db.Entry(craft).State = EntityState.Deleted; return(db.SaveChanges() > 0 ? true : false); } }
internal void UpdateCustomerAddress(T_Customer_address address) { using (var db = new MEMSContext()) { db.Entry(address).State = EntityState.Modified; db.SaveChanges(); } }
internal void addNewCustomer(T_Customer newcustomer) { using (MEMSContext db = new MEMSContext()) { db.T_Customer.Add(newcustomer); db.SaveChanges(); } }
internal void DelCustomerAddress(T_Customer_address address) { using (MEMSContext db = new MEMSContext()) { db.Entry(address).State = EntityState.Deleted; db.SaveChanges(); } }
internal void AddCustomerAddress(T_Customer_address address) { using (MEMSContext db = new MEMSContext()) { db.T_Customer_address.Add(address); db.SaveChanges(); } }
internal void editCustomer(T_Customer customer) { using (MEMSContext db = new MEMSContext()) { db.Entry(customer).State = EntityState.Modified; db.SaveChanges(); } }
internal void updateSupplier(T_Suppliers supplier) { using (MEMSContext db = new MEMSContext()) { db.Entry(supplier).State = EntityState.Modified; db.SaveChanges(); } }
internal void addNewSupplier(T_Suppliers newsupplier) { using (MEMSContext db = new MEMSContext()) { db.T_Suppliers.Add(newsupplier); db.SaveChanges(); } }
internal void UpdateCustomerContacts(T_Customer_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); } }
internal void AddCustomerContacts(T_Customer_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.T_Customer_contacts.Add(contact); db.SaveChanges(); } }
public List <T_Customer> getCustomerAllList() { using (MEMSContext db = new MEMSContext()) { var clist = from c in db.T_Customer select c; return(clist.ToList()); } }
public List <T_ProductType> getPtypelst() { using (MEMSContext db = new MEMSContext()) { var rst = from t in db.T_ProductType select t; return(rst.ToList()); } }
internal List <T_Base_suppliertype> getSuptypLst() { using (MEMSContext db = new MEMSContext()) { var lst = from c in db.T_Base_suppliertype select c; return(lst.ToList()); } }
internal List <T_Base_profession> getProfLst() { using (MEMSContext db = new MEMSContext()) { var lst = from c in db.T_Base_profession select c; return(lst.ToList()); } }
internal void AddSupplierContacts(T_Suppliers_contacts contact) { using (MEMSContext db = new MEMSContext()) { db.T_Suppliers_contacts.Add(contact); db.SaveChanges(); } }
internal List <T_Base_customertype> getCusmtypLst() { using (MEMSContext db = new MEMSContext()) { var lst = from c in db.T_Base_customertype select c; return(lst.ToList()); } }
internal List <T_Customer_contacts> getCustomerContacts(int customerid) { using (MEMSContext db = new MEMSContext()) { var lst = from a in db.T_Customer_contacts where a.customerid == customerid select a; return(lst.ToList()); } }
internal List <T_Customer> getCustomerList(string cno, string cname, string csname) { using (MEMSContext db = new MEMSContext()) { var clist = from c in db.T_Customer where c.customerno.Contains(cno) && c.customername.Contains(cname) && c.simplename.Contains(csname) select c; return(clist.ToList()); } }
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(); } }
internal List <T_Suppliers_contacts> getSupplierContacts(int supplierid) { using (MEMSContext db = new MEMSContext()) { var lst = from a in db.T_Suppliers_contacts where a.supplierid == supplierid select a; return(lst.ToList()); } }
public T_Suppliers getSupplierbyId(int id) { using (var db = new MEMSContext()) { var rst = from s in db.T_Suppliers where s.id == id select s; return(rst.FirstOrDefault()); } }
public T_Customer getCustomerByid(int id) { using (MEMSContext db = new MEMSContext()) { var customer = from c in db.T_Customer where c.id == id select c; return(customer.First()); } }