Example #1
0
        public IHttpActionResult InsertUpdateDoctorEducation([FromBody] DoctorEducation doctorEducation)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var DoctorBLObj = _Kernel.Get <IDoctorBL>();

            doctorEducation.Active = true;
            var doctorEducationResult = DoctorBLObj.InsertUpdateDoctorEducation(doctorEducation, null);

            return(Ok(doctorEducationResult.Message));
        }
Example #2
0
 public DoctorEducationResponse InsertUpdateDoctorEducation(DoctorEducation doctorEducation, string operation)
 {
     try
     {
         return(this._doctorDA.InsertUpdateDoctorEducation(doctorEducation, operation));
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
         //Log
     }
 }
Example #3
0
        public DoctorEducationResponse InsertUpdateDoctorEducation(DoctorEducation doctorEducation, string operation)
        {
            try
            {
                Log.Info("Started call to InsertUpdateDoctorEducation");
                Log.Info("parameter values" + JsonConvert.SerializeObject(new { doctorEducation = doctorEducation, operation = operation }));
                Command.CommandText = "SP_DOCTOR_EDUCATION_MANAGER";
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();

                Command.Parameters.AddWithValue("@DOCTOR_EDUCATION_XML", GetXMLFromObject(doctorEducation));
                if (doctorEducation.AddedBy.HasValue)
                {
                    Command.Parameters.AddWithValue("@USER_ID", doctorEducation.AddedBy.Value);
                }
                else if (doctorEducation.ModifiedBy.HasValue)
                {
                    Command.Parameters.AddWithValue("@USER_ID", doctorEducation.ModifiedBy.Value);
                }
                Connection.Open();
                SqlDataReader reader = Command.ExecuteReader();

                DoctorEducationResponse result = new DoctorEducationResponse();
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        result = new DoctorEducationResponse
                        {
                            Message   = reader["ReturnMessage"] != DBNull.Value ? reader["ReturnMessage"].ToString() : null,
                            IsSuccess = Convert.ToBoolean(reader["Result"].ToString())
                        };
                    }
                }
                Log.Info("End call to InsertUpdateDoctorEducation");

                return(result);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                Connection.Close();
            }
        }
Example #4
0
 public DoctorEducationModel()
 {
     DoctorEducationObject = new DoctorEducation();
 }