Exemplo n.º 1
0
 private void button3_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtID.Text == "")
         {
             MessageBox.Show("اضغطت مرتين على الرسم لتحديد المعرف");
             return;
         }
         Class_OtherFees.usp_tblOtherFeesUpdate(int.Parse(txtID.Text), txtName.Text, decimal.Parse(txtPrice.Text));
         MessageBox.Show("تم تعديل الرسوم بنجاح");
         GetData();
         Clean();
     }
     catch (SqlException ex)
     {
         if (ex.Number == 2627)
         {
             MessageBox.Show("هذا الرسم موجود مسبقا");
         }
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtName.Text == "" || txtPrice.Text == "")
                {
                    MessageBox.Show("المرجوا مراجعة الحقول");
                    return;
                }
                Class_OtherFees.usp_tblOtherFeesInsert(txtName.Text, decimal.Parse(txtPrice.Text));
                MessageBox.Show("تمت إضافة الرسوم بنجاح");
                GetData();
                Clean();
            }
            catch (SqlException ex)
            {
                if (ex.Number == 2627)
                {
                    MessageBox.Show("هذا الرسم موجود مسبقا");
                }

                MessageBox.Show(ex.Message + ex.Number);
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 3
0
        private void GetData()
        {
            DataTable dt = Class_OtherFees.usp_tblOtherFeesSelect();

            grdView.DataSource         = dt;
            grdView.Columns[0].Visible = false;
        }
Exemplo n.º 4
0
        public void GetOtherFees()
        {
            listView1.Items.Clear();
            DataTable dt = Class_OtherFees.usp_tblOtherFeesSelect();

            foreach (DataRow dr in dt.Rows)
            {
                ListViewItem item = new ListViewItem(dr[0].ToString());
                item.SubItems.Add(dr[1].ToString());
                item.SubItems.Add(dr[2].ToString());
                listView1.Items.Add(item);
                listView1.Columns[0].Width = 0;
            }
        }
Exemplo n.º 5
0
 private void button4_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtID.Text == "")
         {
             MessageBox.Show("اضغطت مرتين على الرسم لتحديد المعرف");
             return;
         }
         DialogResult dr = MessageBox.Show("هل تريد حقاً إزالة هذا الرسم", "رسالة تحذيرية", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (dr == DialogResult.Yes)
         {
             Class_OtherFees.usp_tblOtherFeesDelete(int.Parse(txtID.Text));
             MessageBox.Show("تم الحذف بنجاح");
             GetData();
             Clean();
         }
     }
     catch (Exception ex)
     {
         //MessageBox.Show(ex.Message);
     }
 }