public void UpdateMedicine(int i, double p, int q) { Medicine_info medicineInfo = PharmacyContext.Medicine_infos.Single(x => x.Medicine_Id == i); //select *from medicine_info where medicine_id=i LIMIT 1 medicineInfo.Price = p; medicineInfo.Quantity = q; PharmacyContext.SubmitChanges(); }
public void DeleteMedicine(int i) { var m = from a in PharmacyContext.Medicine_infos where a.Medicine_Id == i select a; Medicine_info obj = PharmacyContext.Medicine_infos.Single(x => x.Medicine_Id == i); PharmacyContext.Medicine_infos.DeleteOnSubmit(obj); PharmacyContext.SubmitChanges(); }
public void AddMedicine(string name, string gname, double price, int quantity) { Medicine_info medicineInfo = new Medicine_info(); medicineInfo.Medicine_Name = name; medicineInfo.Generic_Name = gname; medicineInfo.Price = price; medicineInfo.Quantity = quantity; PharmacyContext.Medicine_infos.InsertOnSubmit(medicineInfo); PharmacyContext.SubmitChanges(); }
partial void DeleteMedicine_info(Medicine_info instance);
partial void UpdateMedicine_info(Medicine_info instance);
partial void InsertMedicine_info(Medicine_info instance);