public void DeleteDrug(DTO_Drug drug)
 {
     try
     {
         SqlCommand command = new SqlCommand("pr_DeleteDrug", DAL_DBConnect.connection);
         command.CommandType = System.Data.CommandType.StoredProcedure;
         command.Parameters.Add("@Drug_Id", System.Data.SqlDbType.Char, 13).Value = drug.Id;
         command.ExecuteNonQuery();
         command.Parameters.Clear();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message.ToString(), "Notice");
     }
 }
 public void UpdateDrug(DTO_Drug drug)
 {
     try
     {
         SqlCommand command = new SqlCommand("pr_UpdateDrug", DAL_DBConnect.connection);
         command.CommandType = System.Data.CommandType.StoredProcedure;
         command.Parameters.Add("@Drug_Id", System.Data.SqlDbType.Char, 13).Value        = drug.Id;
         command.Parameters.Add("@Drug_Name", System.Data.SqlDbType.NVarChar, 250).Value = drug.Name;
         command.Parameters.Add("@Drug_Price", System.Data.SqlDbType.Money).Value        = drug.Price;
         command.Parameters.Add("@Drug_QOS", System.Data.SqlDbType.Int).Value            = drug.Quantity;
         command.Parameters.Add("@Drug_MFD", System.Data.SqlDbType.DateTime).Value       = drug.Mfd;
         command.Parameters.Add("@Drug_EXP", System.Data.SqlDbType.DateTime).Value       = drug.Exp;
         command.Parameters.Add("@Category_Id", System.Data.SqlDbType.Int).Value         = drug.Category;
         command.Parameters.Add("@DVT", System.Data.SqlDbType.NVarChar, 15).Value        = drug.Dvt;
         command.ExecuteNonQuery();
         command.Parameters.Clear();
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message.ToString(), "Notice");
     }
 }
Esempio n. 3
0
 public void DeleteDrug(DTO_Drug drug)
 {
     busDrug.DeleteDrug(drug);
 }
Esempio n. 4
0
 public void UpdateDrug(DTO_Drug drug)
 {
     busDrug.UpdateDrug(drug);
 }
Esempio n. 5
0
 public void InsertDrug(DTO_Drug drug)
 {
     busDrug.InsertDrug(drug);
 }