Beispiel #1
0
        public DataSet SaveFinalSubmit(FinalSubmit finalsubmit)
        {
            DataSet dataSet = new DataSet();

            try
            {
                string storedProcedure = "pSRGg_FinalSubmit";
                string parameterName   = "@aXMLString";
                string parameterValue  = ObjectHelper.GetXMLFromObject(finalsubmit);
                sqlCommand = new SqlCommand(storedProcedure, sqlConnection);
                sqlCommand.Parameters.AddWithValue(parameterName, parameterValue);
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlConnection.Open();
                sqlDataAdapter.SelectCommand = sqlCommand;
                sqlDataAdapter.Fill(dataSet);
                dataSet.Tables[0].TableName = "FINALSUBMIT";
            }
            catch (Exception)
            {
                throw;
            }

            finally
            {
                sqlConnection.Close();
            }

            return(dataSet);
        }
Beispiel #2
0
        private bool ValidateMedicalInfoForm(FinalSubmit finalsubmit, out string responseMessage)
        {
            bool boolResponse = true;

            responseMessage = "<ul>";

            List <FormData> IsMedicalHelathFormData = new List <FormData>();

            IsMedicalHelathFormData.Add(new FormData(FormInputType.None, Convert.ToString(finalsubmit.Agree), "AGREE", "The following box must be selected in order to submit your application ", true));
            IsMedicalHelathFormData.Add(new FormData(FormInputType.TextNotEmpty, Convert.ToString(finalsubmit.SurrogateSignature), "SIGNATURE", "Surrogate Mother Applicant Signature. Type your name into the box below.  ", true));
            IsMedicalHelathFormData.Add(new FormData(FormInputType.Date, Convert.ToString(finalsubmit.SignDate), "DATE", "Date", true));

            boolResponse = FormValidator.validateForm(IsMedicalHelathFormData, out responseMessage);
            return(boolResponse);
        }
Beispiel #3
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 #4
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 #5
0
        public FinalSubmit SaveFinalSubmit(FinalSubmit finalsubmit)
        {
            FinalSubmit   localfinalsubmit = new FinalSubmit();
            SurrogateData finalsubmitdata  = new SurrogateData();
            DataSet       dataSet          = new DataSet();

            try
            {
                dataSet = finalsubmitdata.SaveFinalSubmit(finalsubmit);

                if (dataSet.Tables["FinalSubmit"].Rows.Count > 0)
                {
                    localfinalsubmit = new FinalSubmit();
                    localfinalsubmit.FinalSubmitID      = dataSet.Tables["FinalSubmit"].Rows[0]["FINALSUBMITID"].ToString();
                    localfinalsubmit.UserID             = dataSet.Tables["FinalSubmit"].Rows[0]["USERID"].ToString();
                    localfinalsubmit.Agree              = Convert.ToBoolean(dataSet.Tables["FinalSubmit"].Rows[0]["AGREE"].ToString());
                    localfinalsubmit.SurrogateSignature = dataSet.Tables["FinalSubmit"].Rows[0]["SURROGATESIGNATURE"].ToString();
                    localfinalsubmit.SignDate           = dataSet.Tables["FinalSubmit"].Rows[0]["SIGNDATE"].ToString();
                    localfinalsubmit.IsSubmitted        = dataSet.Tables["FinalSubmit"].Rows[0]["ISSUBMITTED"].ToString();
                }
            }
            catch (SqlException sqlEx)
            {
                localfinalsubmit.responseDetail.responseType    = ResponseType.Error;
                localfinalsubmit.responseDetail.ResponseMessage = sqlEx.Message;
            }
            catch (Exception ex)
            {
                localfinalsubmit.responseDetail.responseType    = ResponseType.Error;
                localfinalsubmit.responseDetail.ResponseMessage = ApplicationManager.GenericErrorMessage;

                LoggerHelper.WriteToLog(ex);
            }

            return(localfinalsubmit == null ? new FinalSubmit() : localfinalsubmit);
        }