Exemple #1
0
        public Trips_Summary()
        {
            InitializeComponent();
            dataGridView6.DataSource = db.GetTable("SELECT [Id] as [Sl. No.],[Vehicle No.],[Journey],[Purpose],[Provider],[mobile] as [Mobile No.],[date] as [Start Date],[driver] as [Driver],[Remarks]FROM [AVVMS].[dbo].[Trips]  ");

            groupBox1.Hide();
        }
        public View_Report(string p, string p_2)
        {
            // TODO: Complete member initialization
            InitializeComponent();
            branch   = p;
            semester = p_2;
            //MessageBox.Show(p);
            //MessageBox.Show(p_2);
            d = db.GetTable("select distinct date from attendance where branch='" + branch + "' and semester='" + semester + "'");
            //MessageBox.Show("select distinct date from attendance where branch='" + branch + "' and semester='" + semester + "'");
            //MessageBox.Show("Total count of days" + d.Rows.Count.ToString());
            totalp = 5 * d.Rows.Count;
            // MessageBox.Show("Total periods: " + totalp);
            //MessageBox.Show("Students Report...");
            dt = db.GetTable("select *from " + branch.Substring(0, 6) + "s" + semester.Substring(8) + "");
            for (int j = 0; j < dt.Rows.Count; j++)
            {
//MessageBox.Show(dt.Rows[j]["reg"].ToString());
                //MessageBox.Show(dt.Rows[j]["name"].ToString());

                int acount = 0;



                for (int i = 0; i < d.Rows.Count; i++)
                {
                    dattendence = db.GetTable("select p1,p2,p3,p4,p5 from attendance where reg='" + dt.Rows[j]["reg"].ToString() + "' and branch='" + branch + "' and semester='" + semester + "' and date='" + d.Rows[i]["date"].ToString() + "' ");
                    String a = "select p1,p2,p3,p4,p5 from attendance where reg='" + dt.Rows[j]["reg"].ToString() + "' and branch='" + branch + "' and semester='" + semester + "' and date='" + d.Rows[i]["date"].ToString() + "'";
                    MessageBox.Show(a);
                    if (dattendence.Rows[0]["p1"].ToString().Equals("1"))
                    {
                        acount++;
                    }
                    if (dattendence.Rows[0]["p2"].ToString().Equals("1"))
                    {
                        acount++;
                    }
                    if (dattendence.Rows[0]["p3"].ToString().Equals("1"))
                    {
                        acount++;
                    }
                    if (dattendence.Rows[0]["p4"].ToString().Equals("1"))
                    {
                        acount++;
                    }
                    if (dattendence.Rows[0]["p5"].ToString().Equals("1"))
                    {
                        acount++;
                    }
                }


                // MessageBox.Show("Total present of "+dt.Rows[j]["name"].ToString() +": " + acount);

                dataGridView1.Rows.Add(dt.Rows[j]["reg"].ToString(), dt.Rows[j]["name"].ToString(), d.Rows.Count.ToString(), totalp.ToString(), acount.ToString(), ((float)acount / totalp) * 100 + " %");

                //MessageBox.Show("% is" + (((float)acount /totalp )*100).ToString() + "%");
                //, d.Rows.Count.ToString(), totalp.ToString(), acount.ToString());
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DropDownList_doctor.DataSource     = db.GetTable("SELECT ID AS Expr1, Name AS Expr2 FROM Doctor");
         DropDownList_doctor.DataTextField  = "Expr2";
         DropDownList_doctor.DataValueField = "Expr1";
         DropDownList_doctor.DataBind();
         DropDownList_doctor.Enabled = false;
         Button_token.Enabled        = false;
     }
 }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        id = Convert.ToInt32(GridView1.SelectedRow.Cells[2].Text);
        //Labelerror.Text = id.ToString();
        DataTable dt1 = dh.GetTable("Select * from subjects where sub_id= " + id);

        txt_sub.Text  = dt1.Rows[0][1].ToString();
        txt_syll.Text = dt1.Rows[0][2].ToString();
        //txt_fee.Text = dt1.Rows[0][3].ToString();
        Button2.Visible = false;
        Button1.Visible = true;
    }
