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

            using (tempdbEntities tde = new tempdbEntities())
            {
                tde.pInsCustomer(CustomerID, CustomerName);
            }
        }
        DataTable Select()
        {
            DataTable retVal = new DataTable();
            using (tempdbEntities tde = new tempdbEntities())
            {
                retVal = tde.pSelCustomer();

            }

            return retVal;
        }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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();
        }
Esempio n. 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");
     }
 }