private void dgvEquipmentDetails_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DAL.EquipmentTypeClass equipmentTypeClass = new DAL.EquipmentTypeClass(int.Parse(dgvEquipmentDetails.SelectedRows[0].Cells[0].Value.ToString()));

                var values = bll.SelectedForUpdateEquipmentType(equipmentTypeClass);

                txtEquipmentType.Text = values.Rows[0].Table.Rows[0].ItemArray[1].ToString();
            }
#pragma warning disable CS0168 // The variable 'b' is declared but never used
            catch (Exception b)
#pragma warning restore CS0168 // The variable 'b' is declared but never used
            {
            }
        }
Beispiel #2
0
        protected void dgEquipmentType_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                DAL.EquipmentTypeClass equipmentTypeClass = new DAL.EquipmentTypeClass(int.Parse(dgEquipmentType.SelectedItem.Cells[1].Text.ToString()));

                var values = bll.SelectedForUpdateEquipmentType(equipmentTypeClass);

                txtDescription.Text = values.Rows[0].Table.Rows[0].ItemArray[1].ToString();
            }
#pragma warning disable CS0168 // The variable 'b' is declared but never used
            catch (Exception b)
#pragma warning restore CS0168 // The variable 'b' is declared but never used
            {
            }
        }
Beispiel #3
0
        protected void btnManageUpdate(object sender, EventArgs e)
        {
            try
            {
                DAL.EquipmentTypeClass equipment = new DAL.EquipmentTypeClass(DAL.EquipmentTypeClass.EquipTypeCode, txtDescription.Text);
                int x = bll.UpdateEquipmentType(equipment);

                if (x > 0)
                {
                    txtDescription.Text = "";
                }
                else
                {
                }
            }
            catch
            {
            }

            dgEquipmentType.DataSource = bll.GetEquipmentType();
            dgEquipmentType.DataBind();
        }
Beispiel #4
0
        protected void btnManageAdd(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.EquipmentTypeClass equipment = new DAL.EquipmentTypeClass(txtDescription.Text);
                int x = bll.AddEquipmentType(equipment);

                if (x > 0)
                {
                    txtDescription.Text = "";
                }
                else
                {
                }
            }
            catch
            {
            }

            dgEquipmentType.DataSource = bll.GetEquipmentType();
            dgEquipmentType.DataBind();
        }
        private void BtnManageUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                //Error for input string not found
                DAL.EquipmentTypeClass equipment = new DAL.EquipmentTypeClass(DAL.EquipmentTypeClass.EquipTypeCode, txtEquipmentType.Text);
                int x = bll.UpdateEquipmentType(equipment);

                if (x > 0)
                {
                    txtEquipmentType.Clear();
                }
                else
                {
                    MessageBox.Show("Please input valid data.");
                }
            }
            catch
            {
                MessageBox.Show("Please input valid data.");
            }

            dgvEquipmentDetails.DataSource = bll.GetEquipmentType();
        }