protected void DropDownList4_SelectedIndexChanged(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();
        SqlCommand cm  = new SqlCommand();

        cmd.CommandText = "select blockid from block_table where blockname='" + dd_blck.SelectedValue + "'";
        DataTable dt = db.getdata(cmd);
        string    a  = dt.Rows[0][0].ToString();

        //if (dt.Rows.Count > 0)
        //{
        //cmd.CommandText = "select venue_id from book_table where date='" + txt_date.Text + "'";
        //DataTable dt1 = db.getdata(cmd);
        //int i;
        //int y = dt1.Rows.Count;
        // if (y > 0)
        // {
        //   string b= dt1.Rows[0][0].ToString();

        //for (i = 0; i < y; i++)
        //{
        //  cmd.CommandText = "select venue_id from book_table where date='" + txt_date.Text + "'";
        //  DataTable dt2 = db.getdata(cmd);
        //  if (dt2.Rows.Count > 0)
        /// {
        //   string c = dt2.Rows[i][0].ToString();
        cmd.CommandText = "select name,venue_id from venue_table where block='" + a + "' and seats > '" + txt_no.Text + "' ";;
        // cmd.CommandText = "select name,venue_id from venue_table where block='" + a + "' and seats > '" + txt_no.Text + "'"; ;
        dd_venue.DataSource     = db.getdata(cmd);
        dd_venue.DataTextField  = "name";
        dd_venue.DataValueField = "venue_id";
        dd_venue.DataBind();
        dd_venue.Items.Insert(0, "select");
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //modify form as approve or reject bus
        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText              = "select ID,Source,Destination from Root_info";
            DropDownList1.DataSource     = db.getdata(cmd);
            DropDownList1.DataTextField  = "Source";
            DropDownList1.DataValueField = "ID";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "select");

            DropDownList2.DataSource     = db.getdata(cmd);
            DropDownList2.DataTextField  = "Destination";
            DropDownList2.DataValueField = "ID";
            DropDownList2.DataBind();
            DropDownList2.Items.Insert(0, "select");


            cmd.CommandText              = "select * from Root_info";
            DropDownList3.DataSource     = db.getdata(cmd);
            DropDownList3.DataTextField  = "Name";
            DropDownList3.DataValueField = "ID";
            DropDownList3.DataBind();
            //cmd.CommandText = "select * from Ownerinfo";
            //DropDownList4.DataSource = db.getdata(cmd);
            //DropDownList4.DataTextField = "Name";
            //DropDownList4.DataTextField = "ID";
            //DropDownList4.DataBind();
        }
    }
示例#3
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select regno,department,block,phone,venue_id,coordinator,block from book_table where bookid='" + txtid.Text + "' ";
        DataTable dt = db.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            /*string type = dt.Rows[0][3].ToString();
             * /*if ("Select * from login where status=='"admin")*/
            {
                txtdep.Text     = dt.Rows[0][1].ToString();
                txtreg.Text     = dt.Rows[0][0].ToString();
                txtnum.Text     = dt.Rows[0][3].ToString();
                txtcorname.Text = dt.Rows[0][5].ToString();
                txtblck.Text    = dt.Rows[0][6].ToString();
                cmd.CommandText = "select name from venue_table where venue_id='" + dt.Rows[0][4] + "'";
                DataTable dt1 = db.getdata(cmd);
                txtven.Text = dt1.Rows[0][0].ToString();
            }
        }
        else
        {
            Response.Write("<script>alert('Incorrect booking ID please enter valid id')</script>");
        }
    }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MultiView1.SetActiveView(View1);
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText      = "select * from Ownerinfo";
         DataGrid1.DataSource = db.getdata(cmd);
         DataGrid1.DataBind();
     }
 }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         MultiView1.SetActiveView(View1);
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText      = "select * from dev_request_table where status='pending'";
         DataGrid1.DataSource = db.getdata(cmd);
         DataGrid1.DataBind();
     }
 }
        public ActionResult doc_portfolio_show()
        {
            int        id  = Convert.ToInt32(Session["logid"]);
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "get_docs_details";
            cmd.Parameters.AddWithValue("@did", id);
            DataTable dt = db.getdata(cmd);

            Session["DocDetails"] = dt;
            return(View());
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        if (!IsPostBack)
        {
            cmd.CommandText              = "select ID,Bus_Number from Bus_info where Status='pending'";
            DropDownList1.DataSource     = db.getdata(cmd);
            DropDownList1.DataTextField  = "Bus_Number";
            DropDownList1.DataValueField = "ID";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "Select");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Name"] != null)
        {
            Label1.Text = Session["Name"].ToString();
        }
        SqlCommand cmd = new SqlCommand();

        if (!IsPostBack)
        {
            cmd.CommandText              = "select evnt_name,bookid from book_table where regno='" + Label1.Text + "' ";
            DropDownList1.DataSource     = db.getdata(cmd);
            DropDownList1.DataTextField  = "evnt_name";
            DropDownList1.DataValueField = "bookid";
            DropDownList1.DataBind();
            DropDownList1.Items.Insert(0, "Select");
        }
        // SqlCommand cmd = new SqlCommand();
        // cmd.CommandText = "select evnt_name,bookid from book_table where regno='" + Label1.Text + "' ";
        // //DataTable dt = db.getdata(cmd);
        // DropDownList1.DataSource = db.getdata(cmd); //dt;
        // DropDownList1.DataTextField = "evnt_name";
        //// DropDownList1.DataValueField = "book_id";
        // DropDownList1.DataBind();
    }
    protected void OnSelectedIndexChanged(object sender, EventArgs e)
    {
        string message = DropDownList1.SelectedItem.Text;
        //ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + message + "');", true);
        //Response.Write(DropDownList1.SelectedItem.Text);
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText      = "select device,quantity from dev_request_table where prgm= '" + message + "'";
        DataGrid1.DataSource = db.getdata(cmd);
        DataGrid1.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         SqlCommand cmd = new SqlCommand();
         cmd.CommandText = "select * from Root_info";
         DataTable dt = db.getdata(cmd);;
         DropDownList1.DataSource     = dt;
         DropDownList1.DataTextField  = "Name";
         DropDownList1.DataValueField = "ID";
         DropDownList1.DataBind();
     }
 }
    protected void Page_Load(object sender, EventArgs e)

    {
        if (Session["Name"] != null)
        {
            Label1.Text = Session["Name"].ToString();
        }

        if (!IsPostBack)
        {
            SqlCommand cmd = new SqlCommand();
            cmd.CommandText      = "select * from book_table where regno='" + Label1.Text + "'";
            DataGrid1.DataSource = db.getdata(cmd);
            DataGrid1.DataBind();


            MultiView1.SetActiveView(View1);
        }
    }
        public ActionResult patient_medical_details()
        {
            int        id  = Convert.ToInt32(Session["logid"]);
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "get_patient_med_details";
            cmd.Parameters.AddWithValue("@pid", id);
            DataTable dt = d.getdata(cmd);

            Session["PatMedDetails"] = dt;
            if (dt.Rows.Count == 0)
            {
                Session["Buttontext"] = 0;
            }
            else
            {
                Session["Buttontext"] = 1;
            }
            return(View());
        }
