Ejemplo n.º 1
0
 public string get_formulation_value(string drugid)
 {
     drug_value    = (VCRI_DAL.Drug)(from p in dbContext.Drugs select p).Where(p => p.drug_Code.Equals(drugid)).FirstOrDefault();
     formula_value = (VCRI_DAL.Formulation)dbContext.Formulations.Find(drug_value.formulation_Code);
     stock_value   = (VCRI_DAL.Stock)(from p in dbContext.Stocks select p).Where(p => p.stock_Code.Equals(drugid)).Where(p => p.expiry_Date >= DateTime.Now).FirstOrDefault();
     return(formula_value.shortName + "," + stock_value.stock_BalanceQuantity);
 }
Ejemplo n.º 2
0
 public bool Delete_drug(String drugid)
 {
     try
     {
         drug_value = (VCRI_DAL.Drug)(dbContext.Drugs.Where(p => p.drug_Code.Equals(drugid)).FirstOrDefault());
         dbContext.Drugs.Remove(drug_value);
         dbContext.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }