public DTO_Thuoc layThuocTheoMa(string mathuoc) { Thuoc ttemp = db.Thuocs.Where(x => x.Ma_Thuoc.Equals(mathuoc)).FirstOrDefault(); DTO_Thuoc tt = new DTO_Thuoc(); tt.MaThuoc = ttemp.Ma_Thuoc; tt.TenThuoc = ttemp.Ten_Thuoc; tt.CongDung = ttemp.CongDung_Thuoc; tt.DonViTinh = ttemp.DonViTinh_Thuoc; tt.DonGia = ttemp.DonGia_Thuoc; tt.NgaySX = ttemp.NSX_Thuoc; tt.HanSD = ttemp.HSD_Thuoc; tt.SoLuongThuoc = ttemp.SoLuongThuoc; return(tt); }
public bool themThuoc(DTO_Thuoc tnew) { if (CheckIfExist(tnew.MaThuoc)) { return(false); } Thuoc ttemp = new Thuoc(); ttemp.Ma_Thuoc = tnew.MaThuoc; ttemp.Ma_NCC = tnew.MaNhaCC; ttemp.Ten_Thuoc = tnew.TenThuoc; ttemp.CongDung_Thuoc = tnew.CongDung; ttemp.DonGia_Thuoc = tnew.DonGia; ttemp.DonViTinh_Thuoc = tnew.DonViTinh; ttemp.SoLuongThuoc = tnew.SoLuongThuoc; ttemp.NSX_Thuoc = tnew.NgaySX; ttemp.HSD_Thuoc = tnew.HanSD; db.Thuocs.InsertOnSubmit(ttemp); db.SubmitChanges(); return(true); }
private void detach_Thuocs(Thuoc entity) { this.SendPropertyChanging(); entity.NhaCungCap = null; }
private void attach_Thuocs(Thuoc entity) { this.SendPropertyChanging(); entity.NhaCungCap = this; }
partial void DeleteThuoc(Thuoc instance);
partial void UpdateThuoc(Thuoc instance);
partial void InsertThuoc(Thuoc instance);