コード例 #1
0
        public void UpdateProduct(StudentDisciplinaryDetails obj)
        {
            var index = StudentProfileModel.IndexOf(obj);

            StudentProfileModel.Remove(obj);
            StudentProfileModel.Insert(index, obj);
        }
コード例 #2
0
        public StudentProfileModel loadStudentProfile(int userID)
        {
            var result = new StudentProfileModel();

            try
            {
                //var objToSave = DbContext.UserInfos.FirstOrDefault(u => (u.Email == emailOrUserName || u.UserName == emailOrUserName) && u.Password == password);
                var userInfo = DbContext.UserInfos.FirstOrDefault(u => u.ID == userID);
                var student  = DbContext.Students.FirstOrDefault(s => s.S_ID == userID);

                result.Email = userInfo.Email;
                result.Name  = userInfo.Name;

                if (student == null)
                {
                    result.Class    = "";
                    result.DOB      = "";
                    result.Location = "";
                }
                else
                {
                    result.Class    = student.Class;
                    result.DOB      = student.DOB.ToString("dd-MMM-yyyy");
                    result.Location = student.location;
                }
            }
            catch (Exception ex)
            {
                result = null;
            }
            return(result);
        }
コード例 #3
0
        public ActionResult StudentProfile()
        {
            var model = new StudentProfileModel();

            model = ProfileManageRepo.loadStudentProfile(HttpUtil.UserProfile.ID);
            return(View(model));
        }
コード例 #4
0
        private void OnSelectedItem(object sender, ItemTappedEventArgs e)
        {
            StudentProfileModel md = (StudentProfileModel)lv_contact.SelectedItem;



            ((ListView)sender).SelectedItem = null;
        }
コード例 #5
0
 public async void OnWhatsappCommand(StudentProfileModel guestModel)
 {
     try
     {
         Device.OpenUri(new Uri("whatsapp://send?phone=+91" + guestModel.wardenPhoneNo));
     }
     catch (Exception ex)
     {
         await App.Current.MainPage.DisplayAlert("Not Installed", "Whatsapp Not Installed", "ok");
     }
 }
コード例 #6
0
        // GET: Student
        private StudentProfileModel InitModel()
        {
            var dbStudent = BLL.Data.StudentData.GetStudent(((CustomPrincipal)User).UserId);
            var model     = new StudentProfileModel
            {
                Student = new StudentModel(dbStudent)
            };

            ViewBag.Levels    = ShowLessonLevels();
            ViewBag.LevelName = BLL.Data.AdditionalData.GetLessonLevel(model.Student.lesonsLevel).name;

            return(model);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            StudentProfileModel _studentProfileModel = new StudentProfileModel();

            _studentProfilePresenter = new StudentProfilePresenter(this, _studentProfileModel);

            if (!IsPostBack)
            {
                _studentProfilePresenter.BindCountries();
                _studentProfilePresenter.BindGenders();
                _studentProfilePresenter.BindStudentListGrid();
            }
        }
コード例 #8
0
 public async void OnMessageCommand(StudentProfileModel guestModel)
 {
     try
     {
         var message = new SmsMessage("", guestModel.wardenPhoneNo);
         await Sms.ComposeAsync(message);
     }
     catch (FeatureNotSupportedException ex)
     {
         await App.Current.MainPage.DisplayAlert("Failed", "Sms is not supported on this device.", "OK");
     }
     catch (Exception ex)
     {
         await App.Current.MainPage.DisplayAlert("Failed", ex.Message, "OK");
     }
 }
コード例 #9
0
 public async void OnCallCommand(StudentProfileModel guestModel)
 {
     try
     {
         PhoneDialer.Open(guestModel.wardenPhoneNo);
     }
     catch (ArgumentNullException anEx)
     {
         // Number was null or white space
     }
     catch (FeatureNotSupportedException ex)
     {
         // Phone Dialer is not supported on this device.
     }
     catch (Exception ex)
     {
         // Other error has occurred.
     }
 }
コード例 #10
0
 public virtual ActionResult SaveStudentProfile(StudentProfileModel studentProfileModel)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(Json(new { isError = true, Message = @"ورودی نامعتبر!" }));
         }
         if (studentProfileModel.Gender == Gender.Famele)
         {
             studentProfileModel.MilitaryServiceStatus = MilitaryServiceStatus.None;
         }
         var levelId  = Convert.ToInt64(User.LevelId());
         var personId = _personManagementService.GetPersonIdbyStudentNumber(studentProfileModel.StudentNumber);
         studentProfileModel.PersonId = personId;
         var data = _personManagementService.AddOrUpdateStudentProfile(studentProfileModel, levelId);
         return(Json(new { isError = !data.Item1, Message = data.Item2 }));
     }
     catch (Exception exception)
     {
         return(Json(new { isError = true, Message = @"خطا در ثبت اطلاعات" }));
     }
 }
 public StudentProfilePresenter(IStudentProfileView studentProfileView,
                                StudentProfileModel studentProfileModel)
 {
     _studentProfileView  = studentProfileView;
     _studentProfileModel = studentProfileModel;
 }