Exemple #5
0
        public Petrol_Bank_Manipulation()
        {
            InitializeComponent();
            dataGridView6.DataSource = db.GetTable("SELECT [no],[date],[vehicle],[bunk] ,[amount] ,[remark],litres FROM [AVVMS].[dbo].[refill bill]");


            oa = 0;
            for (int i = 0; i < dataGridView6.Rows.Count; i++)
            {
                oa = oa + Convert.ToDouble(dataGridView6.Rows[i].Cells[4].Value.ToString());
            }
            label9.Text = "Total : " + oa.ToString();
        }
Exemple #6
0
 public Vehicle_Maintanance()
 {
     InitializeComponent();
     button1.Enabled          = false;
     dataGridView6.DataSource = db.GetTable("SELECT [no.],[date] ,[vehicle no.],[to],[from],[amount],[payement mode],[document code],[document date],[remarks]FROM [AVVMS].[dbo].[tax]");
     oa = 0;
     for (int i = 0; i < dataGridView6.Rows.Count; i++)
     {
         oa = oa + Convert.ToDouble(dataGridView6.Rows[i].Cells[5].Value.ToString());
     }
     label9.Text = "Total : " + oa.ToString();
     panel2.Hide();
 }
Exemple #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 0;

        //FillTable();
        if (!IsPostBack)
        {
            DataTable dt = DH.GetTable("select ''exam_id,'Select' exam_name union all select exam_id,exam_name from exam");
            DropDownList1.DataSource = dt;

            DropDownList1.DataTextField  = "exam_name";
            DropDownList1.DataValueField = "exam_id";
            DropDownList1.DataBind();
        }
    }
Exemple #8
0
    protected void Change_Click(object sender, EventArgs e)
    {
        DataTable dt = dh.GetTable("select password,uid from [login] where uid='" + Session["user"] + "'");

        Label2.Visible = false;
        if (dt.Rows.Count < 1)
        {
            Label2.Text     = "Unknown User";
            Label2.CssClass = "failurenotification";
            Label2.Visible  = true;
        }
        else
        {
            if (!dt.Rows[0]["password"].ToString().Equals(TextBox1.Text))
            {
                Label2.Text     = "Unknown password";
                Label2.CssClass = "failurenotification";
                Label2.Visible  = true;
            }
            else
            {
                if (!TextBox2.Text.Equals(TextBox3.Text))
                {
                    Label2.CssClass = "failurenotification";
                    Label2.Text     = "The Password and Confirmation Password must match.";
                    Label2.Visible  = true;
                }
                else
                {
                    dh.Ins_Up_Del("update [login] set password='******' where uid=" + dt.Rows[0]["uid"]);
                    Response.Redirect("ChangePasswordSuccess.aspx");
                }
            }
        }
    }
Exemple #9
0
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        DataTable dt = dh.GetTable("select password,uid from login where (username = '******')");

        if (dt.Rows.Count < 1)
        {
            Label2.Text     = "Unknown User";
            Label2.CssClass = "failurenotification";
            Label2.Visible  = true;
        }
        else
        {
            if (!dt.Rows[0]["password"].ToString().Equals(Password.Text))
            {
                Label2.Text     = "Unknown password";
                Label2.CssClass = "failurenotification";
                Label2.Visible  = true;
            }
            else
            {
                //dh.Ins_Up_Del("update [login] set statusid = '" + DropDownList1.SelectedItem.ToString() + "' where (uid = " + dt.Rows[0]["uid"] + ")");
                Session["user"] = dt.Rows[0]["uid"];
                Response.Redirect("Home.aspx");
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable dt = dh.GetTable("select ''sub_id,'Select' sub_name union all select sub_id,sub_name from Subjects");
            DropDownList1.DataSource = dt;

            DropDownList1.DataTextField  = "sub_name";
            DropDownList1.DataValueField = "sub_id";
            DropDownList1.DataBind();
        }


        FillTable();
        Button1.Visible = false;
    }
