Exemplo n.º 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         string updatequery = string.Format("delete from DISTRIBUTOR  where DISTRIBUTORID = ('{0}')", Convert.ToInt32(Vendoridtextbox.Text));
         EventMangementSystemClass.Update(updatequery);
         var query = string.Format("SELECT * FROM DISTRIBUTOR");
         EventMangementSystemClass.RecordShow(query, dataGridView2);
         Vendoridtextbox.Clear();
         vendornametextbox.Clear();
         maskedTextBox1.Clear();
         emailtextbox.Clear();
         comboBox1.Text = "";
         textBox1.Clear();
         companyaddresstextbox.Clear();
         contactnumbertextbox.Clear();
         emailaddresstextbox.Clear();
         VENDOR_INFORMATION_Load(sender, e);
         dataGridView2.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            string SHOW = string.Format("SELECT * FROM dbo.PRODUCTS WHERE PRODUCTNAME = ('{0}')", comboBox3.Text);

            EventMangementSystemClass.RecordShow(SHOW, dataGridView1);
            comboBox1.ResetText();
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string addquery = string.Format("insert into DISTRIBUTOR (NAME,CONTACTNUMBER,TRADEMARKID,EMAIL)values ('{0}','{1}','{2}','{3}')", vendornametextbox.Text, maskedTextBox1.Text, Convert.ToInt32(textBox1.Text), emailtextbox.Text);
         EventMangementSystemClass.Add(addquery);
         var query = string.Format("SELECT * FROM DISTRIBUTOR");
         EventMangementSystemClass.RecordShow(query, dataGridView2);
         Vendoridtextbox.Clear();
         vendornametextbox.Clear();
         maskedTextBox1.Clear();
         emailtextbox.Clear();
         comboBox1.Text = "";
         textBox1.Clear();
         companyaddresstextbox.Clear();
         contactnumbertextbox.Clear();
         emailaddresstextbox.Clear();
         VENDOR_INFORMATION_Load(sender, e);
         dataGridView2.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 4
