Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }
Пример #4
0
 partial void DeleteMedicine_info(Medicine_info instance);
Пример #5
0
 partial void UpdateMedicine_info(Medicine_info instance);
Пример #6
0
 partial void InsertMedicine_info(Medicine_info instance);