public void doSignup()
    {
        SignUp         a    = new SignUp();
        InstructorsDAL sdal = new InstructorsDAL();

        if (isFormGood() == true)
        {
            a.Fname    = txtFname.Text;
            a.Lname    = txtLname.Text;
            a.Tel      = txtTel.Text;
            a.Cell     = txtCell.Text;
            a.Address  = txtAddress.Text;
            a.Email    = txtEmail.Text;
            a.Password = txtPassword.Text;

            int id = Convert.ToInt32(Session["Marks_Key"]);
            sdal.UpdateInstructor(a, id);

            txtFname.Visible    = false;
            txtLname.Visible    = false;
            txtCell.Visible     = false;
            txtTel.Visible      = false;
            txtAddress.Visible  = false;
            txtEmail.Visible    = false;
            txtPassword.Visible = false;
            txtCPass.Visible    = false;
            btnSubmit.Visible   = false;

            lblFnamee.Visible    = false;
            lblLnamee.Visible    = false;
            lblCelll.Visible     = false;
            lblTell.Visible      = false;
            lblAddresss.Visible  = false;
            lblEmaill.Visible    = false;
            lblPasswordd.Visible = false;
            lblCPasss.Visible    = false;
            cia.Visible          = false;
            ld.Visible           = false;
            lblSubmitted.Visible = true;
            lblNotify.Visible    = false;
            lblCell.Visible      = false;
            lblPassword.Visible  = false;
            lblCPassword.Visible = false;
            lblAddress.Visible   = false;
            lblFname.Visible     = false;
            lblLname.Visible     = false;
            lblTel.Visible       = false;
            lblEmail.Visible     = false;

            lblSubmitted.Text = "Account details has been Submitted";
            btnUpdate.Visible = false;
        }
        else
        {
            Response.Write("Bad form");
        }
    }
Exemple #2
0
    public void doSignup()
    {
        SignUp         su   = new SignUp();
        InstructorsDAL ldal = new InstructorsDAL();

        if (isFormGood() == true)
        {
            su.Fname    = txtFname.Text;
            su.Lname    = txtLname.Text;
            su.Cell     = txtCell.Text;
            su.Tel      = txtTel.Text;
            su.Address  = txtAddress.Text;
            su.Email    = txtEmail.Text;
            su.Password = txtPassword.Text;
            ldal.addInstructor(su);

            txtFname.Visible    = false;
            txtLname.Visible    = false;
            txtCell.Visible     = false;
            txtTel.Visible      = false;
            txtAddress.Visible  = false;
            txtEmail.Visible    = false;
            txtPassword.Visible = false;
            txtCPass.Visible    = false;
            btnSubmit.Visible   = false;

            lblFnamee.Visible    = false;
            lblLnamee.Visible    = false;
            lblCelll.Visible     = false;
            lblTell.Visible      = false;
            lblAddresss.Visible  = false;
            lblEmaill.Visible    = false;
            lblPasswordd.Visible = false;
            lblCPasss.Visible    = false;
            cia.Visible          = false;
            ld.Visible           = false;
            lblSubmitted.Visible = true;

            lblFname.Visible     = false;
            lblLname.Visible     = false;
            lblCell.Visible      = false;
            lblTel.Visible       = false;
            lblAddress.Visible   = false;
            lblEmail.Visible     = false;
            lblPassword.Visible  = false;
            lblCPassword.Visible = false;
            cia.Visible          = false;
            ld.Visible           = false;

            lblSubmitted.Text = "Account has been Submitted";
        }
        else
        {
            Response.Write("Bad form");
        }
    }
Exemple #3
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     foreach (GridViewRow row in gvInstructors.Rows)
     {
         CheckBox cb = (CheckBox)row.FindControl("DeleteSelector");
         if (cb != null && cb.Checked)
         {
             int            id   = Convert.ToInt32(gvInstructors.DataKeys[row.RowIndex].Value);
             InstructorsDAL idal = new InstructorsDAL();
             idal.DeleteInstructor(id);
             InstructorsDAL ld = new InstructorsDAL();
             DataSet        ds = ld.getInstructors();
             gvInstructors.DataSource = ds;
             gvInstructors.DataBind();
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.Master.name.Text = Session["User"].ToString();
        }
        catch (Exception ex)
        {
            Response.Redirect("index.aspx");
        }
        if (!IsPostBack)
        {
            InstructorsDAL idal = new InstructorsDAL();
            DataSet        ds   = idal.getAllInstructors();
            ddIname.DataSource     = ds;
            ddIname.DataValueField = "Instructor_id";
            ddIname.DataTextField  = "Instructor name";

            ddIname.DataBind();
        }
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            this.Master.name.Text = Session["User"].ToString();
        }
        catch (Exception ex)
        {
            Response.Redirect("index.aspx");
        }
        InstructorsDAL ld = new InstructorsDAL();
        DataSet        ds = ld.getInstructors();

        gvInstructors.DataSource = ds;
        gvInstructors.DataBind();
        lblNo.Visible = false;
        if (ds.Tables[0].Rows.Count == 0)
        {
            btnDelete.Visible = false;
            lblNo.Visible     = true;
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         this.Master.name.Text = Session["User"].ToString();
     }
     catch (Exception ex)
     {
         Response.Redirect("index.aspx");
     }
     if (!IsPostBack)
     {
         InstructorsDAL sdal = new InstructorsDAL();
         int            id   = Convert.ToInt32(Session["Marks_Key"]);
         DataSet        ds   = sdal.getDetails(id);
         DataTable      dt   = ds.Tables[0];
         DataRow        dr   = dt.Rows[0];
         txtEmail.Text       = dr["instructor_email"].ToString();
         txtPassword.Text    = "";
         txtCPass.Text       = "";
         txtFname.Text       = dr["instructor_fname"].ToString();
         txtLname.Text       = dr["instructor_lname"].ToString();
         txtTel.Text         = dr["telephone"].ToString();
         txtCell.Text        = dr["instructor_cellno"].ToString();
         txtAddress.Text     = dr["address"].ToString();
         txtTel.Enabled      = false;
         txtCell.Enabled     = false;
         txtAddress.Enabled  = false;
         txtEmail.Enabled    = false;
         txtFname.Enabled    = false;
         txtLname.Enabled    = false;
         txtPassword.Enabled = false;
         txtCPass.Enabled    = false;
         btnSubmit.Visible   = false;
     }
 }