Пример #1
0
        private void btnstudentsearch_Click(object sender, EventArgs e)
        {
            if (txtstudentid.Text != null)
            {
                model_students.regid = txtstudentid.Text;
                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    if (db.basicdata_student.Where(data => data.regid == txtstudentid.Text).Any())
                    {
                        model_students        = db.basicdata_student.Where(x => x.regid == model_students.regid).FirstOrDefault();
                        txtstudentname.Text   = model_students.Firstname;
                        txtbatch.Text         = model_students.Batch;
                        txtschool.Text        = model_students.Al_school;
                        cmbexam.Enabled       = true;
                        btnexamsearch.Enabled = true;
                        get_student_exam_vale_list();
                    }
                    else
                    {
                        clear();
                        MessageBox.Show("Invalud Student Registration ID. Please Try Again!");
                    }
                }
            }
            else
            {
                MessageBox.Show("Invalud Student Registration ID. Please Try Again!");
                clear();
            }

            populate_all_student_exam_marks_data();
        }
Пример #2
0
        private void btnsearch_Click(object sender, EventArgs e)
        {
            if (txtsearch.Text != null)
            {
                model_students.regid = txtfind.Text;

                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    model_students              = db.basicdata_student.Where(x => x.regid == model_students.regid).FirstOrDefault();
                    txtfirstname.Text           = model_students.Firstname;
                    txtlastname.Text            = model_students.Lastname;
                    txtnic.Text                 = model_students.Nic;
                    dtpdob.Text                 = model_students.Dob;
                    txthomeaddress.Text         = model_students.home_address;
                    txthometell.Text            = model_students.Home_tell;
                    txtstayingaddress.Text      = model_students.Staying_address;
                    txtstayingtell.Text         = model_students.Stay_home_tell;
                    txtfathername.Text          = model_students.Father_name;
                    txtparenttell.Text          = model_students.Parents_contact;
                    cmbolschool.Text            = model_students.Ol_School;
                    cmbalschool.Text            = model_students.Al_school;
                    txtolresult.Text            = model_students.Ol_result;
                    txtjoiningdate.Text         = model_students.JoinDate;
                    cmbbatch.Text               = model_students.Batch;
                    cmbgender.Text              = model_students.Gender;
                    cmbscholership.SelectedItem = model_students.Scholarship;
                }

                btnSave.Text      = "Update";
                btnDelete.Enabled = true;
            }
        }
Пример #3
0
        private void dgvStudent_DoubleClick(object sender, EventArgs e)
        {
            if (dgvStudent.CurrentRow.Index != -1)
            {
                model_students.Id = Convert.ToInt32(dgvStudent.CurrentRow.Cells["Id"].Value);

                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    model_students              = db.basicdata_student.Where(x => x.Id == model_students.Id).FirstOrDefault();
                    txtfirstname.Text           = model_students.Firstname;
                    txtlastname.Text            = model_students.Lastname;
                    txtnic.Text                 = model_students.Nic;
                    dtpdob.Text                 = model_students.Dob;
                    txthomeaddress.Text         = model_students.home_address;
                    txthometell.Text            = model_students.Home_tell;
                    txtstayingaddress.Text      = model_students.Staying_address;
                    txtstayingtell.Text         = model_students.Stay_home_tell;
                    txtfathername.Text          = model_students.Father_name;
                    txtparenttell.Text          = model_students.Parents_contact;
                    cmbolschool.Text            = model_students.Ol_School;
                    cmbalschool.Text            = model_students.Al_school;
                    txtolresult.Text            = model_students.Ol_result;
                    txtjoiningdate.Text         = model_students.JoinDate;
                    cmbbatch.Text               = model_students.Batch;
                    cmbgender.Text              = model_students.Gender;
                    cmbscholership.SelectedItem = model_students.Scholarship;
                }

                btnSave.Text      = "Update";
                btnDelete.Enabled = true;
            }
        }
Пример #4
0
        private void btnsearch_Click(object sender, EventArgs e)
        {
            if (txtfind.Text != null)
            {
                groupId.Visible = true;

                model_students.regid = txtfind.Text;

                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    if (db.basicdata_student.Where(data => data.regid == txtfind.Text).Any())
                    {
                        model_students      = db.basicdata_student.Where(x => x.regid == model_students.regid).FirstOrDefault();
                        lblname.Text        = model_students.Firstname;
                        lblregid.Text       = model_students.regid;
                        lbljoiningdate.Text = model_students.JoinDate;
                        lblbatch.Text       = model_students.Batch;
                    }
                    else
                    {
                        clear();
                        MessageBox.Show("Invalud Student Registration ID. Please Try Again!");
                    }
                }

                string barCode = model_students.regid;
                try
                {
                    if (barCode != null)
                    {
                        Zen.Barcode.Code128BarcodeDraw brCode = Zen.Barcode.BarcodeDrawFactory.Code128WithChecksum;
                        picbatcode.Image = brCode.Draw(barCode, 60);
                    }
                }
                catch (Exception)
                {
                }


                txtsavefilename.Text = "StudentIDCard_" + model_students.regid;
            }
            else
            {
                MessageBox.Show("Invalud Student Registration ID. Please Try Again!");
                clear();
            }
        }
