public void InsertStudentDetails()
    {
        string Result;

        objStudent           = new clsStudentRegistration();
        objStudent.FName     = txtFName.Text.Trim();
        objStudent.MName     = txtMName.Text.Trim();
        objStudent.LName     = txtLName.Text.Trim();
        objStudent.DOB       = Convert.ToDateTime(txtDOB.Text);
        objStudent.Address   = txtAddress.Text;
        objStudent.EmailId   = txtEmailId.Text.Trim();
        objStudent.PhoneNo   = txtPhoneNo.Text.Trim();
        objStudent.UserName  = txtUserName.Text.Trim();
        objStudent.Password  = txtPassword.Text.Trim();
        objStudent.Photo     = (byte[])Session["Photo"];
        objStudent.ImageFile = Session["FileName"].ToString();
        int i = objStudent.InsertStudentDetails(out Result);

        if (i > 0)
        {
            Page.RegisterClientScriptBlock("Student", "<script>alert('" + Result + "')</script>");
        }
        else
        {
            Page.RegisterClientScriptBlock("Student", "<script>alert('" + Result + "')</script>");
        }
    }
示例#2
0
 private void frmStudentRegistration_Load(object sender, EventArgs e)
 {
     if (maxId == 0)
     {
         clsStudentRegistration cStudent = new clsStudentRegistration();
         string strCreateCode            = "0000" + cStudent.CreateCode();
         this.txtStudentId.Text = ("S" + strCreateCode.Substring((strCreateCode.Length - 5), 5)).ToString();
         maxId = Convert.ToInt32(cStudent.CreateCode()) + 1;
     }
     else
     {
         string strCreateCode = "0000" + maxId.ToString();
         this.txtStudentId.Text = ("S" + strCreateCode.Substring((strCreateCode.Length - 5), 5)).ToString();
         maxId += 1;
     }
 }
示例#3
0
    public void GetStudentProfile()
    {
        objStudent           = new clsStudentRegistration();
        objStudent.StudentId = Convert.ToInt32(Session["StudentId"]);
        DataSet dsStudent = objStudent.GetStudentProfile();

        if (dsStudent.Tables[0].Rows.Count > 0)
        {
            lblstudentId.Text  = dsStudent.Tables[0].Rows[0][0].ToString();
            txtFirstName.Text  = dsStudent.Tables[0].Rows[0][1].ToString();
            txtMiddleName.Text = dsStudent.Tables[0].Rows[0][2].ToString();
            txtLastName.Text   = dsStudent.Tables[0].Rows[0][3].ToString();
            txtAddress.Text    = dsStudent.Tables[0].Rows[0][6].ToString();
            txtPhone.Text      = dsStudent.Tables[0].Rows[0][8].ToString();
            txtEmailId.Text    = dsStudent.Tables[0].Rows[0][7].ToString();
        }
    }
示例#4
0
    public void UpdateStudentProfile()
    {
        objStudent           = new clsOfficerRegistration();
        objStudent.StudentId = Convert.ToInt32(Session["StudentId"]);
        objStudent.FName     = txtFirstName.Text.Trim();
        objStudent.MName     = txtMiddleName.Text.Trim();
        objStudent.LName     = txtLastName.Text.Trim();
        objStudent.Address   = txtAddress.Text;
        objStudent.PhoneNo   = txtPhone.Text.Trim();
        objStudent.EmailId   = txtEmailId.Text.Trim();
        objStudent.Photo     = (byte[])Session["Photo"];
        objStudent.ImageFile = Session["FileName"].ToString();
        int i = objStudent.UpdateStudentProfile();

        if (i > 0)
        {
            Page.RegisterClientScriptBlock("Officer", "<script>alert('Profile Updated')</script>");
        }
        else
        {
            Page.RegisterClientScriptBlock("Officer", "<script>alert('Bad Request')</script>");
        }
    }