private void CLoadList()
        {
            string          result   = CRestClient.GetAllCustomer();
            List <Customer> customer = JsonConvert.DeserializeObject <List <Customer> >(result);

            foreach (var c in customer)
            {
                C_datagrid.Rows.Add(
                    c.Customerid,
                    c.Customername,
                    c.Itembrought,
                    c.Datebrought
                    );
            }
            ;
        }
        private void ACI_addButton_Click(object sender, EventArgs e)
        {
            Customer c = new Customer(
                -1,
                tb_CN.Text,
                tb_IB.Text,
                tb_Date.Text);

            string response = CRestClient.InsertCustomerInfo(c);

            if (response.Equals("success"))
            {
                MessageBox.Show("Customer is sucessfully added.");
            }

            this.Hide();
            Inventory list = new Inventory();

            list.Show();
        }
        private void UCI_updateButton_Click(object sender, EventArgs e)
        {
            Customer c = new Customer(
                Convert.ToInt32(lbl_customerid.Text),
                tb_CN.Text,
                tb_Date.Text,
                tb_IB.Text
                );



            if (CRestClient.UpdateCustomer(c).Equals("success"))
            {
                MessageBox.Show("Customer is sucessfully updated.");
            }

            this.Hide();
            Inventory list = new Inventory();

            list.Closed += (s, args) => this.Close();
            list.Show();
        }
 private void C_deleteButton_Click(object sender, EventArgs e)
 {
     CRestClient.DeleteCustomerInfo(Convert.ToInt32(C_datagrid.CurrentRow.Cells[0].Value));
     C_datagrid.Rows.Clear();
     CLoadList();
 }