示例#1
0
        public IHttpActionResult InsertUpdateDoctorAward([FromBody] DoctorAwards doctorAward)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            var DoctorBLObj = _Kernel.Get <IDoctorBL>();

            doctorAward.Active = true;
            var doctorAwardResult = DoctorBLObj.InsertUpdateDoctorAward(doctorAward, null);

            return(Ok(doctorAwardResult.Message));
        }
示例#2
0
 public DoctorAwardsResponse InsertUpdateDoctorAward(DoctorAwards doctorAward, string operation)
 {
     try
     {
         return(this._doctorDA.InsertUpdateDoctorAward(doctorAward, operation));
     }
     catch (Exception ex)
     {
         throw;
     }
     finally
     {
         //Log
     }
 }
示例#3
0
        public DoctorAwardsResponse InsertUpdateDoctorAward(DoctorAwards doctorAward, string operation)
        {
            try
            {
                Log.Info("Started call to InsertUpdateDoctorAward");
                Log.Info("parameter values" + JsonConvert.SerializeObject(new { doctorAward = doctorAward, operation = operation }));
                Command.CommandText = "SP_DOCTOR_AWARD_MANAGER";
                Command.CommandType = CommandType.StoredProcedure;
                Command.Parameters.Clear();

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

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

                return(result);
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                Connection.Close();
            }
        }
 public DoctorAwardModel()
 {
     DoctorAwardObject = new DoctorAwards();
 }