示例#1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsregister        obj    = new clsregister();
        clsregistrationprp objprp = new clsregistrationprp();

        objprp.email          = emailaddress.Text;
        objprp.f_name         = firstname.Text;
        objprp.l_name         = lastname.Text;
        objprp.rollno         = rollno.Text;
        objprp.sem            = Sem.SelectedItem.Text;
        objprp.dept           = DropDownList4.SelectedItem.Text;
        objprp.acc_type       = DropDownList3.SelectedItem.Text;
        objprp.password       = Password.Text;
        objprp.contact        = contact.Text;
        objprp.parent         = parent.Text;
        objprp.parentemail    = parentemail.Text;
        objprp.parentcontact  = parentcontact.Text;
        objprp.parentpassword = CreateRandomPassword();
        objprp.lastupd        = Convert.ToString(Session["cod"]) + "||" + "Admin" + "||" + Convert.ToString(DateTime.Now);
        //now to send mail

        //try statemnt
        try
        {
            success.Visible = true;
            obj.save_rec_admin(objprp);
            objprp.studentid = obj.findid(objprp);
            obj.join_family(objprp);
            success.Text = "Student " + firstname.Text + "-" + lastname.Text + " Added Successfully";

            if (Convert.ToInt32(DropDownList3.SelectedItem.Value) == 2 || Convert.ToInt32(DropDownList3.SelectedItem.Value) == 3)
            {
                msgtoparent();
                msgtostudent();
            }
            else
            {
                msgtocc();
            }
        }
        catch (Exception exp)
        {
            success.Visible = true;

            success.Text = exp + "ERROR!!!";
        }


        firstname.Text    = string.Empty;
        lastname.Text     = string.Empty;
        rollno.Text       = string.Empty;
        emailaddress.Text = string.Empty;
        rollno.Text       = string.Empty;
        contact.Text      = string.Empty;
        Password.Text     = string.Empty;
        Sem.Items.Clear();
        DropDownList3.Items.Clear();
        DropDownList4.Items.Clear();
        SetFocus(firstname);
    }
示例#2
0
    protected void submit_Click(object sender, EventArgs e)
    {
        clsregister        obj    = new clsregister();
        clsregistrationprp objprp = new clsregistrationprp();

        objprp.email          = email.Text;
        objprp.f_name         = fname.Text;
        objprp.l_name         = lname.Text;
        objprp.rollno         = rollno.Text;
        objprp.sem            = semester.Text;
        objprp.dept           = department.Text;
        objprp.dob            = dob.Text;
        objprp.father         = father.Text;
        objprp.mother         = mother.Text;
        objprp.parentemail    = parent_email.Text;
        objprp.parentcontact  = parent_contact.Text;
        objprp.parentpassword = CreateRandomPassword();
        objprp.parent         = father.Text;
        objprp.hostel         = hostel.Text;
        objprp.bus            = bus.Text;
        objprp.address        = address.Text;
        objprp.acc_type       = acc_type.Text;
        objprp.password       = password.Text;
        objprp.contact        = contact.Text;
        objprp.lastupd        = Convert.ToString(Session["cod"]) + "||" + "Cc" + "||" + Convert.ToString(DateTime.Now);
        try
        {
            success.Visible = true;
            obj.save_rec(objprp);
            objprp.studentid = obj.findid(objprp);
            obj.join_family(objprp);
            success.Text = "    Student " + fname.Text + " " + lname.Text + " Added Successfully";
            msgtoparent();
            msgtostudent();
            button_clear();
        }
        catch (Exception exp)
        {
            success.Visible = true;

            success.Text = "ERROR!!!";
        }
    }