コード例 #1
0
        /// <summary>
        /// The Get.
        /// </summary>
        /// <param name="sqlConnectString">The sqlConnectString<see cref="string"/>.</param>
        /// <param name="sqlQry">The sqlQry<see cref="string"/>.</param>
        /// <param name="tableName">The tableName<see cref="string"/>.</param>
        /// <param name="keyNames">The keyNames<see cref="IDeck{string}"/>.</param>
        /// <returns>The <see cref="IFigures"/>.</returns>
        public IFigures Get(string sqlConnectString,
                            string sqlQry,
                            string tableName,
                            IDeck <string> keyNames)
        {
            try
            {
                if (DbHand.Schema == null || DbHand.Schema.DbTables.Count == 0)
                {
                    Sqlbase sqb = new Sqlbase(sqlConnectString);
                }
                SqlAdapter sqa = new SqlAdapter(sqlConnectString);

                try
                {
                    return(sqa.ExecuteInject(sqlQry, tableName, keyNames));
                }
                catch (Exception ex)
                {
                    throw new SqlException(ex.ToString());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #2
0
 /// <summary>
 /// The Delete.
 /// </summary>
 /// <param name="SqlConnectString">The SqlConnectString<see cref="string"/>.</param>
 /// <param name="cards">The cards<see cref="IFigures"/>.</param>
 /// <returns>The <see cref="IDeck{IDeck{IFigure}}"/>.</returns>
 public IDeck <IDeck <IFigure> > Delete(string SqlConnectString, IFigures cards)
 {
     try
     {
         if (sqaf == null)
         {
             sqaf = new Sqlbase(SqlConnectString);
         }
         try
         {
             bool buildmap = true;
             if (cards.Count > 0)
             {
                 BulkPrepareType prepareType = BulkPrepareType.Drop;
                 return(sqaf.Delete(cards, true, buildmap, prepareType));
             }
             return(null);
         }
         catch (SqlException ex)
         {
             throw ex;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
コード例 #3
0
        /// <summary>
        /// The Set.
        /// </summary>
        /// <param name="SqlConnectString">The SqlConnectString<see cref="string"/>.</param>
        /// <param name="cards">The cards<see cref="IFigures"/>.</param>
        /// <param name="Renew">The Renew<see cref="bool"/>.</param>
        /// <returns>The <see cref="IDeck{IDeck{IFigure}}"/>.</returns>
        public IDeck <IDeck <IFigure> > Set(string SqlConnectString, IFigures cards, bool Renew)
        {
            try
            {
                if (sqaf == null)
                {
                    sqaf = new Sqlbase(SqlConnectString);
                }
                try
                {
                    bool buildmap = true;
                    if (cards.Count > 0)
                    {
                        BulkPrepareType prepareType = BulkPrepareType.Drop;

                        if (Renew)
                        {
                            prepareType = BulkPrepareType.Trunc;
                        }

                        var ds = sqaf.Update(cards, true, buildmap, true, null, prepareType);
                        if (ds != null)
                        {
                            IFigures im = (IFigures)Summon.New(cards.GetType());
                            im.Rubrics    = cards.Rubrics;
                            im.FigureType = cards.FigureType;
                            im.FigureSize = cards.FigureSize;
                            im.Add(ds["Failed"].AsValues());
                            return(sqaf.Insert(im, true, false, prepareType));
                        }
                        else
                        {
                            return(null);
                        }
                    }
                    return(null);
                }
                catch (SqlException ex)
                {
                    throw ex;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlMutator"/> class.
 /// </summary>
 /// <param name="insql">The insql<see cref="Sqlbase"/>.</param>
 public SqlMutator(Sqlbase insql)
 {
     sqaf = insql;
 }