public ITSectionResponse InsertUpdateITSection([FromBody] ITSection objITSection) { var objMaster = _Kernel.Get <IMaster>(); var objITSectionResponse = objMaster.InsertUpdateITSection(objITSection); return(objITSectionResponse); }
public ITSectionResponse InsertUpdateITSection(ITSection objITSection) { try { Log.Info("Started call to InsertUpdateITSection"); Log.Info("parameter values" + JsonConvert.SerializeObject(objITSection)); Command.CommandText = "SP_IT_SECTION_MANAGER"; Command.CommandType = CommandType.StoredProcedure; Command.Parameters.Clear(); Command.Parameters.AddWithValue("@IT_SECTION_XML", GetXMLFromObject(objITSection)); if (objITSection.AddedBy.HasValue) { Command.Parameters.AddWithValue("@USER_ID", objITSection.AddedBy.Value); } if (objITSection.ModifiedBy.HasValue) { Command.Parameters.AddWithValue("@USER_ID", objITSection.ModifiedBy.Value); } Connection.Open(); SqlDataReader reader = Command.ExecuteReader(); ITSectionResponse result = new ITSectionResponse(); if (reader.HasRows) { while (reader.Read()) { result = new ITSectionResponse { Message = reader["ReturnMessage"] != DBNull.Value ? reader["ReturnMessage"].ToString() : null, IsSuccess = Convert.ToBoolean(reader["Result"].ToString()) }; } } Log.Info("End call to InsertUpdateITSection. Result:" + JsonConvert.SerializeObject(result)); return(result); } catch (Exception ex) { Log.Error("Error in InsertUpdateITSection. Error:" + JsonConvert.SerializeObject(ex)); LogError(ex); throw; } finally { Connection.Close(); } }
public ITSectionResponse InsertUpdateITSection(ITSection objITSection) { try { return(this._masterDA.InsertUpdateITSection(objITSection)); } catch (Exception ex) { throw; } finally { //Log } }