Esempio n. 1
0
        public IHttpActionResult InsertUpdateDoctorFellowship([FromBody] DoctorFellowship doctorFellowship)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var DoctorBLObj = _Kernel.Get <IDoctorBL>();

            doctorFellowship.Active = true;
            var doctorFellowshipResult = DoctorBLObj.InsertUpdateDoctorFellowship(doctorFellowship, null);

            return(Ok(doctorFellowshipResult.Message));
        }
Esempio n. 2
0
 public DoctorFellowshipResponse InsertUpdateDoctorFellowship(DoctorFellowship doctorFellowship, string operation)
 {
     try
     {
         return(this._doctorDA.InsertUpdateDoctorFellowship(doctorFellowship, operation));
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
         //Log
     }
 }
Esempio n. 3
0
        public DoctorFellowshipResponse InsertUpdateDoctorFellowship(DoctorFellowship doctorFellowship, string operation)
        {
            try
            {
                Log.Info("Started call to InsertUpdateDoctorFellowship");
                Log.Info("parameter values" + JsonConvert.SerializeObject(new { doctorFellowship = doctorFellowship, operation = operation }));
                Command.CommandText = "SP_DOCTOR_FELLOWSHIP_MANAGER";
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();

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

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

                return(result);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                Connection.Close();
            }
        }
Esempio n. 4
0
 public DoctorFellowshipModel()
 {
     DoctorFellowshipObject = new DoctorFellowship();
 }