public DataSet UpdateStudioCallerIdNumber(UDC.StudioCallerId studioCallerId) { _cmd = new SqlCommand(); _ds = new DataSet(); _da = new SqlDataAdapter(); try { _cmd.CommandText = "UpdateStudioCallerIdNumber"; _cmd.CommandType = CommandType.StoredProcedure; _cmd.Connection = Connection; _cmd.Parameters.Add("@AccountId", SqlDbType.Int).Value = studioCallerId.AccountId; _cmd.Parameters.Add("@AgentId", SqlDbType.Int).Value = studioCallerId.AgentId; _cmd.Parameters.Add("@AccountCallerId", SqlDbType.Int).Value = studioCallerId.Id; _cmd.Parameters.Add("@StudioId", SqlDbType.Int).Value = studioCallerId.StudioId; _cmd.Parameters.Add("@IsDeactive", SqlDbType.Bit).Value = studioCallerId.IsDeactive; _cmd.Parameters.Add("@Message", SqlDbType.VarChar, 500).Direction = ParameterDirection.Output; _cmd.Parameters.Add("@Success", SqlDbType.Bit).Direction = ParameterDirection.Output; Connection.Open(); _cmd.ExecuteNonQuery(); Connection.Close(); _ds.Tables.Add(_helper.ConvertOutputParametersToDataTable(_cmd.Parameters)); } catch (Exception ex) { Logger.Error(ex.ToString()); throw; } finally { _cmd = null; Connection.Close(); } return(_ds); }
public JObject UpdateStudioCallerIdNumber(String connection, UDC.StudioCallerId studioCallerId) { try { Press3.DataAccessLayer.Studio studioObj = new Press3.DataAccessLayer.Studio(connection); DataSet ds = studioObj.UpdateStudioCallerIdNumber(studioCallerId); if (ds == null) { helper.CreateProperty(UDC.Label.MESSAGE, "No data returned from database"); helper.CreateProperty(UDC.Label.SUCCESS, false); } else { helper.ParseDataSet(ds); } } catch (Exception ex) { Logger.Error("Exception In BAL.UpdateStudioCallerIdNumber " + ex.ToString()); } return(helper.GetResponse()); }