Exemple #11
0
        public correction2(string p, string p_2, string p_3, string p_4)
        {
            // TODO: Complete member initialization
            InitializeComponent();
            branch   = p;
            semester = p_2;
            no       = p_3;
            date     = p_4;
            d        = db.GetTable("select *from " + branch.Substring(0, 6) + "s" + semester.Substring(8) + " where (reg='" + no + "')");
            dt       = db.GetTable("select date,p1,p2,p3,p4,p5,reg from attendance where (branch='" + branch + "' and date='" + date + "' and semester='" + semester + "' and reg='" + no + "')");

            dataGridView1.Rows.Add(dt.Rows[0]["reg"].ToString(), d.Rows[0]["name"].ToString(), dt.Rows[0]["date"].ToString(), dt.Rows[0]["p1"].ToString(), dt.Rows[0]["p2"].ToString(), dt.Rows[0]["p3"].ToString(), dt.Rows[0]["p4"].ToString(), dt.Rows[0]["p5"].ToString());
            textBox1.Text = dt.Rows[0]["p1"].ToString();
            textBox2.Text = dt.Rows[0]["p2"].ToString();
            textBox3.Text = dt.Rows[0]["p3"].ToString();
            textBox4.Text = dt.Rows[0]["p4"].ToString();
            textBox5.Text = dt.Rows[0]["p5"].ToString();
        }
Exemple #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable dt = new DataTable();
            dt = dh.GetTable("select stud_name,a.msg_sub, a.msg from student s inner join AdminMsgs a on a.user_id=s.stud_id and user_type='student' order by msg_id desc");
            DataList1.DataSource = dt;
            DataList1.DataBind();

            RadioButtonList1.SelectedIndex = 0;
            MultiView1.ActiveViewIndex     = 0;


            DataTable dta = new DataTable();
            dta = dh.GetTable("select tea_name,a.msg_sub, a.msg from teacher s inner join AdminMsgs a on a.user_id=s.tea_id and user_type='teacher' order by msg_id desc");
            DataList2.DataSource = dta;
            DataList2.DataBind();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     dt                = dh.GetTable("select top 1 * from ResultTable r inner join Exam e on e.exam_id=r.exam_id inner join student s on s.stud_id=r.stud_id where r.stud_id=" + Session["user_id"] + " Order by result_id desc");
     lbl_exam.Text     = dt.Rows[0]["exam_name"].ToString();
     lbl_student.Text  = dt.Rows[0]["stud_name"].ToString();
     lbl_mark.Text     = dt.Rows[0][3].ToString();
     lbl_date.Text     = dt.Rows[0][4].ToString();
     lbl_passmark.Text = dt.Rows[0]["exam_passmark"].ToString();
     //lbl_chapter.Text = dt.Rows[0]["chapter_no"].ToString();
 }
Exemple #14
0
        private void branch_Load(object sender, EventArgs e)
        {
            DataTable b = db.GetTable("Select branch from branches");
            int       k = b.Rows.Count;

            for (int y = 0; y < k; y++)
            {
                comboBox1.Items.Add(b.Rows[y]["branch"].ToString());
            }
        }
Exemple #15
0
    public void Bind()
    {
        DataTable dt1 = DH.GetTable("select ''stud_id,'Select' stud_name union all select stud_id,stud_name from student where stud_status='False'");

        DropDownList1.DataSource = dt1;

        DropDownList1.DataTextField  = "stud_name";
        DropDownList1.DataValueField = "stud_id";
        DropDownList1.DataBind();
    }
