public static bool AddMedicine(Model.Medicine medicine) { SqlConnection connection = new SqlConnection(Connection_String); SqlCommand command = new SqlCommand(); try { connection.Open(); command.Connection = connection; command.CommandType = CommandType.Text; command.CommandText = string.Format("insert into Medicine values( {0}, '{1}', {2}, {3}, {4} )", medicine.ID, medicine.Name, medicine.Price, medicine.PersonelID, medicine.FactoryID); command.Connection = connection; command.ExecuteScalar(); connection.Close(); return(true); } catch (SqlException e) { string x = e.Message; connection.Close(); return(false); } }
public bool AddMedicine(Model.Medicine medicine) { bool Res = DAL.DALClass.AddMedicine(medicine); if (Res) { return(true); } return(false); }
static Information() { CurrentUser = new Doctor(); Medicine = new Medicine(); UsePower = new Dictionary <int, string>(); }
static Information() { CurrentUser = new CurrentUser(); Medicine = new Medicine(); UsePower = new UsePower(); }
private void attach_Medicine(Medicine entity) { this.SendPropertyChanging(); entity.Config = this; }
partial void DeleteMedicine(Medicine instance);
partial void UpdateMedicine(Medicine instance);
partial void InsertMedicine(Medicine instance);
private void detach_Medicine(Medicine entity) { this.SendPropertyChanging(); entity.Config = null; }