public IHttpActionResult InsertUpdateDoctorBoard([FromBody] DoctorBoard doctorBoard) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var DoctorBLObj = _Kernel.Get <IDoctorBL>(); doctorBoard.Active = true; var doctorBoardResult = DoctorBLObj.InsertUpdateDoctorBoard(doctorBoard, null); return(Ok(doctorBoardResult.Message)); }
public DoctorBoardResponse InsertUpdateDoctorBoard(DoctorBoard doctorBoard, string operation) { try { return(this._doctorDA.InsertUpdateDoctorBoard(doctorBoard, operation)); } catch (Exception ex) { throw; } finally { //Log } }
public DoctorBoardResponse InsertUpdateDoctorBoard(DoctorBoard doctorBoard, string operation) { try { Log.Info("Started call to InsertUpdateDoctorBoard"); Log.Info("parameter values" + JsonConvert.SerializeObject(new { doctorBoard = doctorBoard, operation = operation })); Command.CommandText = "SP_DOCTOR_BOARD_MANAGER"; Command.CommandType = CommandType.StoredProcedure; Command.Parameters.Clear(); Command.Parameters.AddWithValue("@DOCTOR_BOARD_XML", GetXMLFromObject(doctorBoard)); if (doctorBoard.AddedBy.HasValue) { Command.Parameters.AddWithValue("@USER_ID", doctorBoard.AddedBy.Value); } else if (doctorBoard.ModifiedBy.HasValue) { Command.Parameters.AddWithValue("@USER_ID", doctorBoard.ModifiedBy.Value); } Connection.Open(); SqlDataReader reader = Command.ExecuteReader(); DoctorBoardResponse result = new DoctorBoardResponse(); if (reader.HasRows) { while (reader.Read()) { result = new DoctorBoardResponse { Message = reader["ReturnMessage"] != DBNull.Value ? reader["ReturnMessage"].ToString() : null, IsSuccess = Convert.ToBoolean(reader["Result"].ToString()) }; } } Log.Info("End call to InsertUpdateDoctorBoard"); return(result); } catch (Exception ex) { throw; } finally { Connection.Close(); } }
public DoctorBoardModel() { DoctorBoardObject = new DoctorBoard(); }