Ejemplo n.º 1
0
    protected void btnreg_Click(object sender, EventArgs e)
    {
        string adhar = txtadhar.Text;
        string name  = txtname.Text;
        string user  = txtuser.Text;
        string pwd   = txtpwd.Text;
        string add   = txtadd.Text;
        string dis   = txtdist.Text;
        string pin   = txtpin.Text;
        string ph    = txtph.Text;
        string email = txtemail.Text;



        qry = "insert into registration values('" + adhar + "','" + name + "','" + add + "','" + ph + "','" + email + "','" + dis + "','" + pin + "')";
        //Response.Write(qry);
        obj = new ForController();
        obj.controllerNonQuery(qry);

        qry = "insert into login values(null,'" + user + "','" + pwd + "',2)";
        obj = new ForController();
        obj.controllerNonQuery(qry);


        lblmsg.Text   = "Sucessfully Register";
        txtname.Text  = "";
        txtuser.Text  = "";
        txtpwd.Text   = "";
        txtadd.Text   = "";
        txtph.Text    = "";
        txtemail.Text = "";
        txtadhar.Text = "";
        txtdist.Text  = "";
        txtpin.Text   = "";
    }
Ejemplo n.º 2
0
    protected void btnlogin_Click(object sender, EventArgs e)
    {
        string user = txtuser.Text;
        string pwd  = txtpwd.Text;


        qry = "select user_id,role from login where user_id='" + user + "' and password= '******'";
        obj = new ForController();
        dt  = obj.ControllerGetData(qry);


        Session["user_id"] = user;
        if (dt.Rows.Count > 0)
        {
            string ses  = dt.Rows[0][0].ToString();
            string role = dt.Rows[0][1].ToString();
            int    roll = Convert.ToInt32(role);
            if (roll == 1)
            {
                Response.Redirect("AdminHome.aspx");
            }
            else if (roll == 2)
            {
                Response.Redirect("UserVideoView.aspx");
            }
        }
        else
        {
            lblmsg.Text = "Login error";
        }
    }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string        qry  = "select * from fun";
         ForController obj  = new ForController();
         DataTable     data = obj.ControllerGetData(qry);
         GridView1.DataSource = data;
         GridView1.DataBind();
     }
 }
Ejemplo n.º 4
0
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string fname = ddlpgm.SelectedItem.Text;
        string pgm   = txtpgm.Text;
        string id    = ddlpgm.SelectedItem.Value;
        //string lng=txtlng.Text;
        string rdate = txtrdate.Text;
        //string ln = txtleng.Text;
        string hour = ddlhour.SelectedItem.Text;
        string min  = ddlmin.SelectedItem.Text;
        string sec  = ddlsec.SelectedItem.Text;
        string time = hour + ":" + min + ":" + sec;


        string fPath = "";

        int    st = 0;
        string fp = DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpLoad1.FileName);


        if (FileUpLoad1.HasFile)
        {
            st    = 1;
            fPath = "video/" + fp;
            FileUpLoad1.SaveAs(Server.MapPath("~/video/" + fp));
            lblmsg.Text = "File Uploaded: " + FileUpLoad1.FileName;
        }
        else
        {
            lblmsg.Text = "No File Uploaded.";
        }

        if (st == 1)
        {
            qry = "insert into fun values(null,'" + fname + "','" + pgm + "','" + id + "','" + time + "','" + fPath + "','" + rdate + "')";
            obj = new ForController();
            obj.controllerNonQuery(qry);
            lblmsg.Text = "Sucessfully uploaded...";
        }



        txtpgm.Text   = "";
        txtrdate.Text = "";

        ddlpgm.SelectedIndex  = -1;
        ddlhour.SelectedIndex = -1;
        ddlmin.SelectedIndex  = -1;
        ddlsec.SelectedIndex  = -1;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string    id = Session["fun_id"].ToString();
        string    q  = "SELECT * FROM fun f where fun_id=" + id;
        DataTable dt = new DataTable();

        dt = new ForController().ControllerGetData(q);
        foreach (DataRow row in dt.Rows)
        {
            lbllng.Text             = row["file_name"].ToString();
            lblname.Text            = row["program_name"].ToString();
            lblrdate.Text           = row["releaseDate"].ToString();
            lbllen.Text             = row["length"].ToString();
            video.Attributes["src"] = row["file_path"].ToString();
        }
    }
Ejemplo n.º 6
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string fid = e.CommandArgument.ToString();
        string btn = ((LinkButton)e.CommandSource).Text;

        if (btn.Equals("Edit"))
        {
            Session["id"] = fid;
            Response.Redirect("AdminEditViewFun.aspx");
        }
        else
        {
            string        qry = "delete from fun where fun_id=" + Convert.ToInt32(fid) + " ";
            ForController obj = new ForController();
            obj.controllerNonQuery(qry);
            lblmsg.Text = "Record Deleted successfully.";

            string        qry1 = "select * from fun";
            ForController obj1 = new ForController();
            DataTable     data = obj1.ControllerGetData(qry1);
            GridView1.DataSource = data;
            GridView1.DataBind();
        }
    }