Esempio n. 1
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Please Click Yes To Continue To DELETE", "Delete", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                string id = "'" + lblId.Text + "'";
                string IsSave;

                string        spName = "sp_Delete_Pump";
                SqlDataReader reader;


                reader = monitoring.ExecuteReader(spName, id);
                DataTable result = new DataTable();
                result.Load(reader);
                IsSave = result.Rows[0]["Result"].ToString();

                if (IsSave == "0")
                {
                    MessageBox.Show("Failed To Delete..");
                }
                else
                {
                    this.Hide();
                    MessageBox.Show("Successfully Deleted..");
                    PumpIncharge driver = new PumpIncharge();
                    driver.ShowDialog();
                    this.Close();
                }
            }
        }
Esempio n. 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show("Please Click Yes To Continue To SAVE", "Save", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                string id         = "'" + lblId.Text + "'";
                string DriverName = "'" + txtName.Text + "'";
                string Status     = "'" + cmbStatus.SelectedItem.ToString() + "'";
                string IsSave;

                string        spName = "sp_Update_Pump";
                SqlDataReader reader;


                reader = monitoring.ExecuteReader(spName, id, DriverName, Status);
                DataTable result = new DataTable();
                result.Load(reader);
                IsSave = result.Rows[0]["Result"].ToString();

                if (IsSave == "0")
                {
                    MessageBox.Show("Failed To Save..");
                }
                else
                {
                    this.Hide();
                    MessageBox.Show("Successfully Saved..");
                    PumpIncharge driver = new PumpIncharge();
                    driver.param(ID);
                    driver.ShowDialog();
                    this.Close();
                }
            }
        }
Esempio n. 3
0
        private void lnkClose_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            PumpIncharge driver = new PumpIncharge();

            driver.param(ID);
            driver.ShowDialog();
            this.Close();
        }