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);
            }
        }
示例#2
0
        public bool AddMedicine(Model.Medicine medicine)
        {
            bool Res = DAL.DALClass.AddMedicine(medicine);

            if (Res)
            {
                return(true);
            }

            return(false);
        }
示例#3
0
 static Information()
 {
     CurrentUser = new Doctor();
     Medicine    = new Medicine();
     UsePower    = new Dictionary <int, string>();
 }
示例#4
0
 static Information()
 {
     CurrentUser = new CurrentUser();
     Medicine    = new Medicine();
     UsePower    = new UsePower();
 }
示例#5
0
 private void attach_Medicine(Medicine entity)
 {
     this.SendPropertyChanging();
     entity.Config = this;
 }
示例#6
0
 partial void DeleteMedicine(Medicine instance);
示例#7
0
 partial void UpdateMedicine(Medicine instance);
示例#8
0
 partial void InsertMedicine(Medicine instance);
示例#9
0
 private void detach_Medicine(Medicine entity)
 {
     this.SendPropertyChanging();
     entity.Config = null;
 }