Exemple #16
0
        private void su_Load(object sender, EventArgs e)
        {
            DataTable dt = db.GetTable("select branch from branches");

            int k = dt.Rows.Count;

            for (int y = 0; y < k; y++)
            {
                comboBox1.Items.Add(dt.Rows[y]["branch"].ToString());
            }

            DataTable s = db.GetTable("select semester from sem where state = '1'");

            k = s.Rows.Count;
            for (int y = 0; y < k; y++)
            {
                comboBox2.Items.Add(s.Rows[y]["semester"].ToString());
            }
        }
        private void viewbranch_Load(object sender, EventArgs e)
        {
            DataTable dt = db.GetTable("select branch,hod from branches");

            int k = dt.Rows.Count;

            for (int y = 0; y < k; y++)
            {
                dataGridView1.Rows.Add(dt.Rows[y]["branch"].ToString(), dt.Rows[y]["hod"].ToString());
            }
        }
    public DataSet GetDataSet()
    {
        DataSet   QuestionSet = new DataSet();
        DataTable QTable      = new DataTable();

        string query = "select * from ExamDetails where exam_id=" + tno + "";

        QTable = dh.GetTable(query);
        QuestionSet.Tables.Add(QTable);
        return(QuestionSet);
    }
        private void viewmsg_Load(object sender, EventArgs e)
        {
            DataTable dt = db.GetTable("select title,message from messages");

            int k = dt.Rows.Count;

            for (int y = 0; y < k; y++)
            {
                dataGridView1.Rows.Add(dt.Rows[y]["title"].ToString(), dt.Rows[y]["message"].ToString());
            }
        }
Exemple #20
0
        public Sell_Report()
        {
            InitializeComponent();
            dataGridView6.DataSource = db.GetTable("SELECT [Id] ,[Tender date] ,[Selected Tender No.] ,[Tender Amount] ,[Cheque No.] ,[Purchase date] ,[vehicle] FROM [AVVMS].[dbo].[sell]");

            oa = 0;
            for (int i = 0; i < dataGridView6.Rows.Count; i++)
            {
                oa = oa + Convert.ToDouble(dataGridView6.Rows[i].Cells[4].Value.ToString());
            }
            label9.Text = "Total : " + oa.ToString();
        }
        private void Staff_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'aMDBDataSet1.staffs' table. You can move, or remove it, as needed.

            DataTable dt = db.GetTable("select branch from branches");

            int k = dt.Rows.Count;

            for (int y = 0; y < k; y++)
            {
                comboBox1.Items.Add(dt.Rows[y]["branch"].ToString());
            }

            DataTable s = db.GetTable("select semester from sem ");

            k = s.Rows.Count;
            for (int y = 0; y < k; y++)
            {
                comboBox2.Items.Add(s.Rows[y]["semester"].ToString());
            }
        }
