Ejemplo n.º 1
0
        protected void btnSaveSiblingRela_Click(object sender, EventArgs e)
        {
            if (cmbSearchStudent.Value == null)
            {
                cmbSearchStudent.IsValid   = false;
                cmbSearchStudent.ErrorText = "*";
                return;
            }
            List <Relative> r = new RelativeService().GetRelationsIDs(cmbSearchStudent.Value.ToString(), txtStudUserID.Text, new SessionManager().GetUserId(this.Session));

            if (r.Count > 0)
            {
                string relation = "";
                foreach (Relative rt in r)
                {
                    relation += "('" + cmbSearchStudent.Value.ToString() + "','" + rt.RelaUserId + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "'),";
                }

                if (new RelativeService().AddRelationList(relation.Trim(','), new SessionManager().GetUserId(this.Session)))
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.success('Saved Successfully','Message')", true);
                }
                else
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.error('Saving Failed','Message')", true);
                }
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, GetType(), ",toastr", "toastr.info('Oops!, There are on families/guardians associated with this student','Message')", true);
            }

            LoadFamily(cmbSearchStudent.Value.ToString());
            upFamily.Update();
        }
Ejemplo n.º 2
0
        public rptStudentProfile(string studUserId)
        {
            InitializeComponent();
            xrPicheader.ImageUrl = "~/pictures/letter_head.jpg";
            Student st = new StudentService().GetStudent(studUserId);

            xrAdmissDate.Text  = st.Admissiondate.ToString("dd MMMM yyyy");
            xrID.Text          = st.IndexNo;
            xrGender.Text      = st.Gender;
            xrEmail.Text       = st.Email;
            xrDoB.Text         = st.Dob.ToString("dd MMMM yyyy");
            xrMobile.Text      = st.Mobile;
            xrNationality.Text = st.Nationality;
            xrONames.Text      = st.ONames;
            xrPostAdd.Text     = st.PostAdd;
            xrReligon.Text     = st.Religion;
            xrResAdd.Text      = st.ResAdd;
            xrSname.Text       = st.SName;
            xrTel.Text         = st.Tel;
            xrFName.Text       = st.FNames;

            string u = System.AppDomain.CurrentDomain.BaseDirectory.ToString() + "pictures\\img_" + st.UserId + ".jpg";

            if (File.Exists(u))
            {
                xrPicbox.ImageUrl = "~/pictures/img_" + st.UserId + ".jpg";
            }
            else
            {
                xrPicbox.ImageUrl = "~/images/default-person.jpg";
            }



            List <AcademicDetails> ad = new AcademicDetailsService().GetAcademicDetails(studUserId);

            xrSubAcademicDetails.ReportSource = new mySmis.reports.rptSubStudentAcademics(ad);

            List <Relative> rl = new RelativeService().GetRelatives(studUserId);

            xrSubFamilyDetails.ReportSource = new mySmis.reports.rptSubRelatives(rl);
        }
Ejemplo n.º 3
0
        protected void gvFamily_StartRowEditing(object sender, DevExpress.Web.Data.ASPxStartRowEditingEventArgs e)
        {
            Relative rel = new RelativeService().GetRelativeById(int.Parse(gvFamily.GetRowValues(gvFamily.FocusedRowIndex, "Id").ToString()), new SessionManager().GetUserId(this.Session));

            txtFamEmail.Text     = rel.Email;
            txtFamFName.Text     = rel.FirstName;
            txtFamID.Text        = rel.Id.ToString();
            txtFamMobile.Text    = rel.Mobile;
            txtFamONames.Text    = rel.OtherName;
            txtFamPostAdd.Text   = rel.PostAddress;
            txtFamSName.Text     = rel.LastName;
            txtFamTel.Text       = rel.Tel;
            cmbFamNxtKin.Value   = rel.NextOfKin;
            cmbFamNxtKin.Text    = rel.NextOfKin;
            cmbFamRelative.Value = rel.RelType;
            cmbFamRelative.Text  = rel.RelType;

            div_family.Visible = true;
            upFamily.Update();
            uPanel.Update();
            gvFamily.CancelEdit();
        }