Exemple #1
0
    protected void Dvw_PersonalDetails_ModeChanging(object sender, DetailsViewModeEventArgs e)
    {
        try
        {
            if (Dvw_PersonalDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.ReadOnly);
            }
            else
            {
                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.Edit);
            }
            Student        Student     = new Student();
            Student_BLogic BAL_Student = new Student_BLogic();
            Student.studentid = AppSessions.StudentID;
            DataSet dsSelect = new DataSet();
            dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID");


            Dvw_PersonalDetails.DataSource = dsSelect;
            Dvw_PersonalDetails.DataBind();

            ViewState["byteimage"] = (byte[])dsSelect.Tables[0].Rows[0]["Picture"];
        }
        catch (Exception ex)
        {
        }
    }
Exemple #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Student        Student     = new Student();
            Student_BLogic BAL_Student = new Student_BLogic();
            Student.studentid = AppSessions.StudentID;
            DataSet dsSelect = new DataSet();
            dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID");

            Dvw_PersonalDetails.DataSource = dsSelect;
            Dvw_PersonalDetails.DataBind();

            Dvw_ParentGuardianDetails.DataSource = dsSelect;
            Dvw_ParentGuardianDetails.DataBind();

            Dvw_EducationalDetails.DataSource = dsSelect;
            Dvw_EducationalDetails.DataBind();
        }
    }
Exemple #3
0
    protected void Dvw_PersonalDetails_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
    {
        try
        {
            if (Dvw_PersonalDetails.CurrentMode == DetailsViewMode.Edit)
            {
                Label           lbl_findStudentid  = (Label)Dvw_PersonalDetails.Rows[0].FindControl("Lbl_EditStudentId");
                FileUpload      pictup             = (FileUpload)Dvw_PersonalDetails.Rows[1].FindControl("pictureupload");
                TextBox         txt_findFirstName  = (TextBox)Dvw_PersonalDetails.Rows[2].FindControl("Txt_EditFirstName");
                TextBox         txt_findMiddleName = (TextBox)Dvw_PersonalDetails.Rows[3].FindControl("Txt_EditMiddleName");
                TextBox         txt_findLastName   = (TextBox)Dvw_PersonalDetails.Rows[4].FindControl("Txt_EditLastName");
                TextBox         txt_findAddress    = (TextBox)Dvw_PersonalDetails.Rows[5].FindControl("Txt_EditAddress");
                TextBox         txt_findContact    = (TextBox)Dvw_PersonalDetails.Rows[6].FindControl("Txt_EditContact");
                TextBox         txt_findMobile     = (TextBox)Dvw_PersonalDetails.Rows[7].FindControl("Txt_EditMobile");
                TextBox         txt_findEmail      = (TextBox)Dvw_PersonalDetails.Rows[8].FindControl("Txt_EditEmail");
                TextBox         txt_findBithdate   = (TextBox)Dvw_PersonalDetails.Rows[9].FindControl("Txt_EditBirthdate");
                RadioButtonList rbLst_findGender   = (RadioButtonList)Dvw_PersonalDetails.Rows[10].FindControl("Rbtn_EditGender");
                TextBox         txt_findBloodGroup = (TextBox)Dvw_PersonalDetails.Rows[11].FindControl("Txt_EditBloodGroup");
                TextBox         txt_findCity       = (TextBox)Dvw_PersonalDetails.Rows[12].FindControl("Txt_EditSchoolCity");
                TextBox         txt_findzipcode    = (TextBox)Dvw_PersonalDetails.Rows[13].FindControl("Txt_EditSchoolZipcode");
                TextBox         txt_findstate      = (TextBox)Dvw_PersonalDetails.Rows[14].FindControl("Txt_EditState");
                TextBox         txt_findcountry    = (TextBox)Dvw_PersonalDetails.Rows[15].FindControl("Txt_EditCountry");

                Student_BLogic obj_studblogic = new Student_BLogic();
                Student        obj_student    = new Student();

                obj_student.studentid   = int.Parse(lbl_findStudentid.Text);
                obj_student.firstname   = txt_findFirstName.Text;
                obj_student.middlename  = txt_findMiddleName.Text;
                obj_student.lastname    = txt_findLastName.Text;
                obj_student.Address     = txt_findAddress.Text;
                obj_student.contactno   = long.Parse(txt_findContact.Text);
                obj_student.mobileno    = long.Parse(txt_findMobile.Text);
                obj_student.emailid     = txt_findEmail.Text;
                obj_student.dateofbirth = DateTime.Parse(txt_findBithdate.Text);

                if (rbLst_findGender.SelectedIndex == 0)
                {
                    obj_student.gender = 'M';
                }
                else if (rbLst_findGender.SelectedIndex == 1)
                {
                    obj_student.gender = 'F';
                }

                Byte[] imgByte = null;
                if (pictup.HasFile && pictup.PostedFile != null)
                {
                    HttpPostedFile File = pictup.PostedFile;
                    imgByte = new Byte[File.ContentLength];

                    DataAccess da     = new DataAccess();
                    ArrayList  tmplst = new ArrayList();
                    tmplst.Add(new parameter("FieldName", "UploadImageSize"));
                    DataSet dsgetSetting = da.DAL_Select("PROC_GetConfig", tmplst);

                    int allowed_bytes = int.Parse(dsgetSetting.Tables[0].Rows[0]["value"].ToString());
                    if (File.ContentLength <= allowed_bytes)
                    {
                        File.InputStream.Read(imgByte, 0, File.ContentLength);
                    }
                    else
                    {
                        imgByte = (byte[])ViewState["byteimage"];
                    }
                }
                else
                {
                    try { imgByte = (byte[])ViewState["byteimage"]; }
                    catch { }
                }
                obj_student.Picture = imgByte;

                obj_student.bloodgroup = txt_findBloodGroup.Text;
                obj_student.City       = txt_findCity.Text;
                obj_student.Zipcode    = txt_findzipcode.Text;
                obj_student.State      = txt_findstate.Text;
                obj_student.Country    = txt_findcountry.Text;

                obj_studblogic.UpdateStudentProfile(obj_student, "personal");

                Dvw_PersonalDetails.ChangeMode(DetailsViewMode.ReadOnly);
                Student        Student     = new Student();
                Student_BLogic BAL_Student = new Student_BLogic();
                Student.studentid = AppSessions.StudentID;
                DataSet dsSelect = new DataSet();
                dsSelect = BAL_Student.BAL_Student_Select(Student, "SelectByID");

                Dvw_PersonalDetails.DataSource = dsSelect;
                Dvw_PersonalDetails.DataBind();

                TrackLog_Utils.Log(Convert.ToInt32(AppSessions.SchoolID), Convert.ToInt32(AppSessions.EmployeeOrStudentID), Convert.ToInt16(AppSessions.DivisionID), StringEnum.stringValueOf(EnumFile.AccessedPages.AccessMyAccount), "Save Button", "Click", Convert.ToDateTime(System.DateTime.Now), HttpContext.Current.Session.SessionID, StringEnum.stringValueOf(EnumFile.Activity.MyAccountProfileSectionUpdated), "Updated Personal Details.", 0);
            }
        }
        catch (Exception ex)
        {
        }
    }