Пример #5
0
        private void btnstudentsearch_Click(object sender, EventArgs e)
        {
            populate_all_student_exam_marks_data();

            chartAvg.Series["Average"].XValueMember  = "exam";
            chartAvg.Series["Average"].YValueMembers = "average_marks";
            chartAvg.DataSource = dgvStudentResultData.DataSource;
            chartAvg.DataBind();

            charAvgBar.Series["Average"].XValueMember  = "exam";
            charAvgBar.Series["Average"].YValueMembers = "average_marks";
            charAvgBar.DataSource = dgvStudentResultData.DataSource;
            charAvgBar.DataBind();

            chartEconomics.Series["Economics"].XValueMember  = "exam";
            chartEconomics.Series["Economics"].YValueMembers = "subject_1";
            chartEconomics.DataSource = dgvStudentResultData.DataSource;
            chartEconomics.DataBind();

            chartAccounting.Series["Accounting"].XValueMember  = "exam";
            chartAccounting.Series["Accounting"].YValueMembers = "subject_3";
            chartAccounting.DataSource = dgvStudentResultData.DataSource;
            chartAccounting.DataBind();

            chartBusiness.Series["BusinessStudies"].XValueMember  = "exam";
            chartBusiness.Series["BusinessStudies"].YValueMembers = "subject_2";
            chartBusiness.DataSource = dgvStudentResultData.DataSource;
            chartBusiness.DataBind();


            model_students.regid = txtstudentid.Text;
            using (proadmin_v1Entities db = new proadmin_v1Entities())
            {
                if (db.basicdata_student.Where(data => data.regid == txtstudentid.Text).Any())
                {
                    model_students    = db.basicdata_student.Where(x => x.regid == model_students.regid).FirstOrDefault();
                    txtfirstname.Text = model_students.Firstname;
                    txtlastname.Text  = model_students.Lastname;
                    txtbatch.Text     = model_students.Batch;
                    txtschool.Text    = model_students.Al_school;
                }
                else
                {
                    MessageBox.Show("Invalud Student Registration ID. Please Try Again!");
                }
            }
        }
Пример #6
0
        private void btnregister_Click(object sender, EventArgs e)
        {
            if (txtstudentid.Text != null)
            {
                model_student.regid = txtstudentid.Text;
                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    if (db.basicdata_student.Where(data => data.regid == txtstudentid.Text).Any())
                    {
                        model_student = db.basicdata_student.Where(x => x.regid == model_student.regid).FirstOrDefault();
                        txtbatch.Text = model_student.Batch;
                    }
                    else
                    {
                        clear();
                        lblmessage.Text = "Invalid Class Entry..";
                    }
                }

                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    model_attandance.intime     = DateTime.Now.ToString();
                    model_attandance.attandance = "Attend";

                    if (db.data_attandance.Where(data => data.regid == txtstudentid.Text && data.batch == txtbatch.Text && data.classdate == txttoday.Text).Any())//Update attandance
                    {
                        model_attandance            = db.data_attandance.Where(x => x.regid == txtstudentid.Text && x.batch == txtbatch.Text && x.classdate == txttoday.Text).FirstOrDefault();
                        model_attandance.intime     = DateTime.Now.ToString();
                        model_attandance.attandance = "Attend";

                        db.Entry(model_attandance).State = EntityState.Modified;
                        db.SaveChanges();

                        lblmessage.Text = "Welcome : " + model_student.Firstname;
                    }
                    else
                    {
                        lblmessage.Text = "Invalid Class Entry..";
                    }
                }
                txtstudentid.Text = null;
                txtbatch.Text     = null;
            }
        }
Пример #7
0
        private void btnregister_Click(object sender, EventArgs e)
        {
            if (txtstudentid.Text != null)
            {
                model_student.regid = txtstudentid.Text;
                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    if (db.basicdata_student.Where(data => data.regid == txtstudentid.Text).Any())
                    {
                        model_student = db.basicdata_student.Where(x => x.regid == model_student.regid).FirstOrDefault();
                        batch         = model_student.Batch;
                    }
                    else
                    {
                        txtstudentid.Text = null;
                        lblmessage.Text   = "Invalid Entry..";
                    }

                    model_fee = db.basicdate_fee.Where(data => data.batch_ == batch).FirstOrDefault();
                    amount    = model_fee.amount;
                }

                using (proadmin_v1Entities db = new proadmin_v1Entities())
                {
                    if (db.data_feecollection.Where(data => data.regid == txtstudentid.Text && data.batch == batch && data.feeschedule == txtmonth.Text).Any())//Update attandance
                    {
                        model_feecollection              = db.data_feecollection.Where(data => data.regid == txtstudentid.Text && data.batch == batch && data.feeschedule == txtmonth.Text).FirstOrDefault();
                        model_feecollection.payment      = "Paid";
                        model_feecollection.payment_date = DateTime.Now.ToString();
                        model_feecollection.amount       = amount;

                        db.Entry(model_feecollection).State = EntityState.Modified;
                        db.SaveChanges();

                        lblmessage.Text = "Payment Colleted for : " + model_student.Firstname;
                    }
                    else
                    {
                        lblmessage.Text = "Invalid Entry..";
                    }
                }
                txtstudentid.Text = null;
            }
        }