0
        private void button4_Click(object sender, EventArgs e)
        {
            //try
            //{
            string updatequery = string.Format("UPDATE DISTRIBUTOR SET NAME = ('{0}'), CONTACTNUMBER = ('{1}'),TRADEMARKID = ('{2}'), EMAIL = ('{3}') where DISTRIBUTORID=('{4}')", vendornametextbox.Text, maskedTextBox1.Text, Convert.ToInt32(textBox1.Text), emailtextbox.Text, Convert.ToInt32(Vendoridtextbox.Text));

            EventMangementSystemClass.Update(updatequery);
            var query = string.Format("SELECT * FROM DISTRIBUTOR");

            EventMangementSystemClass.RecordShow(query, dataGridView2);
            Vendoridtextbox.Clear();
            vendornametextbox.Clear();
            maskedTextBox1.Clear();
            emailtextbox.Clear();
            comboBox1.SelectedValue = "";;
            textBox1.Clear();
            companyaddresstextbox.Clear();
            contactnumbertextbox.Clear();
            emailaddresstextbox.Clear();
            VENDOR_INFORMATION_Load(sender, e);
            dataGridView2.Refresh();
            // }
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.Message);
            //}
        }
        private void comboBox1_SelectedValueChanged(object sender, EventArgs e)
        {
            string SHOW = string.Format("SELECT * FROM dbo.CUSTOMER WHERE NAME = ('{0}')", comboBox1.Text);

            EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
            comboBox1.ResetText();
            //string SH = string.Format("SELECT * FROM dbo.CUSTOMER");
            //EventMangementSystemClass.RecordShow(SH, dataGridView2);
        }
 private void comboBox3_SelectedValueChanged(object sender, EventArgs e)
 {
     try
     {
         string SHOW = string.Format("SELECT * FROM PRODUCT");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView1);
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
 private void button7_Click(object sender, EventArgs e)
 {
     try
     {
         string SHOW = string.Format("SELECT * FROM dbo.CUSTOMER");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
Exemplo n.º 8
0
 private void SearchingCustomerIDtextbox_TextChanged(object sender, EventArgs e)
 {
     try
     {
         string SHOW = string.Format("SELECT * FROM dbo.DISTRIBUTOR WHERE NAME LIKE ('{0}%')", SearchingCustomerIDtextbox.Text);
         EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
         textBox1.Clear();
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         string SHOW = string.Format("SELECT * FROM dbo.CUSTOMER WHERE NAME LIKE ('{0}%')", textBox1.Text);
         EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
         textBox1.Clear();
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
Exemplo n.º 10
0
 private void VENDOR_INFORMATION_Load(object sender, EventArgs e)
 {
     try
     {
         string SHOW = string.Format("SELECT DISTRIBUTORID,NAME,dbo.DISTRIBUTOR.CONTACTNUMBER,dbo.DISTRIBUTOR.EMAIL,COMPANYNAME FROM dbo.DISTRIBUTOR INNER JOIN dbo.TRADEMARK ON dbo.TRADEMARK.TRADEMARKID =  dbo.DISTRIBUTOR.TRADEMARKID ");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
     // TODO: This line of code loads data into the 'seven86settings.TRADEMARK' table. You can move, or remove it, as needed.
     this.tRADEMARKTableAdapter.Fill(this.seven86settings.TRADEMARK);
     comboBox1.SelectedValue = "";;
 }
Exemplo n.º 11
0
 private void PLACE_ORDER_Load(object sender, EventArgs e)
 {
     comboBox1.Text = "";
     // TODO: This line of code loads data into the 'seven86DataSet26.DISTRIBUTOR' table. You can move, or remove it, as needed.
     this.dISTRIBUTORTableAdapter.Fill(this.seven86DataSet26.DISTRIBUTOR);
     try
     {
         string SHOW = string.Format("Select PRODUCTID, PRODUCTNAME, INSTRUCTION, FORMULA as SPECIALITY, QUANTITYINSTOCK, PACKINGID, BATCHID, TRADEMARKID, RETAILPRICE, TRADEPRICE, MARKUP, EXPIRYDATE, MANUFACTUREDATE FROM PRODUCT ");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView1);
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         System.DateTime sdate = default(System.DateTime);
         System.DateTime date2 = default(System.DateTime);
         sdate = startdatetimepicker.Value;
         date2 = lastdatetimepicker.Value;
         string addquery = string.Format("insert into CUSTOMER (NAME,CONTACTNUMBER,[ADDRESS],NIC,JOINDATE,[STATUS],LEAVEDATE)values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}')", customernametextbox.Text, maskedTextBox2.Text, textBox2.Text, maskedTextBox1.Text, sdate, STATUS.Text, date2);
         EventMangementSystemClass.Add(addquery);
         var query = string.Format("SELECT * FROM CUSTOMER");
         EventMangementSystemClass.RecordShow(query, dataGridView2);
         CUSTOMER_INFORMATION_Load(sender, e);
         dataGridView2.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     try
     {
         //string path = @"Data Source=AAMIR-PC\AMIR;Initial Catalog=Seven86;Integrated Security=True";
         string        Query      = string.Format("select CUSTOMERID from CUSTOMER where NAME = ('{0}')", customernametextbox.Text);
         SqlConnection connection = new SqlConnection(EventMangementSystemClass.Path);
         SqlCommand    sc         = new SqlCommand(Query, connection);
         connection.Open();
         SqlDataReader DR = sc.ExecuteReader();
         if (DR.Read())
         {
             customeridtextbox.Clear();
             customeridtextbox.Text = DR.GetValue(0).ToString();
         }
         connection.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     //try
     //{
     //    string SHOW = string.Format("SELECT * FROM dbo.CUSTOMER");
     //    EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
     //}
     //catch (Exception EX)
     //{
     //    MessageBox.Show(EX.Message);
     //}
 }
Exemplo n.º 13
0
 private void Form1_Load(object sender, EventArgs e)
 {
     //pictureBox16.Location = new Point(174, -4);
     //pictureBox17.Location = new Point(174, -4);
     //pictureBox18.Location = new Point(174, -4);
     //pictureBox19.Location = new Point(174, -4);
     timer2.Enabled = true;
     timer1.Enabled = true;
     try
     {
         string SHOW = string.Format("SELECT ASSIGNEDTASKID,TASK,STARTTIME,ENDTIME,REMARKS,ASSIGNEDDATE,TASKID,EMPID,EMPLOYEENAME FROM dbo.ASSIGNEDTASKS INNER JOIN dbo.EMPLOYEES ON dbo.EMPLOYEES.EMPLOYEEID=dbo.ASSIGNEDTASKS.EMPID WHERE REMARKS= 'NO' OR REMARKS= 'NO'");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView1);
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
Exemplo n.º 14
0
 private void textBox2_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (textBox2.Text != "")
         {
             string SHOW = string.Format("SELECT DISTRIBUTORID,NAME,dbo.DISTRIBUTOR.CONTACTNUMBER,dbo.DISTRIBUTOR.EMAIL,COMPANYNAME FROM dbo.DISTRIBUTOR INNER JOIN dbo.TRADEMARK ON dbo.TRADEMARK.TRADEMARKID =  dbo.DISTRIBUTOR.TRADEMARKID  WHERE dbo.TRADEMARK.TRADEMARKID=  (SELECT dbo.TRADEMARK.TRADEMARKID FROM dbo.TRADEMARK WHERE COMPANYNAME LIKE ('{0}%'))", textBox2.Text);
             EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
             textBox1.Clear();
         }
         else
         {
             VENDOR_INFORMATION_Load(sender, e);
         }
     }
     catch (Exception EX)
     {
         MessageBox.Show(EX.Message);
     }
 }
Exemplo n.º 15
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         string Query = string.Format("SELECT ORDERDATE,PRODUCT.PRODUCTID,PRODUCTNAME,PACKINGTYPE,VOLUME,MANUFACTUREDATE,EXPIRYDATE,QUANTITY,TOTALAMOUNT FROM dbo.PRODUCT INNER JOIN dbo.ORDEREDPRODUCTS ON dbo.PRODUCT.PRODUCTID=dbo.ORDEREDPRODUCTS.PRODUCTID INNER JOIN dbo.PACKINGTYPE ON dbo.PACKINGTYPE.PACKINGID= dbo.PRODUCT.PACKINGID INNER JOIN  TAKEORDER ON dbo.TAKEORDER.ORDERID=dbo.ORDEREDPRODUCTS.ORDERID WHERE dbo.ORDEREDPRODUCTS.ORDERID   = ('{0}')", textBox12.Text);
         EventMangementSystemClass.RecordShow(Query, dataGridView1);
         string        Query1     = string.Format("SELECT NAME,CUSTOMER.CUSTOMERID FROM dbo.TAKEORDER INNER JOIN dbo.CUSTOMER ON dbo.CUSTOMER.CUSTOMERID=dbo.TAKEORDER.CUSTOMERID WHERE ORDERID = ('{0}')", textBox12.Text);
         SqlConnection connection = new SqlConnection(EventMangementSystemClass.Path);
         SqlCommand    sc         = new SqlCommand(Query1, connection);
         connection.Open();
         SqlDataReader DR = sc.ExecuteReader();
         if (DR.Read())
         {
             comboBox2.Text = DR.GetValue(0).ToString();
             label19.Text   = DR.GetValue(1).ToString();
         }
         connection.Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 16
0
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         string addquery = string.Format("insert into dbo.PAYMENTBYCUSTOMER (CUSTOMERID,ORDERPRODUCTID,BILLAMOUNT,PAIDAMOUNT,BALANCE,STATUS) values ('{0}','{1}','{2}','{3}','{4}','{5}')", Convert.ToInt32(textBox6.Text), Convert.ToInt32(comboBox2.Text), Convert.ToDouble(textBox1.Text), Convert.ToInt32(textBox2.Text), Convert.ToInt32(textBox3.Text), comboBox1.Text);
         EventMangementSystemClass.Add(addquery);
         textBox6.Clear();
         comboBox1.ResetText();
         comboBox2.ResetText();
         textBox7.Clear();
         textBox8.Clear();
         textBox1.Clear();
         textBox2.Clear();
         textBox3.Clear();
         string SHOW = string.Format("SELECT * FROM dbo.PAYMENTBYCUSTOMER");
         EventMangementSystemClass.RecordShow(SHOW, dataGridView2);
         PAYMENT_Load(sender, e);
         dataGridView2.Refresh();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }