Beispiel #1
0
        public ActionResult FinalSubmit()
        {
            SurrogateService finalsubmitservice = new SurrogateService();
            FinalSubmit      finalsubmit        = new FinalSubmit();

            try
            {
                finalsubmit.UserID      = ApplicationManager.LoggedInUser.UserID;
                finalsubmit.EntityState = EntityState.View;

                finalsubmit = finalsubmitservice.SaveFinalSubmit(finalsubmit);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("FinalSubmit", finalsubmit));
        }
Beispiel #2
0
        public ActionResult LifeStyle()
        {
            SurrogateService lifestyleservice = new SurrogateService();
            LifeStyle        lifestyle        = new LifeStyle();

            try
            {
                lifestyle.UserID      = ApplicationManager.LoggedInUser.UserID;
                lifestyle.EntityState = EntityState.View;

                lifestyle = lifestyleservice.SaveLifeStyle(lifestyle);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("LifeStyle", lifestyle));
        }
Beispiel #3
0
        public ActionResult Documents(HttpPostedFileBase file)
        {
            SurrogateService documentsservice = new SurrogateService();
            Documents        document         = new Documents();

            try
            {
                document.UserID      = ApplicationManager.LoggedInUser.UserID;
                document.EntityState = EntityState.View;

                document = documentsservice.SaveDocuments(document);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("Documents", document));
        }
Beispiel #4
0
        public ActionResult MentalHealth()
        {
            SurrogateService mentalhealthservice = new SurrogateService();
            MentalHealth     mentalhealth        = new MentalHealth();

            try
            {
                mentalhealth.UserID      = ApplicationManager.LoggedInUser.UserID;
                mentalhealth.EntityState = EntityState.View;

                mentalhealth = mentalhealthservice.SaveMentalHealth(mentalhealth);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("MentalHealth", mentalhealth));
        }
Beispiel #5
0
        public ActionResult PregnancyHistory()
        {
            SurrogateService pregnancyhistoryService = new SurrogateService();
            PregnancyHistory pregnancyhistory        = new PregnancyHistory();

            try
            {
                pregnancyhistory.UserID      = ApplicationManager.LoggedInUser.UserID;
                pregnancyhistory.EntityState = EntityState.View;

                pregnancyhistory = pregnancyhistoryService.SavePregnancyHistory(pregnancyhistory);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("PregnancyHistory", pregnancyhistory));
        }
Beispiel #6
0
        public ActionResult PersonalInfo()
        {
            SurrogateService      surrogateService      = new SurrogateService();
            SurrogatePersonalInfo surrogatePersonalInfo = new SurrogatePersonalInfo();

            try
            {
                surrogatePersonalInfo.UserID      = ApplicationManager.LoggedInUser.UserID;
                surrogatePersonalInfo.EntityState = EntityState.View;

                surrogatePersonalInfo = surrogateService.SaveSurrogatePersonalInfo(surrogatePersonalInfo);
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("PersonalInfo", surrogatePersonalInfo));
        }
Beispiel #7
0
        public ActionResult FinalSubmit(FinalSubmit finalsubmit)
        {
            SurrogateService finalsubmitservice = new SurrogateService();
            string           validationMessage  = string.Empty;

            try
            {
                if (ValidateMedicalInfoForm(finalsubmit, out validationMessage))
                {
                    finalsubmit.EntityState = finalsubmit.FinalSubmitID != null ? EntityState.Edit : EntityState.Save;
                    finalsubmit.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    finalsubmit.UserID      = ApplicationManager.LoggedInUser.UserID;

                    finalsubmit = finalsubmitservice.SaveFinalSubmit(finalsubmit);

                    if (finalsubmit.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), finalsubmit.responseDetail.ResponseMessage, "5000");

                        return(View("FinalSubmit", finalsubmit));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("FinalSubmit", finalsubmit));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("FinalSubmit", finalsubmit));
        }
Beispiel #8
0
        public ActionResult Documents(Documents document)
        {
            SurrogateService documentsservice  = new SurrogateService();
            string           validationMessage = string.Empty;

            try
            {
                if (ValidateMedicalInfoForm(document, out validationMessage))
                {
                    document.EntityState = document.DocumentID != null ? EntityState.Edit : EntityState.Save;
                    document.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    document.UserID      = ApplicationManager.LoggedInUser.UserID;

                    document = documentsservice.SaveDocuments(document);

                    if (document.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), document.responseDetail.ResponseMessage, "5000");

                        return(View("Documents", document));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("Documents", document));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("Documents", document));
        }
Beispiel #9
0
        public ActionResult PersonalInfo(SurrogatePersonalInfo surrogatePersonalInfo)
        {
            SurrogateService surrogateService  = new SurrogateService();
            string           validationMessage = string.Empty;

            try
            {
                if (ValidatePersonalInfoForm(surrogatePersonalInfo, out validationMessage))
                {
                    surrogatePersonalInfo.EntityState = surrogatePersonalInfo.SurrogateID != null ? EntityState.Edit : EntityState.Save;
                    surrogatePersonalInfo.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    surrogatePersonalInfo.UserID      = ApplicationManager.LoggedInUser.UserID;

                    surrogatePersonalInfo = surrogateService.SaveSurrogatePersonalInfo(surrogatePersonalInfo);

                    if (surrogatePersonalInfo.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), surrogatePersonalInfo.responseDetail.ResponseMessage, "5000");

                        return(View("PersonalInfo", surrogatePersonalInfo));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("PersonalInfo", surrogatePersonalInfo));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("PersonalInfo", surrogatePersonalInfo));
        }
