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);
            }
        }
Beispiel #2
0
        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();
 }
Beispiel #5
0
 private void attach_Medicine(Medicine entity)
 {
     this.SendPropertyChanging();
     entity.Config = this;
 }
Beispiel #6
0
 partial void DeleteMedicine(Medicine instance);
Beispiel #7
0
 partial void UpdateMedicine(Medicine instance);
Beispiel #8
0
 partial void InsertMedicine(Medicine instance);
Beispiel #9
0
 private void detach_Medicine(Medicine entity)
 {
     this.SendPropertyChanging();
     entity.Config = null;
 }