Exemple #22
0
        public Assign_Trip()
        {
            InitializeComponent();
            panelcleaner.Hide();
            dateTimePicker1.CustomFormat = "dd:MMM:yyyy";
            label20.Text            = db.max_plus("SELECT max([Id])FROM [AVVMS].[dbo].[Trips]").ToString();
            combotype.SelectedIndex = 0;
            combovehi.SelectedIndex = 0;

            DataTable dt = new DataTable();

            dt = db.GetTable("SELECT [Employee ID]FROM [AVVMS].[dbo].[Employee] where [Category]='Driver' and [Status]='Available'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                combodriver.Items.Add(dt.Rows[i]["Employee ID"].ToString());
            }
            combodriver.SelectedIndex = 0;

            dt = new DataTable();
            dt = db.GetTable("SELECT [Employee ID]FROM [AVVMS].[dbo].[Employee] where [Category]='Cleaner' and [Status]='Available'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                combofirst.Items.Add(dt.Rows[i]["Employee ID"].ToString());
            }

            combofirst.SelectedIndex = 0;

            for (int i = 1; i < combofirst.Items.Count; i++)
            {
                comboBox7.Items.Add(combofirst.Items[i]);
            }
            comboBox7.SelectedIndex = 0;
        }
        public Tax_Reciept_Input()
        {
            InitializeComponent();

            dt = db.GetTable("SELECT [Vehicle No.]     FROM [AVVMS].[dbo].[Vehicles] where Status != 'Removed'");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxvehicle.Items.Add(dt.Rows[i]["Vehicle No."].ToString());
            }

            comboBoxvehicle.SelectedIndex = 0;
            comboBoxpmode.SelectedIndex   = 0;
        }
    public void FillTable()
    {
        DataTable dt = db.GetTable("select sd_id 'Id',imagename 'Name' from studymaterials ");

        //for (int i = 0; i < dt.Rows.Count; i++)
        //{
        //    dt.Rows[i][1] = dt.Rows[i][1].ToString();
        //}

        dt.AcceptChanges();
        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
        public Bank_Pay_Report()
        {
            InitializeComponent();

            dataGridView6.DataSource = db.GetTable("SELECT [no],[date],[bunk],[amount],[payed],[balance],[payement mode],[document code],[remark]FROM [AVVMS].[dbo].[bunk pay]");

            oa = 0;
            for (int i = 0; i < dataGridView6.Rows.Count; i++)
            {
                oa = oa + Convert.ToDouble(dataGridView6.Rows[i].Cells[4].Value.ToString());
            }
            label9.Text = "Total : " + oa.ToString();
        }
Exemple #26
0
        public Refill_Bill_Input()
        {
            InitializeComponent();
            label11.Text = db.max_plus("SELECT max([no])FROM [AVVMS].[dbo].[refill bill]").ToString();
            DataTable dt = new DataTable();

            dt = db.GetTable("SELECT [Vehicle No.]FROM [AVVMS].[dbo].[Vehicles] where [Status]!='Removed'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxv.Items.Add(dt.Rows[i]["Vehicle No."].ToString());
            }
            comboBoxv.SelectedIndex = 0;


            dt = db.GetTable("SELECT [no]FROM [AVVMS].[dbo].[pbunk] where [Status]!='Removed'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBoxbunk.Items.Add(dt.Rows[i]["no"].ToString());
            }
            comboBoxbunk.SelectedIndex = 0;
        }
Exemple #27
0
        public Lisence_Renew_Input()
        {
            InitializeComponent();
            label2.Text = (Convert.ToInt32(db.GetValue("SELECT [no] FROM [AVVMS].[dbo].[license renew]")) + 1).ToString();
            DataTable dt = new DataTable();

            dt = db.GetTable("SELECT [Employee ID]FROM [AVVMS].[dbo].[Employee] where Status != 'Removed' AND Category='Driver'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBox1.Items.Add(dt.Rows[i]["Employee ID"].ToString());
            }
            comboBox1.SelectedIndex = 0;
            label11.Hide();
        }
        public Maintanance_Registration()
        {
            InitializeComponent();
            label8.Text = db.max_plus("SELECT max([no.])FROM [AVVMS].[dbo].[maintanance]").ToString();
            DataTable dt = new DataTable();

            dt = db.GetTable("SELECT [Vehicle No.]FROM [AVVMS].[dbo].[Vehicles] where  [Status]='On Maintenence'");

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                comboBox1.Items.Add(dt.Rows[i]["Vehicle No."].ToString());
            }

            comboBox1.SelectedIndex = 0;
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        Labelerror.Text = "";
        if (!IsPostBack)
        {
            //Labelerror1.Text = "";
            DataTable dt = dh.GetTable("select ''exam_id,'Select' exam_name union all select e.exam_id,e.exam_name from exam e inner join " +
                                       " student s on s.sub_id=e.sub_id where s.stud_id=" + Session ["user_id"]);
            DropDownList1.DataSource = dt;

            DropDownList1.DataTextField  = "exam_name";
            DropDownList1.DataValueField = "exam_id";
            DropDownList1.DataBind();
        }
    }
Exemple #30
0
        public Vehicle_Manipulation()
        {
            InitializeComponent();
            dataGridView6.DataSource = db.GetTable("SELECT [Vehicle No.] ,[Type] ,[Model]  ,[Fuel Capacity] as Milage,[Fuel Type],[fuel]as [Current Feul],[Fuel Refill Limit]    ,[Status]    FROM [AVVMS].[dbo].[Vehicles] where Status != 'Removed'");

            // [Quotatio date] ,[Selected Quotation No.] ,[Purchase Amount] ,[Cheque No.] ,[Purchase date]
            // ,[Insurance Target] ,[CF date] ,[Pollution Certificate Expiry date] ,[Green Tax Expiry date]
            groupBox1.Hide();
            button9.Hide();
        }