Example #1
0
        public override void btndelete_Click(object sender, EventArgs e)
        {
            string CText = string.Empty;

            foreach (System.Data.DataRowView item in listBox1.SelectedItems)
            {
                CText += item.Row.Field <String>(1);
            }
            var value = CText.Split(' ').ToList();

            int k = Connection.Login("select count(*) from tbl_classstudent where classno ='" + valcmbclass.SelectedValue.ToString() + "' and section=(select top 1 sectioncode from tbl_section where sectionname='" + value[1].ToString() + "')");

            if (k > 0)
            {
                MessageBox.Show("You Can Not Delete Record.");
            }
            else
            {
                DialogResult d = MessageBox.Show("Are You Sure You Want To Delete Record.", "", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    Connection.AllPerform("delete   FROM  tbl_class where classno='" + listBox1.SelectedValue.ToString() + "'");
                    MessageBox.Show("Record Deleted.");
                    c.FillListBox("select a.classno,b.classname+' '+c.sectionname   as class from tbl_class a,tbl_classmaster b,tbl_section c where b.classcode=a.classcode and c.sectioncode=a.sectioncode order by a.classcode,c.sectioncode", "class", "classno", ref listBox1);
                    //Connection.AllPerform("Delete from tbl_section where sectioncode ='" + valcmbsection.SelectedValue.ToString() + "'");
                    //Connection.AllPerform("Delete from tbl_sankay where sankaycode ='" + valcmbsankay.SelectedValue.ToString() + "'");
                    DesignForm.fromClear(this);
                }
            }
        }
Example #2
0
        public void btndelete_Click(object sender, EventArgs e)
        {
            int k = Connection.Login("select count(*) from tbl_student where tehcode ='" + txtsankaycode.Text + "'");

            if (k > 0)
            {
                MessageBox.Show("You Can Not Delete Student Record ...");
            }
            else
            {
                DialogResult d = MessageBox.Show("Are You Sure You Want To Delete Record", "", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    Connection.AllPerform("delete  from tbl_tehsil where tehsil='" + txtsankayname.Text + "' ");
                    MessageBox.Show("Record Deleted");
                    c.FillListBox("select * from tbl_tehsil order by tehsil", "tehsil", "tehcode", ref listBox1);
                    DesignForm.fromClear(this);
                }
            }
        }
Example #3
0
        private void btndelete_Click(object sender, EventArgs e)
        {
            int k = Connection.Login("SELECT     COUNT(*) AS Expr1  FROM         tbl_subwiseclass  WHERE     (subjectno = '" + txtSubjectNo.Text + "')   ");

            if (k > 0)
            {
                MessageBox.Show("You Can Not Delete Subject  Record.");
            }
            else
            {
                DialogResult d = MessageBox.Show("Are You Sure You Want To Delete Record", "", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    Connection.AllPerform("delete  from tbl_subject where subjectno='" + txtSubjectNo.Text + "' ");
                    Connection.AllPerform("Delete from tbl_subwiseclass where subjectno ='" + txtSubjectNo.Text + "'");
                    MessageBox.Show("Record Deleted.");
                    c.FillListBox("select distinct subjectno,subjectname from tbl_subject Order By subjectno", "subjectname", "subjectno", ref listBox1);
                    DesignForm.fromClear(this);
                }
            }
        }
Example #4
0
        public override void btndelete_Click(object sender, EventArgs e)
        {
            int k = Connection.Login("SELECT COUNT(*) AS Expr1   FROM tbl_classstudent  WHERE (Stream = '" + txtsankaycode.Text + "') ");

            if (k > 0)
            {
                MessageBox.Show("You Can Not Delete Stream Record.");
            }
            else
            {
                DialogResult d = MessageBox.Show("Are You Sure You Want To Delete Record.", "", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    Connection.AllPerform("delete from tbl_sankay where sankayname='" + txtsankayname.Text + "' ");
                    MessageBox.Show("Record Deleted.");
                    c.FillListBox("select * from tbl_sankay", "sankayname", "sankaycode", ref listBox1);

                    DesignForm.fromClear(this);
                }
            }
        }
Example #5
0
        public override void btndelete_Click(object sender, EventArgs e)
        {
            int k = Connection.Login("select count(*) from tbl_classfeeregular where feecode='" + txtclasscode.Text + "'");

            if (k > 0)
            {
                MessageBox.Show("You Can Not Delete Fee Heads Record ...");
            }
            else
            {
                DialogResult d = MessageBox.Show("Are You Sure You Want To Delete Record", "", MessageBoxButtons.YesNo);
                if (d.ToString() == "Yes")
                {
                    Connection.AllPerform("delete  from tbl_feeheads where feeheads='" + txtfeehead.Text + "' ");
                    txtfeehead.Text = "";
                    MessageBox.Show("Record Deleted");
                    c.FillListBox("select DISTINCT feecode,feeheads from tbl_feeheads order by feeheads", "feeheads", "feecode", ref listBox1);

                    DesignForm.fromClear(this);
                }
            }
        }