public bool UpdateProduct(T_Product product) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(product).State = EntityState.Modified; return db.SaveChanges() > 0 ? true : false; } }
internal void editCustomer(T_Customer customer) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(customer).State = System.Data.EntityState.Modified; db.SaveChanges(); } }
internal void addNewCustomer(T_Customer newcustomer) { using (MEMSEntities db = new MEMSEntities()) { db.T_Customer.Add(newcustomer); db.SaveChanges(); } }
internal void updateSupplier(T_Suppliers supplier) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(supplier).State = System.Data.EntityState.Modified; db.SaveChanges(); } }
internal void addNewSupplier(T_Suppliers newsupplier) { using (MEMSEntities db = new MEMSEntities()) { db.T_Suppliers.Add(newsupplier); db.SaveChanges(); } }
public bool AddNewProduct(T_Product product) { using (MEMSEntities db = new MEMSEntities()) { db.T_Product.Add(product); return db.SaveChanges() > 0 ? true : false; } }
public List<T_ProductType> getPtypelst() { using (MEMSEntities db = new MEMSEntities()) { var rst = from t in db.T_ProductType select t; return rst.ToList(); } }
internal List<T_Base_suppliertype> getSuptypLst() { using (MEMSEntities db = new MEMSEntities()) { var lst = from c in db.T_Base_suppliertype select c; return lst.ToList(); } }
internal List<T_Base_customertype> getCusmtypLst() { using (MEMSEntities db = new MEMSEntities()) { var lst = from c in db.T_Base_customertype select c; return lst.ToList(); } }
public T_Product getProductbyId(int pid) { using (MEMSEntities db = new MEMSEntities()) { var rst = from p in db.T_Product where p.id == pid select p; return rst.FirstOrDefault(); } }
internal List<T_Suppliers_contacts> getSupplierContacts(int supplierid) { using (MEMSEntities db = new MEMSEntities()) { 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 MEMSEntities()) { var rst = from s in db.T_Suppliers where s.id == id select s; return rst.FirstOrDefault(); } }
public List<T_Crafts> getProCraft(int pid) { using (MEMSEntities db = new MEMSEntities()) { var rst = from c in db.T_Crafts where c.pid == pid select c; return rst.ToList(); } }
internal List<T_Customer> getCustomerList(string cno, string cname, string csname) { using (MEMSEntities db = new MEMSEntities()) { 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(); } }
public List<T_Suppliers> getSupplierList() { using (var db = new MEMSEntities()) { var rst = from s in db.T_Suppliers select s; //select new { s.id, s.supplierno, s.suppliername, s.suppliertype, s.simplename, s.country, s.province, s.city }; return rst.ToList(); } }
public T_Customer getCustomerByid(int id) { using (MEMSEntities db = new MEMSEntities()) { var customer = from c in db.T_Customer where c.id == id select c; return customer.First(); } }
internal void delCustomer(T_Customer customer) { using (MEMSEntities db = new MEMSEntities()) { //db.T_Customer.Remove(customer); var entityentry = db.Entry(customer); entityentry.State = EntityState.Deleted; db.SaveChanges(); } }
public List<T_Customer> getCustomerAllList() { using (MEMSEntities db = new MEMSEntities()) { var clist = from c in db.T_Customer select c; return clist.ToList(); } }
public List<T_Suppliers> getSupplierList(string sno,string sname) { using (var db = new MEMSEntities()) { var rst = from s in db.T_Suppliers where s.supplierno.Contains(sno) && s.suppliername.Contains(sname) select s; return rst.ToList(); } }
public List<ProductList> getProductLst() { using (MEMSEntities db = new MEMSEntities()) { var rst = from p in db.T_Product join c in db.T_Customer on p.customerid equals c.id select new ProductList { id = p.id, customerid = p.customerid.Value, procode = p.procode, proname = p.proname, drawingno = p.drawingno, customername = c.customername }; return rst.ToList(); } }
public List<ProductList> getProductLstbyCdt(string code,string name,string drawingno,int[] cidlst) { using (MEMSEntities db = new MEMSEntities()) { var rst = from p in db.T_Product join c in db.T_Customer on p.customerid equals c.id where p.procode.Contains(code) && p.proname.Contains(name) && p.drawingno.Contains(drawingno) && cidlst.Contains(p.customerid.Value) select new ProductList { id = p.id, customerid = p.customerid.Value, procode = p.procode, proname = p.proname, drawingno = p.drawingno, customername = c.customername }; return rst.ToList(); } }
internal void AddSupplierContacts(T_Suppliers_contacts contact) { using (MEMSEntities db = new MEMSEntities()) { db.T_Suppliers_contacts.Add(contact); db.SaveChanges(); } }
internal void UpdateCustomerContacts(T_Customer_contacts contact) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(contact).State = EntityState.Modified; db.SaveChanges(); } }
internal void AddCustomerContacts(T_Customer_contacts contact) { using (MEMSEntities db = new MEMSEntities()) { db.T_Customer_contacts.Add(contact); db.SaveChanges(); } }
internal void UpdateCustomerAddress(T_Customer_address address) { using (var db = new MEMSEntities()) { db.Entry(address).State = EntityState.Modified; db.SaveChanges(); } }
internal void AddCustomerAddress(T_Customer_address address) { using (MEMSEntities db = new MEMSEntities()) { db.T_Customer_address.Add(address); db.SaveChanges(); } }
internal void DelCustomerAddress(T_Customer_address address) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(address).State = EntityState.Deleted; db.SaveChanges(); } }
internal List<T_Base_profession> getProfLst() { using (MEMSEntities db = new MEMSEntities()) { var lst = from c in db.T_Base_profession select c; return lst.ToList(); } }
internal List<T_Customer_address> getCustomerAddress(int customerid) { using (MEMSEntities db = new MEMSEntities()) { var lst = from a in db.T_Customer_address where a.customerid == customerid select a; return lst.ToList(); } }
public bool UpdateCraft(T_Crafts craft) { using (MEMSEntities db = new MEMSEntities()) { db.Entry(craft).State = EntityState.Modified; return db.SaveChanges() > 0 ? true : false; } }