Esempio n. 1
0
 public bool Action_ExecuteDeleteSPS(Data_SqlSPEntry activeEntry, SqlConnection ActiveConnection, Dictionary <string, object> ValueMaping, Dictionary <string, int> SizeMaping)
 {
     if (activeEntry != null && ActiveConnection != null)
     {
         Data_SqlSPEntry.ModifySPParameter(ref activeEntry, "@operation", SqlDbType.NVarChar, ParameterDirection.Input, "delete");
         foreach (string activeParameter in ValueMaping.Keys)
         {
             int activeParametersIndex = Data_SqlSPEntry.GetSPParameterIndex(ref activeEntry, activeParameter);
             if (activeParametersIndex != -1)
             {
                 SqlParameter activeExistedParamter = activeEntry.ActiveParameters[activeParametersIndex];
                 if (!SizeMaping.ContainsKey(activeParameter))
                 {
                     Data_SqlSPEntry.ModifySPParameter(ref activeEntry, activeParameter, activeExistedParamter.SqlDbType, activeExistedParamter.Direction, ValueMaping[activeParameter]);
                 }
                 else
                 {
                     Data_SqlSPEntry.ModifySPParameter(ref activeEntry, activeParameter, activeExistedParamter.SqlDbType, activeExistedParamter.Direction, ValueMaping[activeParameter], SizeMaping[activeParameter]);
                 }
             }
         }
         Data_SqlDataHelper activeSqlSPHelper = new Data_SqlDataHelper();
         activeSqlSPHelper.ActiveConnection = ActiveConnection;
         activeSqlSPHelper.Action_ExecuteForNonQuery(activeEntry);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 2
0
        public DataSet Action_ExecuteGetSPSForDS(Data_SqlSPEntry activeEntry, SqlConnection ActiveConnection)
        {
            DataSet ds = new DataSet();

            if (activeEntry != null && ActiveConnection != null)
            {
                Data_SqlSPEntry.ModifySPParameter(ref activeEntry, "@operation", SqlDbType.NVarChar, ParameterDirection.Input, "get");
                Data_SqlDataHelper activeSqlSPHelper = new Data_SqlDataHelper();
                activeSqlSPHelper.ActiveConnection = ActiveConnection;
                activeSqlSPHelper.Action_ExecuteForDS(activeEntry, out ds);
                return(ds);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 3
0
 public SqlDataReader Action_ExecuteGetSPSForDR(Data_SqlSPEntry activeEntry, SqlConnection ActiveConnection)
 {
     if (activeEntry != null && ActiveConnection != null)
     {
         Data_SqlSPEntry.ModifySPParameter(ref activeEntry, "@operation", SqlDbType.NVarChar, ParameterDirection.Input, "get");
         Data_SqlDataHelper activeSqlSPHelper = new Data_SqlDataHelper();
         activeSqlSPHelper.ActiveConnection = ActiveConnection;
         SqlDataReader dr;
         if (activeSqlSPHelper.Action_ExecuteForDataReader(activeEntry, out dr))
         {
             return(dr);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }