コード例 #1
0
        private void InsertData()
        {
            Objects.Symptom Obj = new Objects.Symptom();
            Obj.SymptomID = new BLL.Symptom().GetMaxID();
            Obj.SympName  = txtSymptomName.Text;
            int vCheck = new BLL.Symptom().InsertData(Obj);

            if (vCheck == 1)
            {
                MessageBox.Show("Data Inserted");
            }
        }
コード例 #2
0
        public int InsertData(Objects.Symptom symp)
        {
            int    vCheck;
            string vQuery = "Insert into Symptom(Symptom_ID, Symptom) " +
                            "Values ('" + symp.SymptomID + "','" + symp.SympName + "')";

            Conn    = new SqlConnection(connectionString);
            command = new SqlCommand(vQuery, Conn);
            try
            {
                Conn.Open();
                vCheck = command.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                Conn.Close();
            }
            return(vCheck);
        }
コード例 #3
0
 public int InsertData(Objects.Symptom symp)
 {
     return(new DAL.Symptom().InsertData(symp));
 }