예제 #1
0
 public void Delete(int CustomerID)
 {
     using (tempdbEntities tde = new tempdbEntities())
     {
         tde.pDelCustomer(CustomerID);
     }
 }
예제 #2
0
 public void Update(int CustomerID, string NewCustomerName)
 {
     using (tempdbEntities tde = new tempdbEntities())
     {
         tde.pUpdCustomer(CustomerID, NewCustomerName);
     }
 }
예제 #3
0
        public void Insert(int CustomerID, string CustomerName)
        {

            using (tempdbEntities tde = new tempdbEntities())
            {
                tde.pInsCustomer(CustomerID, CustomerName);
            }
        }
예제 #4
0
        DataTable Select()
        {
            DataTable retVal = new DataTable();
            using (tempdbEntities tde = new tempdbEntities())
            {
                retVal = tde.pSelCustomer();

            }

            return retVal;
        }
예제 #5
0
 private void buttonSelect_Click(object sender, EventArgs e)
 {
     try
     {
         tempdbEntities tde = new tempdbEntities();
         dataGridViewSelectedData.DataSource = tde.pSelCustomer().ToArray();
     }
     catch (Exception)
     {
         MessageBox.Show("Could not select data");
     }
 }
예제 #6
0
 private void buttonDelete_Click(object sender, EventArgs e)
 {
     try
     {
         using (tempdbEntities tde = new tempdbEntities())
         {
             tde.pDelCustomer(Int32.Parse(textBoxDeleteCustomerID.Text));
         }
         textBoxDeleteCustomerID.Clear();
     }
     catch (Exception)
     {
         MessageBox.Show("Could not delete data");
     }
 }
예제 #7
0
        public string Select()
        {
            StringBuilder retVal = new StringBuilder();

            using (tempdbEntities tde = new tempdbEntities())
            {
                var results = tde.pSelCustomer();
                foreach (var item in results)
                {
                    retVal.AppendLine(item.CustomerId + ", " + item.CustomerName);
                }
            }

            return retVal.ToString();
        }
예제 #8
0
 private void buttonInsertCustomer_Click(object sender, EventArgs e)
 {
     try
     {
         using (tempdbEntities tde = new tempdbEntities())
         {
             tde.pInsCustomer(Int32.Parse(textBoxInsertCustomerID.Text), textBoxInsertCustomerName.Text);
         }
         textBoxInsertCustomerID.Clear();
         textBoxInsertCustomerName.Clear();
     }
     catch (Exception)
     {
         MessageBox.Show("Could not insert data");
     }
 }