Пример #1
0
        public override bool DeleteConditionType(ICoreConditionType conditionType)
        {
            try
            {
                using (var connection = CreateConnection(_connection))
                {
                    connection.Open();
                    var commandText = GetScript(ScriptsSection, ScriptsSqlPath + @"\ConditionType", "DeleteConditionType");
                    using (var command = CreateCommang(commandText, connection))
                    {
                        command.CommandTimeout = GetCommandTimeout();
                        command.Parameters.Add(CreateParameter("@id", conditionType.Id));
                        command.ExecuteNonQuery();
                        var result = command.ExecuteNonQuery();

                        return(result == 0);
                    }
                }
            }
            catch (Exception ex)
            {
                // тут хорошо бы задействовать логгер, например, NLog
                Trace.TraceError(ex.Message);
                throw;
            }
        }
Пример #2
0
        public override ICoreConditionType UpdateConditionType(ICoreConditionType conditionType)
        {
            try
            {
                using (var connection = CreateConnection(_connection))
                {
                    connection.Open();
                    var commandText = GetScript(ScriptsSection, ScriptsSqlPath + @"\ConditionType", "UpdateConditionType");
                    using (var command = CreateCommang(commandText, connection))
                    {
                        command.CommandTimeout = GetCommandTimeout();
                        command.Parameters.Add(CreateParameter("@id", conditionType.Id));
                        command.Parameters.Add(CreateParameter("@name", conditionType.Name));
                        command.Parameters.Add(CreateParameter("@retro", conditionType.Retro));
                        command.Parameters.Add(CreateParameter("@retroDistr", conditionType.RetroDistr));
                        command.Parameters.Add(CreateParameter("@rku", conditionType.Rku));
                        command.Parameters.Add(CreateParameter("@rkuDistr", conditionType.RkuDistr));
                        command.ExecuteScalar();

                        return(conditionType);
                    }
                }
            }
            catch (Exception ex)
            {
                // тут хорошо бы задействовать логгер, например, NLog
                Trace.TraceError(ex.Message);
                throw;
            }
        }
Пример #3
0
 public bool DeleteConditionType(ICoreConditionType conditionType)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public ICoreConditionType UpdateConditionType(ICoreConditionType conditionType)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 public bool DeleteConditionType(ICoreConditionType conditionType)
 {
     return(_mapper.DeleteConditionType(conditionType));
 }
Пример #6
0
 public ICoreConditionType UpdateConditionType(ICoreConditionType conditionType)
 {
     return(_mapper.UpdateConditionType(conditionType));
 }
Пример #7
0
 public abstract bool DeleteConditionType(ICoreConditionType conditionType);
Пример #8
0
 public abstract ICoreConditionType UpdateConditionType(ICoreConditionType conditionType);