Beispiel #10
0
        public ActionResult LifeStyle(LifeStyle lifestyle)
        {
            SurrogateService lifestyleservice  = new SurrogateService();
            string           validationMessage = string.Empty;

            try
            {
                if (ValidateMedicalInfoForm(lifestyle, out validationMessage))
                {
                    lifestyle.EntityState = lifestyle.LifeStyleID != null ? EntityState.Edit : EntityState.Save;
                    lifestyle.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    lifestyle.UserID      = ApplicationManager.LoggedInUser.UserID;

                    lifestyle = lifestyleservice.SaveLifeStyle(lifestyle);

                    if (lifestyle.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), lifestyle.responseDetail.ResponseMessage, "5000");

                        return(View("LifeStyle", lifestyle));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("LifeStyle", lifestyle));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("LifeStyle", lifestyle));
        }
Beispiel #11
0
        public ActionResult MentalHealth(MentalHealth mentalhealth)
        {
            SurrogateService mentalhealthservice = new SurrogateService();
            string           validationMessage   = string.Empty;

            try
            {
                if (ValidateMedicalInfoForm(mentalhealth, out validationMessage))
                {
                    mentalhealth.EntityState = mentalhealth.MentalHealthID != null ? EntityState.Edit : EntityState.Save;
                    mentalhealth.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    mentalhealth.UserID      = ApplicationManager.LoggedInUser.UserID;

                    mentalhealth = mentalhealthservice.SaveMentalHealth(mentalhealth);

                    if (mentalhealth.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), mentalhealth.responseDetail.ResponseMessage, "5000");

                        return(View("MentalHealth", mentalhealth));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("MentalHealth", mentalhealth));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("MentalHealth", mentalhealth));
        }
Beispiel #12
0
        public ActionResult PregnancyHistory(PregnancyHistory pregnancyhistory)
        {
            SurrogateService pregnancyService  = new SurrogateService();
            string           validationMessage = string.Empty;

            try
            {
                if (ValidatePregnancyHistoryInfoForm(pregnancyhistory, out validationMessage))
                {
                    pregnancyhistory.EntityState = pregnancyhistory.PregnancyHistoryID != null ? EntityState.Edit : EntityState.Save;
                    pregnancyhistory.ChangeBy    = ApplicationManager.LoggedInUser.UserID;
                    pregnancyhistory.UserID      = ApplicationManager.LoggedInUser.UserID;

                    pregnancyhistory = pregnancyService.SavePregnancyHistory(pregnancyhistory);

                    if (pregnancyhistory.responseDetail.responseType == ResponseType.Error)
                    {
                        WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), pregnancyhistory.responseDetail.ResponseMessage, "5000");

                        return(View("PregnancyHistory", pregnancyhistory));
                    }
                    else
                    {
                        WebHelper.SetMessageBoxProperties(this, ResponseType.Success);
                    }
                }
                else
                {
                    WebHelper.SetMessageBoxProperties(this, ResponseType.Error, validationMessage);

                    return(View("PregnancyHistory", pregnancyhistory));
                }
            }
            catch (Exception ex)
            {
                WebHelper.SetMessageAlertProperties(this, ResponseType.Error.ToString(), ApplicationManager.GenericErrorMessage, "5000");
                LoggerHelper.WriteToLog(ex);
            }

            return(View("PregnancyHistory", pregnancyhistory));
        }
Beispiel #13
0
        public bool UploadFileOnPath(HttpPostedFileBase file, CustomFileType FileType)
        {
            bool result = false;

            try
            {
                if (file.ContentLength > 0)
                {
                    SurrogateService surrogateService = new SurrogateService();
                    Documents        documents        = new Documents();

                    string _FileName    = Path.GetFileName(file.FileName);
                    string _FileType    = string.Empty;
                    string _NewFileName = string.Empty;

                    string _RootPath = Server.MapPath(@"~/UploadedFiles/" + ApplicationManager.LoggedInUser.UserID.ToString());
                    if (!System.IO.File.Exists(_RootPath))
                    {
                        Directory.CreateDirectory(_RootPath);
                    }

                    string _path = Path.Combine(_RootPath, _FileName);
                    file.SaveAs(_path);
                    _FileType    = Path.GetExtension(Path.Combine(_RootPath, _FileName));
                    _NewFileName = _FileName + "_" + Path.GetRandomFileName() + _FileType;
                    System.IO.File.Move(Path.Combine(_RootPath, _FileName), Path.Combine(_RootPath, _NewFileName));

                    documents.UserID      = ApplicationManager.LoggedInUser.UserID.ToString();
                    documents.IDProof     = _NewFileName;
                    documents.UploadPath  = _RootPath;
                    documents.EntityState = EntityState.Save;
                    documents.ChangeBy    = ApplicationManager.LoggedInUser.UserID.ToString();

                    documents = surrogateService.SaveDocuments(documents);

                    switch (FileType)
                    {
                    case CustomFileType.IdProof:
                        ApplicationManager.UploadedIDProof = _NewFileName;

                        break;

                    case CustomFileType.Pic:
                        ApplicationManager.UploadedPic = _NewFileName;
                        break;

                    case CustomFileType.FamilyPic:
                        ApplicationManager.UploadedFamilyPic = _NewFileName;
                        break;
                    }
                }

                WebHelper.SetMessageAlertProperties(this, ResponseType.Success.ToString(), "Document uploaded Successfully!", "5000");

                WebHelper.SetMessageBoxProperties(this, ResponseType.Success, "Document uploaded Successfully!");

                result = true;
            }
            catch (Exception ex)
            {
                LoggerHelper.WriteToLog(ex);
                result = false;
            }

            return(result);
        }