コード例 #1
0
        public ActionResult editEDU(int edu, FingerprintsModel.MyProfile _profile)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Userid"]))
                {
                    _profile.UserID = Request.QueryString["Userid"].ToString();
                }


                if (new MyProfileData().deleteEducation(edu, _profile) == "1")
                {
                    TempData["message"] = "Record deleted successfully.";
                }
                else
                {
                    TempData["message"] = "Error occurred. Please try again.";
                }

                return(Redirect("~/MyProfile/editProfile/" + _profile.UserID + _profile.hidtab));
            }
            catch (Exception Ex)
            {
                clsError.WriteException(Ex);
                return(View());
            }
        }
コード例 #2
0
 public ActionResult editProfile(string id, FingerprintsModel.MyProfile _profile)
 {
     try
     {
         if (new MyProfileData().SaveProfile(id, _profile) == "1")
         {
             TempData["message"] = "Record saved successfully.";
         }
         else
         {
             TempData["message"] = "Error occured. Please try again.";
         }
         return(View(_profile));
     }
     catch (Exception Ex)
     {
         clsError.WriteException(Ex);
         return(View());
     }
 }
コード例 #3
0
        public ActionResult editProfile(string id, FingerprintsModel.MyProfile _profile)
        {
            try

            {
                if (_profile.StaffEducation != null && _profile.StaffEducation.Certificates != null && _profile.StaffEducation.Certificates.Count > 0)
                {
                    _profile.StaffEducation.Certificates.ForEach(x =>
                    {
                        x.AttachmentFileByte      = !string.IsNullOrEmpty(x.AttachmentJson) ? Convert.FromBase64String(x.AttachmentJson) : x.AttachmentFileByte;
                        x.AttachmentFileName      = !string.IsNullOrEmpty(x.AttachmentJson) ? "EducationalAttachment" : x.AttachmentFileName;
                        x.AttachmentFileExtension = !string.IsNullOrEmpty(x.AttachmentJson) ? ".png" : x.AttachmentFileExtension;
                    });
                }

                if (new MyProfileData().SaveProfile(id, _profile) == "1")
                {
                    TempData["message"] = "Record saved successfully.";
                }
                else
                {
                    TempData["message"] = "Error occurred. Please try again.";
                }

                ViewBag.UserID = id;



                return(View(_profile));
            }
            catch (Exception Ex)
            {
                clsError.WriteException(Ex);
                return(View());
            }
        }