示例#13
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from Login_page where User_Name='" + TextBox1.Text + "' and Password='******' ";
        DataTable dt = db.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            string type = dt.Rows[0][3].ToString();
            if (type == "admin")
            {
                Response.Redirect("A_home.aspx");
            }
        }
        else
        {
            Response.Write("<script>alert('Incorrect User Name and Password')</script>");
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from login_table where regno='" + TextBox1.Text + "' and password='******' ";
        DataTable dt = db.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            /*string type = dt.Rows[0][3].ToString();
             * /*if ("Select * from login where status=='"admin")*/
            {
                Session["Name"] = TextBox1.Text;
                Response.Redirect("editbooking.aspx");
            }
        }
        else
        {
            Response.Write("<script>alert('Incorrect User Name and Password')</script>");
        }
    }
示例#15
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select name,Course,phone,Sem,Phone from reg where reg ='" + txtreg.Text + "' ";
        DataTable dt = db.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            txtnme.Text = dt.Rows[0][0].ToString();
            // txtreg.Text = dt.Rows[0][0].ToString();
            txtdep.Text = dt.Rows[0][1].ToString();
            txtsem.Text = dt.Rows[0][3].ToString();
            txtphn.Text = dt.Rows[0][4].ToString();
            // cmd.CommandText = "select name from venue_table where venue_id='" + dt.Rows[0][4] + "'";
            //  DataTable dt1 = db.getdata(cmd);
            //   txtven.Text = dt1.Rows[0][0].ToString();
        }
        else
        {
            Response.Write("<script>alert('Incorrect ID please enter valid id')</script>");
        }
    }
示例#16
0
    public string login(string Username, string Password)
    {
        string     s   = "";
        SqlCommand cmd = new SqlCommand();

        cmd.CommandText = "select * from Login_page where User_Name='" + Username + "' and Password='******'";
        DataTable dt = db.getdata(cmd);

        if (dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                s += dr[0].ToString() + "#" + dr[3].ToString();
            }
            //s = dt.Rows[0][0].ToString() + "#" + dt.Rows[0][3].ToString();
        }
        else
        {
            s = "error";
        }
        return(s);
    }
        public ActionResult login_check(FormCollection fm)
        {
            string type = "", page = "";

            lc.usern = fm["ctl00$ContentPlaceHolder1$uname_text"];
            lc.passd = fm["ctl00$ContentPlaceHolder1$pass_text"];
            SqlCommand cmd = new SqlCommand();

            cmd.CommandText = "login_user";
            cmd.Parameters.AddWithValue("@username", lc.usern);
            cmd.Parameters.AddWithValue("@password", lc.passd);

            DataTable dt = db.getdata(cmd);

            if (dt.Rows.Count > 0)
            {
                Session["logid"] = dt.Rows[0][0].ToString();
                if (dt.Rows[0][1].ToString() == "Patient")
                {
                    SqlCommand cmd1 = new SqlCommand();
                    cmd1.CommandText = "get_patdetails";
                    cmd1.Parameters.AddWithValue("@pid", Session["logid"]);
                    DataTable dt1 = db.getdata(cmd1);

                    if (dt1.Rows[0][2].ToString() == "")//new patient
                    {
                        type             = "patient_reg";
                        page             = "patient_registration";
                        Session["pname"] = lc.usern;
                    }
                    else
                    {
                        type             = "patient_reg";
                        page             = "patient_portfolio_show";
                        Session["pname"] = dt1.Rows[0][2].ToString();
                    }

                    //return RedirectToAction("patient_portfolio_show", "patient_reg");
                }
                else if (dt.Rows[0][1].ToString() == "Doctor")
                {
                    type = "Doc_home";
                    page = "doc_portfolio_show";
                }
                else if (dt.Rows[0][1].ToString() == "Admin")
                {
                    type = "Site_admin";
                    page = "Admin_add_doctor";
                    //return RedirectToAction("Doc_registration", "Site_admin");
                }
            }
            else
            {
                type = "Login";
                page = "login_user";

                TempData["failedlogin"] = "******";
            }

            return(RedirectToAction(page, type));
        }