示例#1
0
        internal int InsertMonitorProfileElementCondition(MonitoringElementConditionsEntity obj)
        {
            int result = 0;

            try
            {
                StoredProcedureEntity sproc = new StoredProcedureEntity();
                sproc.StoredProcedureName = "dnb.InsertOrUpdateMonitoringElementConditions";
                sproc.StoredProceduresParameter.Add(GetParam("@MonitoringConditionID", obj.MonitoringConditionID.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ProfileID", obj.ProfileID.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ProductElementID", obj.ProductElementID.ToString(), SQLServerDatatype.IntDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@ChangeCondition", obj.ChangeCondition.ToString(), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@Condition", Convert.ToString(obj.Condition), SQLServerDatatype.VarcharDataType));
                sproc.StoredProceduresParameter.Add(GetParam("@JsonCondition", !string.IsNullOrEmpty(obj.JsonCondition) ? Convert.ToString(obj.JsonCondition) : null, SQLServerDatatype.VarcharDataType));
                result = Convert.ToInt32(sql.ExecuteScalar(CommandType.StoredProcedure, sproc));
            }
            catch (Exception)
            {
                throw;
            }

            return(result);
        }
示例#2
0
 public int InsertMonitorProfileElementCondition(MonitoringElementConditionsEntity obj)
 {
     return(rep.InsertMonitorProfileElementCondition(obj));
 }