a 32-bit signed integer to be used in reading or writing of data from a database
コード例 #1
0
ファイル: vwRights.cs プロジェクト: kimykunjun/test
 /// <summary>
 /// Class constructor which set blank values to the local variable.
 /// </summary>
 public vwRights()
 {
     this._nRightLevelID = 0;
     this._nRightsID = 0;
     this._nEmployeeID = 0;
     this._strFunctionName = "";
 }
コード例 #2
0
ファイル: ResultSetFilter.cs プロジェクト: DFineNormal/tSQLt
        public void sendSelectedResultSetToSqlContext(SqlInt32 resultsetNo, SqlString command)
        {
            validateResultSetNumber(resultsetNo);

            SqlDataReader dataReader = testDatabaseFacade.executeCommand(command);

            int ResultsetCount = 0;
            if (dataReader.FieldCount > 0)
            {
                do
                {
                    ResultsetCount++;
                    if (ResultsetCount == resultsetNo)
                    {
                        sendResultsetRecords(dataReader);
                        break;
                    }
                } while (dataReader.NextResult());
            }
            dataReader.Close();

            if(ResultsetCount < resultsetNo)
            {
                throw new InvalidResultSetException("Execution returned only " + ResultsetCount.ToString() + " ResultSets. ResultSet [" + resultsetNo.ToString() + "] does not exist.");
            }
        }
コード例 #3
0
 public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords, SqlInt32 sortType, SqlInt32 upToLevel)
 {
     SPMultipleSkylineBNLLevel skyline = new SPMultipleSkylineBNLLevel();
     string[] additionalParameters = new string[5];
     additionalParameters[4] = upToLevel.ToString();
     skyline.GetSkylineTable(strQuery.ToString(), strOperators.ToString(), numberOfRecords.Value, false, Helper.CnnStringSqlclr, Helper.ProviderClr, additionalParameters, sortType.Value, true);
 }
コード例 #4
0
        private static Byte[] GetFileContents(string table, SqlInt32 fileId, char format)
        {
            Byte[] bytes = null;

            using (var connection = new SqlConnection("context connection=true"))
            {
                connection.Open();

                string sql = "SELECT [Contents] FROM [dbo].[" + table + "] WHERE [FileId] = @fileId AND [Format] = @format";
                using (var command = new SqlCommand(sql, connection))
                {
                    command.Parameters.Add(new SqlParameter("@fileId", SqlDbType.Int) { Value = fileId });
                    command.Parameters.Add(new SqlParameter("@format", SqlDbType.Char) { Value = format });

                    using (SqlDataReader results = command.ExecuteReader())
                    {
                        while (results.Read())
                        {
                            bytes = results.GetSqlBytes(0).Buffer;
                        }
                    }
                }
            }
            return bytes;
        }
コード例 #5
0
ファイル: ResultSetFilter.cs プロジェクト: DFineNormal/tSQLt
 private void validateResultSetNumber(SqlInt32 resultsetNo)
 {
     if (resultsetNo < 0 || resultsetNo.IsNull)
     {
         throw new InvalidResultSetException("ResultSet index begins at 1. ResultSet index [" + resultsetNo.ToString() + "] is invalid.");
     }
 }
コード例 #6
0
 public static object Box(SqlInt32 a)
 {
     if (a.IsNull)
         return null;
     else
         return a.Value;
 }
コード例 #7
0
ファイル: AzureBlob.cs プロジェクト: DomG4/sqlservertoazure
        public static void AddContainerACL(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,
            SqlString accessPolicyId,
            SqlDateTime start, SqlDateTime expiry,
            SqlBoolean canRead,
            SqlBoolean canWrite,
            SqlBoolean canDeleteBlobs,
            SqlBoolean canListBlobs,
            SqlGuid LeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Enumerations.ContainerPublicReadAccess cpraNew;
            if(!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
            {
                StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
                foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
                    sb.Append("\"" + s + "\" ");
                throw new ArgumentException(sb.ToString());
            }

            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);

            Enumerations.ContainerPublicReadAccess cpra;
            SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            string strPermissions = "";
            if (canRead.IsTrue)
                strPermissions += "r";
            if (canWrite.IsTrue)
                strPermissions += "w";
            if (canDeleteBlobs.IsTrue)
                strPermissions += "d";
            if (canListBlobs.IsTrue)
                strPermissions += "l";

            SharedAccessSignature.AccessPolicy ap = new SharedAccessSignature.AccessPolicy()
            {
                Start = start.Value,
                Expiry = expiry.Value,
                Permission = strPermissions
            };

            sasACL.SignedIdentifier.Add(new SharedAccessSignature.SignedIdentifier()
                {
                    AccessPolicy = ap,
                    Id = accessPolicyId.Value
                });

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
コード例 #8
0
ファイル: Or.SqlInt.cs プロジェクト: raziqyork/Geeks.SqlUtils
 public static SqlInt32 OrInt3(
     SqlInt32 value0,
     SqlInt32 value1,
     SqlInt32 value2)
 {
     return OrSqlInt32(value0, value1, value2);
 }
コード例 #9
0
        public static IEnumerable GetEventData(SqlInt32 eventID)
        {
            const string query =
                "SELECT " +
                "    TimeDomainData, " +
                "    FrequencyDomainData " +
                "FROM EventData " +
                "WHERE ID = " +
                "(" +
                "    SELECT EventDataID " +
                "    FROM Event " +
                "    WHERE ID = @id " +
                ")";

            DataSet eventDataSet = new DataSet();

            using (SqlConnection connection = new SqlConnection("context connection=true"))
            using (SqlCommand command = new SqlCommand(query, connection))
            using (SqlDataAdapter adapter = new SqlDataAdapter(command))
            {
                connection.Open();
                command.Parameters.AddWithValue("@id", eventID);
                adapter.Fill(eventDataSet);
            }

            DataRow row = eventDataSet.Tables[0].Rows[0];

            return ReadFrom(Inflate((byte[])row["TimeDomainData"]))
                .Concat(ReadFrom(Inflate((byte[])row["FrequencyDomainData"]), freq: true))
                .ToArray();
        }
コード例 #10
0
 public static void FormatE_FillRow(
     object inputObject,
     out SqlInt32 lineNumber,
     out SqlString programNumber,
     out SqlString platformId,
     out DateTime transmissionDate,
     out DateTime? locationDate,
     out float? latitude,
     out float? longitude,
     out float? altitude,
     out char? locationClass,
     out Byte[] message)
 {
     var transmission = (ArgosTransmission) inputObject;
     lineNumber = transmission.LineNumber;
     programNumber = transmission.ProgramId;
     platformId = transmission.PlatformId;
     transmissionDate = transmission.DateTime;
     locationDate = transmission.Location == null ? (DateTime?) null : transmission.Location.DateTime;
     latitude = transmission.Location == null ? (float?) null : transmission.Location.Latitude;
     longitude = transmission.Location == null ? (float?)null : transmission.Location.Longitude;
     altitude = transmission.Location == null ? (float?)null : transmission.Location.Altitude;
     locationClass = transmission.Location == null ? (char?)null : transmission.Location.Class;
     message = transmission.Message;
 }
コード例 #11
0
    public static SqlGeometry GetImageBound(SqlDouble Longitude, SqlDouble Latitude, SqlInt32 Width, SqlInt32 Height,
        SqlDouble Zoom, SqlInt32 PixelYOffset)
    {
        long cpX, cpY, LeftTopX, LeftTopY, RightBottomX, RightBottomY;
        long halfWidth = ((long) Width) >> 1;
        long halfHeight = ((long) Height) >> 1;
        double dZoom = (double) Zoom;
        // получить центральный пиксел по коорд
        cpX = (long) FromLongitudeToXPixel(Longitude, Zoom);
        cpY = (long) (FromLatitudeToYPixel(Latitude, Zoom) + PixelYOffset);
        LeftTopX = cpX - halfWidth;
        LeftTopY = cpY - halfHeight;
        RightBottomX = cpX + halfWidth;
        RightBottomY = cpY + halfHeight;
        double Lat1, Lon1, Lat2, Lon2;
        Lat1 = FromYPixelToLat(LeftTopY, dZoom);
        Lon1 = FromXPixelToLon(LeftTopX, dZoom);
        Lat2 = FromYPixelToLat(RightBottomY, dZoom);
        Lon2 = FromXPixelToLon(RightBottomX, dZoom);

        //
        var geomBuilder = new SqlGeometryBuilder();
        geomBuilder.SetSrid((0));
        geomBuilder.BeginGeometry(OpenGisGeometryType.Polygon);
        geomBuilder.BeginFigure(Lon1, Lat1);
        geomBuilder.AddLine(Lon1, Lat2);
        geomBuilder.AddLine(Lon2, Lat2);
        geomBuilder.AddLine(Lon2, Lat1);
        geomBuilder.AddLine(Lon1, Lat1);
        geomBuilder.EndFigure();
        geomBuilder.EndGeometry();
        return geomBuilder.ConstructedGeometry;
    }
コード例 #12
0
 public static SqlBinary MergePHkeys(SqlBinary oldPHkeys, SqlInt16 newSnap, SqlInt32 newPHkey)
 {
     SqlIntArray keyArray = new SqlIntArray(oldPHkeys);
     int[] keys = keyArray.ToArray();
     keys[(short) newSnap] = (int) newPHkey;
     return SqlIntArray.FromArray(keys).ToSqlBuffer();
 }
コード例 #13
0
 public static void FillMatchRow( object data,
    out SqlInt32 index, out SqlChars text )
 {
     MatchNode node = (MatchNode)data;
       index = new SqlInt32( node.Index );
       text = new SqlChars( node.Value.ToCharArray( ) );
 }
コード例 #14
0
ファイル: AssemblyInfo.cs プロジェクト: apenwarr/versaplex
    public static void SqlSucker_GetConInfo(SqlInt32 magic)
    {
        if (conInfoMagic != magic.Value) {
            throw new System.Exception(
                "This procedure is internal to SqlSucker. "
                + "Do not call it directly.");
        }

        lock (conInfoLock) {
            conInfoOk = false;

            using (SqlConnection ctxCon = new SqlConnection(
                "context connection=true"))
            using (SqlCommand ctxConCmd = new SqlCommand(
                "SELECT server, username, password, tablename, dbname "
                + "FROM SqlSuckerConfig", ctxCon)) {

                ctxCon.Open();

                using (SqlDataReader reader = ctxConCmd.ExecuteReader()) {
                    if (!reader.Read()) {
                        throw new System.Exception(
                            "No rows in SqlSuckerConfig");
                    }

                    tempServer = reader.GetString(0);
                    tempUser = reader.GetString(1);
                    tempPassword = reader.GetString(2);
                    tempTable = reader.GetString(3);
                    tempDatabase = reader.GetString(4);
                    conInfoOk = true;
                }
            }
        }
    }
コード例 #15
0
 public static SqlString TakeNotNull2(
     SqlInt32 index,
     SqlString text0,
     SqlString text1)
 {
     return TakeNotNull(index, text0, text1);
 }
コード例 #16
0
ファイル: AzureBlob.cs プロジェクト: DomG4/sqlservertoazure
        public static void ChangeContainerPublicAccessMethod(
            SqlString accountName, SqlString sharedKey, SqlBoolean useHTTPS,
            SqlString containerName,
            SqlString containerPublicReadAccess,            
            SqlGuid LeaseId,
            SqlInt32 timeoutSeconds,
            SqlGuid xmsclientrequestId)
        {
            Enumerations.ContainerPublicReadAccess cpraNew;
            if (!Enum.TryParse<Enumerations.ContainerPublicReadAccess>(containerPublicReadAccess.Value, out cpraNew))
            {
                StringBuilder sb = new StringBuilder("\"" + containerPublicReadAccess.Value + "\" is an invalid ContainerPublicReadAccess value. Valid values are: ");
                foreach (string s in Enum.GetNames(typeof(Enumerations.ContainerPublicReadAccess)))
                    sb.Append("\"" + s + "\" ");
                throw new ArgumentException(sb.ToString());
            }

            AzureBlobService abs = new AzureBlobService(accountName.Value, sharedKey.Value, useHTTPS.Value);
            Container cont = abs.GetContainer(containerName.Value);

            Enumerations.ContainerPublicReadAccess cpra;
            SharedAccessSignature.SharedAccessSignatureACL sasACL = cont.GetACL(out cpra,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);

            cont.UpdateContainerACL(cpraNew, sasACL,
                LeaseId.IsNull ? (Guid?)null : LeaseId.Value,
                timeoutSeconds.IsNull ? 0 : timeoutSeconds.Value,
                xmsclientrequestId.IsNull ? (Guid?)null : xmsclientrequestId.Value);
        }
コード例 #17
0
ファイル: ReceiptPayment.cs プロジェクト: kimykunjun/test
        public void UpdateIPP(SqlString nIPPId,SqlInt32 nPaymentId)
        {
            myRP.NNullIPPId = nIPPId;
            myRP.NPaymentID = nPaymentId;

            myRP.UpdateAllWnIPP_PaymentIDLogic();
        }
コード例 #18
0
ファイル: IsNucX.cs プロジェクト: szalaigj/LoaderToolkit
 public static SqlInt32 IsNucX(SqlInt64 posStart, SqlString misMNuc, SqlInt64 refPos, SqlString refNuc, SqlString countNuc)
 {
     SqlInt32 result;
     Dictionary<long, string> mutationPositions = new Dictionary<long, string>();
     string mutationPattern = @"[0-9]+ [ACGTN]+";
     MatchCollection matches = Regex.Matches(misMNuc.Value, mutationPattern);
     foreach (Match match in matches)
     {
         var foundMutation = match.Value;
         string[] foundMutParts = foundMutation.Split(' ');
         long mutStartPos = posStart.Value + Int32.Parse(foundMutParts[0]);
         var mutNuc = foundMutParts[1];
         mutationPositions.Add(mutStartPos, mutNuc);
     }
     string mutValue;
     if (mutationPositions.TryGetValue(refPos.Value, out mutValue))
     {
         result = new SqlInt32(countNuc.Value.Equals(mutValue) ? 1 : 0);
     }
     else
     {
         result = new SqlInt32(countNuc.Value.Equals(refNuc.Value) ? 1 : 0);
     }
     return result;
 }
コード例 #19
0
        public static void GetSkyline(SqlString strQuery, SqlString strOperators, SqlInt32 numberOfRecords,
            SqlInt32 sortType, SqlInt32 count, SqlInt32 dimension, SqlString algorithm, SqlBoolean hasIncomparable)
        {
            try
            {
                Type strategyType = Type.GetType("prefSQL.SQLSkyline." + algorithm.ToString());

                if (!typeof (SkylineStrategy).IsAssignableFrom(strategyType))
                {
                    throw new Exception("passed algorithm is not of type SkylineStrategy.");
                }

                var strategy = (SkylineStrategy) Activator.CreateInstance(strategyType);

                strategy.Provider = Helper.ProviderClr;
                strategy.ConnectionString = Helper.CnnStringSqlclr;
                strategy.RecordAmountLimit = numberOfRecords.Value;
                strategy.HasIncomparablePreferences = hasIncomparable.Value;
                strategy.SortType = sortType.Value;

                var skylineSample = new SkylineSampling
                {
                    SubsetCount = count.Value,
                    SubsetDimension = dimension.Value,
                    SelectedStrategy = strategy
                };

                DataTable dataTableReturn = skylineSample.GetSkylineTable(strQuery.ToString(), strOperators.ToString());
                SqlDataRecord dataRecordTemplate = skylineSample.DataRecordTemplateForStoredProcedure;

                //throw new Exception(dataTableReturn.Rows[0].Table.Columns.Count.ToString());

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.SendResultsStart(dataRecordTemplate);

                    foreach (DataRow recSkyline in dataTableReturn.Rows)
                    {
                        for (var i = 0; i < recSkyline.Table.Columns.Count; i++)
                        {
                            dataRecordTemplate.SetValue(i, recSkyline[i]);
                        }
                        SqlContext.Pipe.SendResultsRow(dataRecordTemplate);
                    }
                    SqlContext.Pipe.SendResultsEnd();
                }
            }
            catch (Exception ex)
            {
                //Pack Errormessage in a SQL and return the result
                var strError = "Error in prefSQL_SkylineSampling: ";
                strError += ex.Message;

                if (SqlContext.Pipe != null)
                {
                    SqlContext.Pipe.Send(strError);
                }
            }
        }
コード例 #20
0
    public static SqlString fnGetErrorMessage(SqlString aErrorMessage, SqlInt32 aLCID, SqlInt32 aDefaultLCID)
    {
        if (aErrorMessage.IsNull)
        {
            return SqlString.Null;
        }
        string errmsg = aErrorMessage.Value;
        string[] criterias = {
            "'(?<pattern>(CK_.+?))'",
            "'(?<pattern>(FK_.+?))'",
            "'(?<pattern>(PK_.+?))'",
            "'(?<pattern>(UQ_.+?))'",

            "\"(?<pattern>(CK_.+?))\"",
            "\"(?<pattern>(FK_.+?))\"",
            "\"(?<pattern>(PK_.+?))\"",
            "\"(?<pattern>(UQ_.+?))\"" 
        };

        Match m = null;
        for (int i = 0; i < criterias.Length; i++)
        {
            m = Regex.Match(errmsg, criterias[i]);
            if (m.Success)
                break;
        }

        if (m.Success)
        {
            string ConstraintName = m.Groups["pattern"].Value;
            SqlString msg = null;
            using (SqlConnection conn = new SqlConnection("context connection=true"))
            {
                SqlCommand command = new SqlCommand(
                               " select dbo.fnXMLGetMessageValue(cm.Description, @lcid, @default_lcid)" +
                               "   from dbo.ConstraintMessage cm" +
                               "  where cm.ConstraintName = @ConstraintName",
                               conn);
                command.Parameters.Add(new SqlParameter("@lcid", aLCID.IsNull ? 1033 : aLCID.Value));
                command.Parameters.Add(new SqlParameter("@default_lcid", aDefaultLCID.IsNull ? 1033 : aDefaultLCID.Value));
                command.Parameters.Add(new SqlParameter("@ConstraintName", ConstraintName));
                conn.Open();
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        msg = reader.GetSqlString(0);
                    }
                }
                conn.Close();
            }
            return (msg.IsNull) ? aErrorMessage : msg;
        }
        else
        {
            return aErrorMessage;
        }

    }
コード例 #21
0
    public static IEnumerable FindPHkeysAndSlots(SqlInt16 partsnap, SqlInt16 fofsnap, SqlString temp_partid_table_name, SqlInt32 numparts)
    {
        //string temp_partid_table = "#temp_partid_list";
        List<PhkeySlot> keysAndSlots = new List<PhkeySlot>();
        using (SqlConnection connection = new SqlConnection("context connection=true"))
        {
            connection.Open();
            string getFoFGroupIDsCommandString = "select partid from " + temp_partid_table_name.ToString();
            SqlCommand getFoFGroupIDsListCommand = new SqlCommand(getFoFGroupIDsCommandString, connection);
            SqlDataReader getFOFGroupIDsReader = getFoFGroupIDsListCommand.ExecuteReader();
            Int64[] partids = new Int64[(int) numparts];
            int numlines = 0;
            while (getFOFGroupIDsReader.Read())
            {
                partids[numlines] = Int64.Parse(getFOFGroupIDsReader["partid"].ToString());
                ++numlines;
            }
            getFOFGroupIDsReader.Close();
            // Find the index blocks we need to look in
            HashSet<Int64> blocks = new HashSet<Int64>();
            foreach (Int64 id in partids)
            {
                blocks.Add((id - 1) / 1024 / 1024);
            }

            //means we want all snaps
            string rawCommand = "";
            if (partsnap < 0)
            {
                rawCommand = "select a.snap, a.phkey, a.slot from particleDB.dbo.index{0} a, " + temp_partid_table_name.ToString() + " b "
                    + " where a.partid = b.partid";
            }
            else
            {
                rawCommand = "select a.snap, a.phkey, a.slot from particleDB.dbo.index{0} a, " + temp_partid_table_name.ToString() + " b "
                    + " where a.partid = b.partid and a.snap = @partsnap";
            }

            foreach (Int64 blockID in blocks)
            {
                string joinFoFGroupIndexCommandString = string.Format(rawCommand, blockID);
                SqlCommand joinFofGroupIndexCommand = new SqlCommand(joinFoFGroupIndexCommandString, connection);
                SqlParameter partsnapParam = new SqlParameter("@partsnap", System.Data.SqlDbType.SmallInt);
                partsnapParam.Value = partsnap;
                joinFofGroupIndexCommand.Parameters.Add(partsnapParam);
                SqlDataReader joinReader = joinFofGroupIndexCommand.ExecuteReader();
                while (joinReader.Read())
                {
                    int snap = Int32.Parse(joinReader["snap"].ToString());
                    int phkey = Int32.Parse(joinReader["phkey"].ToString());
                    short slot = Int16.Parse(joinReader["slot"].ToString());
                    PhkeySlot current = new PhkeySlot(snap, phkey, slot);
                    keysAndSlots.Add(current);
                }
                joinReader.Close();
            }
        }
        return keysAndSlots;
    }
コード例 #22
0
 public static void FillGroupRow( object data,
    out SqlInt32 index, out SqlChars group, out SqlChars text )
 {
     GroupNode node = (GroupNode)data;
       index = new SqlInt32( node.Index );
       group = new SqlChars( node.Name.ToCharArray( ) );
       text = new SqlChars( node.Value.ToCharArray( ) );
 }
コード例 #23
0
 public static SqlString PickOutAPartOfColumnBySeparator(SqlString inputColumn, SqlInt32 nThPart, SqlString separator)
 {
     string inputColumnStr = inputColumn.Value;
     string separatorStr = separator.Value;
     string[] separatedInputColumn = Regex.Split(inputColumnStr, separatorStr);
     string result = separatedInputColumn[nThPart.Value];
     return new SqlString(result);
 }
コード例 #24
0
ファイル: REGEXP_LIKE.cs プロジェクト: D3f0/django-mssql
    public static SqlInt32 REGEXP_LIKE(SqlString input, SqlString pattern, SqlInt32 caseSensitive)
    {
        RegexOptions options = DefaultRegExOptions;
        if (caseSensitive==0)
            options |= RegexOptions.IgnoreCase;

        return Regex.IsMatch(input.Value, pattern.Value, options) ? 1 : 0;
    }
コード例 #25
0
 public static void CodesRows(object row, out SqlString Code, out SqlInt32 Index, out SqlString Operation, out SqlString Sign, out SqlString Params)
 {
     Code      = ((CodesRow)row).Code;
       Index     = ((CodesRow)row).Index;
       Operation = ((CodesRow)row).Operation;
       Sign      = ((CodesRow)row).Sign;
       Params    = ((CodesRow)row).Params;
 }
コード例 #26
0
 public static void FillAdjustedPrice(Object obj, out SqlInt32 itemId, out SqlMoney adjustedPrice, out SqlMoney averagePrice, out SqlChars itemName)
 {
     CCPDatum Item = (CCPDatum)obj;
     itemId = new SqlInt32(Item.item_id);
     adjustedPrice = new SqlMoney(Item.adjustedPrice);
     averagePrice = Item.averagePrice.HasValue ? new SqlMoney(Item.averagePrice.Value) : SqlMoney.Null;
     itemName = new SqlChars(Item.item_name);
 }
コード例 #27
0
ファイル: Or.SqlInt.cs プロジェクト: raziqyork/Geeks.SqlUtils
 public static SqlInt32 OrInt4(
     SqlInt32 value0,
     SqlInt32 value1,
     SqlInt32 value2,
     SqlInt32 value3)
 {
     return OrSqlInt32(value0, value1, value2, value3);
 }
コード例 #28
0
    private static SqlString TakeNotNull(SqlInt32 index, params SqlString[] texts)
    {
        var nonNull = texts.Where(t => !t.IsNull); // && !String.IsNullOrWhiteSpace(t.Value));

        var selected = nonNull.ElementAtOrDefault(index.Value);

        return selected;
    }
コード例 #29
0
ファイル: UserDefinedFunctions.cs プロジェクト: anjlab/fx
        public static Pair MakePair(SqlInt32 value, SqlString name)
        {
            if (value.IsNull) return Pair.Null;

            var pair = new Pair {Value = value, Name = name};

            return pair;
        }
コード例 #30
0
        public static SqlXml GetContentLinkedFiles(SqlInt32 OrderId)
        {
            if (OrderId.IsNull)
                return SqlXml.Null;
            var ProgramList = new List<int>();
            using (var db = new SqlConnection("context connection=true"))
            {

                using (var q = new SqlCommand() {Connection = db, CommandType = CommandType.Text})
                {
                    q.CommandText =
                        @"SELECT L.[Код программы]
                        FROM [Жалюзи_заказы] AS O
                            INNER JOIN [Жалюзи_бланки_связанные_программы] AS L
                                ON L.[Код бланка]=O.[Код бланка]
                        WHERE
                            O.[Код]=@OrderId";

                    q.Parameters.Add("@OrderId", SqlDbType.Int).Direction = ParameterDirection.Input;
                    q.Parameters["@OrderId"].Value = OrderId.Value;

                    db.Open();
                    var result = q.ExecuteReader();
                    while(result.Read())
                        ProgramList.Add((int)result["Код программы"]);
                    result.Close();
                }
            }

            var doc = new XDocument(
                new XElement("root",
                    new XElement("Код_x0020_заказа", OrderId.Value)));

            foreach (var ProgramId in ProgramList)
            {
                var FileContent = GetLinkedFile(OrderId, ProgramId);
                if (FileContent.IsNull)
                    continue;

                var ms = new MemoryStream(FileContent.Value);
                List<XElement> content = null;
                switch (ProgramId)
                {
                    case 1:
                        content = GetMultiTexture(ms);
                        break;
                }
                if (content==null && content.Count<=0)
                    continue;
                doc.Root.Add(
                    new XElement("Содержимое",
                        new XElement("Код_x0020_программы", ProgramId),
                        content));

            }

            return new SqlXml(doc.CreateReader());
        }
コード例 #31
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="connectionString">Connection string to be used when accessing the database.</param>
        /// <param name="col_Cus_LngID">[To be supplied.]</param>
        public tblCustomer_Record(string connectionString, System.Data.SqlTypes.SqlInt32 col_Cus_LngID)
        {
#if OLYMARS_DEBUG
            object olymarsDebugCheck = System.Configuration.ConfigurationSettings.AppSettings["OlymarsDebugCheck"];
            if (olymarsDebugCheck == null || (string)olymarsDebugCheck == "True")
            {
                string DebugConnectionString = connectionString;

                if (DebugConnectionString == System.String.Empty)
                {
                    DebugConnectionString = OlymarsDemo.DataClasses.Information.GetConnectionStringFromConfigurationFile;
                }

                if (DebugConnectionString == System.String.Empty)
                {
                    DebugConnectionString = OlymarsDemo.DataClasses.Information.GetConnectionStringFromRegistry;
                }

                if (DebugConnectionString != String.Empty)
                {
                    System.Data.SqlClient.SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection(DebugConnectionString);

                    sqlConnection.Open();

                    System.Data.SqlClient.SqlCommand sqlCommand = sqlConnection.CreateCommand();

                    sqlCommand.CommandType = System.Data.CommandType.Text;
                    sqlCommand.CommandText = "Select sysobjects.schema_ver from sysobjects where sysobjects.name = 'tblCustomer'";

                    int CurrentRevision = (int)sqlCommand.ExecuteScalar();

                    sqlConnection.Close();

                    int OriginalRevision = ((OlymarsDemo.DataClasses.OlymarsInformationAttribute)System.Attribute.GetCustomAttribute(this.GetType(), typeof(OlymarsDemo.DataClasses.OlymarsInformationAttribute), false)).SqlObjectDependancyRevision;
                    if (CurrentRevision != OriginalRevision)
                    {
                        throw new System.InvalidOperationException(System.String.Format("OLYMARS: This code is not in sync anymore with [{0}]. It was generated when [{0}] version was: {2}. Current [{0}] version is: {1}", "tblCustomer", CurrentRevision, OriginalRevision));
                    }
                }
            }
#endif

            this.recordWasLoadedFromDB = true;
            this.recordIsLoaded        = false;

            this.connectionString        = connectionString;
            this.lastKnownConnectionType = OlymarsDemo.DataClasses.ConnectionType.ConnectionString;

            this.col_Cus_LngID = col_Cus_LngID;
        }
コード例 #32
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <param name="sqlTransaction">A valid System.Data.SqlClient.SqlTransaction object.</param>
        /// <param name="col_CustomerID">[To be supplied.]</param>
        public Customer(SqlTransaction sqlTransaction, System.Data.SqlTypes.SqlInt32 col_CustomerID)
        {
#if OLYMARS_DEBUG
            object olymarsDebugCheck = System.Configuration.ConfigurationSettings.AppSettings["OlymarsDebugCheck"];
            if (olymarsDebugCheck == null || (string)olymarsDebugCheck == "True")
            {
                bool NotAlreadyOpened = false;
                if (sqlTransaction.Connection.State == System.Data.ConnectionState.Closed)
                {
                    NotAlreadyOpened = true;
                    sqlTransaction.Connection.Open();
                }

                System.Data.SqlClient.SqlCommand sqlCommand = sqlTransaction.Connection.CreateCommand();

                sqlCommand.CommandType = System.Data.CommandType.Text;
                sqlCommand.CommandText = "Select sysobjects.schema_ver from sysobjects where sysobjects.name = 'Customers'";
                sqlCommand.Transaction = sqlTransaction;

                int CurrentRevision = (int)sqlCommand.ExecuteScalar();

                if (NotAlreadyOpened)
                {
                    sqlTransaction.Connection.Close();
                }

                int OriginalRevision = ((Bob.DataClasses.OlymarsInformationAttribute)System.Attribute.GetCustomAttribute(this.GetType(), typeof(Bob.DataClasses.OlymarsInformationAttribute), false)).SqlObjectDependancyRevision;
                if (CurrentRevision != OriginalRevision)
                {
                    throw new System.InvalidOperationException(System.String.Format("OLYMARS: This code is not in sync anymore with [{0}]. It was generated when [{0}] version was: {2}. Current [{0}] version is: {1}{3}{3}You can either regenerate the code for this class so that it will be based on the new version or edit the configuration file of the class caller application and paste the following code:{3}{3}<?xml version=\"1.0\" encoding=\"utf-8\" ?>{3}<configuration>{3}\t<appSettings>{3}\t\t<add key=\"OlymarsDebugCheck\" value=\"False\" />{3}\t</appSettings>{3}</configuration>{3}{3}You will need to reload the caller application if it is a Windows Forms based application.", "Customers", CurrentRevision, OriginalRevision, System.Environment.NewLine));
                }
            }
#endif

            this.recordWasLoadedFromDB = true;
            this.recordIsLoaded        = false;

            this.sqlTransaction          = sqlTransaction;
            this.lastKnownConnectionType = Bob.DataClasses.ConnectionType.SqlTransaction;

            this.col_CustomerID = col_CustomerID;
        }
コード例 #33
0
 public int CompareTo(SqlInt32 value)
 {
     return(CompareSqlInt32(value));
 }
コード例 #34
0
 public static SqlInt32 Divide(SqlInt32 x, SqlInt32 y)
 {
     return(x / y);
 }
コード例 #35
0
 public static SqlBoolean Equals(SqlInt32 x, SqlInt32 y)
 {
     return(x == y);
 }
コード例 #36
0
 public static SqlInt32 Xor(SqlInt32 x, SqlInt32 y)
 {
     return(x ^ y);
 }
コード例 #37
0
 public static SqlBoolean GreaterThan(SqlInt32 x, SqlInt32 y)
 {
     return(x > y);
 }
コード例 #38
0
 public static SqlBoolean NotEquals(SqlInt32 x, SqlInt32 y)
 {
     return(x != y);
 }
コード例 #39
0
 public static SqlInt32 Add(SqlInt32 x, SqlInt32 y)
 {
     return(x + y);
 }
コード例 #40
0
 /// <remarks/>
 public void GetSalesTotalAsync(System.Data.SqlTypes.SqlInt32 SalespersonID)
 {
     this.GetSalesTotalAsync(SalespersonID, null);
 }
コード例 #41
0
 public static SqlInt32 Subtract(SqlInt32 x, SqlInt32 y)
 {
     return(x - y);
 }
コード例 #42
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_JobIdWasUpdated = false;
            this.col_JobIdWasSet     = false;
            this.col_JobId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_DescriptionWasUpdated = false;
            this.col_DescriptionWasSet     = false;
            this.col_Description           = System.Data.SqlTypes.SqlString.Null;

            this.col_JobPartTypeIdWasUpdated = false;
            this.col_JobPartTypeIdWasSet     = false;
            this.col_JobPartTypeId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_UnitsWasUpdated = false;
            this.col_UnitsWasSet     = false;
            this.col_Units           = System.Data.SqlTypes.SqlDecimal.Null;

            this.col_PricePerUnitWasUpdated = false;
            this.col_PricePerUnitWasSet     = false;
            this.col_PricePerUnit           = System.Data.SqlTypes.SqlMoney.Null;

            this.col_TotalPriceWasUpdated = false;
            this.col_TotalPriceWasSet     = false;
            this.col_TotalPrice           = System.Data.SqlTypes.SqlMoney.Null;

            bool alreadyOpened = false;

            Params.spS_JobPart Param = new Params.spS_JobPart(true);
            Param.CommandTimeOut = this.selectCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case Bob.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case Bob.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case Bob.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            if (!this.col_JobPartId.IsNull)
            {
                Param.Param_JobPartId = this.col_JobPartId;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_JobPart Sp = new SPs.spS_JobPart(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex))
                    {
                        this.col_JobId = sqlDataReader.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex))
                    {
                        this.col_Description = sqlDataReader.GetSqlString(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex))
                    {
                        this.col_JobPartTypeId = sqlDataReader.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex))
                    {
                        this.col_Units = sqlDataReader.GetSqlDecimal(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex))
                    {
                        this.col_PricePerUnit = sqlDataReader.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.ColumnIndex))
                    {
                        this.col_TotalPrice = sqlDataReader.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.ColumnIndex);
                    }

                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = true;

                    return(true);
                }
                else
                {
                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = false;

                    return(false);
                }
            }
            else
            {
                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                throw new Bob.DataClasses.CustomException(Param, "Bob.BusinessComponents.JobPart_Record", "Refresh");
            }
        }
コード例 #43
0
ファイル: SqlString.cs プロジェクト: pmq20/mono_forked
 /**
  * Converts this SqlString structure to SqlInt32.
  * @return A SqlInt32 structure whose Value equals the Value of this SqlString structure.
  */
 public SqlInt32 ToSqlInt32()
 {
     return(SqlInt32.Parse(_value));
 }
コード例 #44
0
 public static SqlBoolean LessThan(SqlInt32 x, SqlInt32 y)
 {
     return(x < y);
 }
コード例 #45
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_Ord_DatOrderedOnWasUpdated = false;
            this.col_Ord_DatOrderedOnWasSet     = false;
            this.col_Ord_DatOrderedOn           = System.Data.SqlTypes.SqlDateTime.Null;

            this.col_Ord_LngCustomerIDWasUpdated = false;
            this.col_Ord_LngCustomerIDWasSet     = false;
            this.col_Ord_LngCustomerID           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_Ord_CurTotalWasUpdated = false;
            this.col_Ord_CurTotalWasSet     = false;
            this.col_Ord_CurTotal           = System.Data.SqlTypes.SqlMoney.Null;

            bool alreadyOpened = false;

            Params.spS_tblOrder Param = new Params.spS_tblOrder(true);
            Param.CommandTimeOut = this.selectCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case OlymarsDemo.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case OlymarsDemo.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            if (!this.col_Ord_GuidID.IsNull)
            {
                Param.Param_Ord_GuidID = this.col_Ord_GuidID;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_tblOrder Sp = new SPs.spS_tblOrder(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex))
                    {
                        this.col_Ord_DatOrderedOn = sqlDataReader.GetSqlDateTime(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex))
                    {
                        this.col_Ord_LngCustomerID = sqlDataReader.GetSqlInt32(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex))
                    {
                        this.col_Ord_CurTotal = sqlDataReader.GetSqlMoney(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex);
                    }

                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = true;

                    return(true);
                }
                else
                {
                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = false;

                    return(false);
                }
            }
            else
            {
                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                throw new OlymarsDemo.DataClasses.CustomException(Param, "OlymarsDemo.BusinessComponents.tblOrder_Record", "Refresh");
            }
        }
コード例 #46
0
 public static SqlInt32 BitwiseOr(SqlInt32 x, SqlInt32 y)
 {
     return(x | y);
 }
コード例 #47
0
 public static SqlInt32 BitwiseAnd(SqlInt32 x, SqlInt32 y)
 {
     return(x & y);
 }
コード例 #48
0
        /// <summary>
        /// [To be supplied.]
        /// </summary>
        /// <returns>[To be supplied.]</returns>
        public bool Refresh()
        {
            this.displayName = null;

            this.col_CompanyNameWasUpdated = false;
            this.col_CompanyNameWasSet     = false;
            this.col_CompanyName           = System.Data.SqlTypes.SqlString.Null;

            this.col_ContactNameWasUpdated = false;
            this.col_ContactNameWasSet     = false;
            this.col_ContactName           = System.Data.SqlTypes.SqlString.Null;

            this.col_TitleIdWasUpdated = false;
            this.col_TitleIdWasSet     = false;
            this.col_TitleId           = System.Data.SqlTypes.SqlInt32.Null;

            this.col_AddressWasUpdated = false;
            this.col_AddressWasSet     = false;
            this.col_Address           = System.Data.SqlTypes.SqlString.Null;

            this.col_CityWasUpdated = false;
            this.col_CityWasSet     = false;
            this.col_City           = System.Data.SqlTypes.SqlString.Null;

            this.col_PostalCodeWasUpdated = false;
            this.col_PostalCodeWasSet     = false;
            this.col_PostalCode           = System.Data.SqlTypes.SqlString.Null;

            this.col_PhoneWasUpdated = false;
            this.col_PhoneWasSet     = false;
            this.col_Phone           = System.Data.SqlTypes.SqlString.Null;

            this.col_EmailWasUpdated = false;
            this.col_EmailWasSet     = false;
            this.col_Email           = System.Data.SqlTypes.SqlString.Null;

            this.col_WebAddressWasUpdated = false;
            this.col_WebAddressWasSet     = false;
            this.col_WebAddress           = System.Data.SqlTypes.SqlString.Null;

            this.col_FaxWasUpdated = false;
            this.col_FaxWasSet     = false;
            this.col_Fax           = System.Data.SqlTypes.SqlString.Null;

            this.col_ActiveWasUpdated = false;
            this.col_ActiveWasSet     = false;
            this.col_Active           = System.Data.SqlTypes.SqlBoolean.Null;

            bool alreadyOpened = false;

            Params.spS_Customers Param = new Params.spS_Customers(true);
            Param.CommandTimeOut = this.selectCommandTimeOut;
            switch (this.lastKnownConnectionType)
            {
            case Bob.DataClasses.ConnectionType.ConnectionString:
                Param.SetUpConnection(this.connectionString);
                break;

            case Bob.DataClasses.ConnectionType.SqlConnection:
                Param.SetUpConnection(this.sqlConnection);
                alreadyOpened = (this.sqlConnection.State == System.Data.ConnectionState.Open);
                break;

            case Bob.DataClasses.ConnectionType.SqlTransaction:
                Param.SetUpConnection(this.sqlTransaction);
                break;
            }

            if (!this.col_CustomerID.IsNull)
            {
                Param.Param_CustomerID = this.col_CustomerID;
            }


            System.Data.SqlClient.SqlDataReader sqlDataReader = null;
            SPs.spS_Customers Sp = new SPs.spS_Customers(false);
            if (Sp.Execute(ref Param, out sqlDataReader))
            {
                if (sqlDataReader.Read())
                {
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_CompanyName.ColumnIndex))
                    {
                        this.col_CompanyName = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_CompanyName.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_ContactName.ColumnIndex))
                    {
                        this.col_ContactName = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_ContactName.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_TitleId.ColumnIndex))
                    {
                        this.col_TitleId = sqlDataReader.GetSqlInt32(SPs.spS_Customers.Resultset1.Fields.Column_TitleId.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Address.ColumnIndex))
                    {
                        this.col_Address = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Address.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_City.ColumnIndex))
                    {
                        this.col_City = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_City.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_PostalCode.ColumnIndex))
                    {
                        this.col_PostalCode = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_PostalCode.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Phone.ColumnIndex))
                    {
                        this.col_Phone = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Phone.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Email.ColumnIndex))
                    {
                        this.col_Email = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Email.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_WebAddress.ColumnIndex))
                    {
                        this.col_WebAddress = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_WebAddress.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Fax.ColumnIndex))
                    {
                        this.col_Fax = sqlDataReader.GetSqlString(SPs.spS_Customers.Resultset1.Fields.Column_Fax.ColumnIndex);
                    }
                    if (!sqlDataReader.IsDBNull(SPs.spS_Customers.Resultset1.Fields.Column_Active.ColumnIndex))
                    {
                        this.col_Active = sqlDataReader.GetSqlBoolean(SPs.spS_Customers.Resultset1.Fields.Column_Active.ColumnIndex);
                    }

                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = true;

                    return(true);
                }
                else
                {
                    if (sqlDataReader != null && !sqlDataReader.IsClosed)
                    {
                        sqlDataReader.Close();
                    }

                    CloseConnection(Sp.Connection, alreadyOpened);

                    this.recordIsLoaded = false;

                    return(false);
                }
            }
            else
            {
                if (sqlDataReader != null && !sqlDataReader.IsClosed)
                {
                    sqlDataReader.Close();
                }

                CloseConnection(Sp.Connection, alreadyOpened);

                throw new Bob.DataClasses.CustomException(Param, "Bob.BusinessComponents.Customer", "Refresh");
            }
        }
コード例 #49
0
 public static SqlInt32 Modulus(SqlInt32 x, SqlInt32 y)
 {
     return(x % y);
 }
コード例 #50
0
 public static SqlInt32 Multiply(SqlInt32 x, SqlInt32 y)
 {
     return(x * y);
 }
コード例 #51
0
 public static SqlBoolean GreaterThanOrEqual(SqlInt32 x, SqlInt32 y)
 {
     return(x >= y);
 }
コード例 #52
0
 public static SqlInt32 OnesComplement(SqlInt32 x)
 {
     return(~x);
 }
コード例 #53
0
ファイル: Reference.cs プロジェクト: aly-ba/SqlServer
 /// <remarks/>
 public System.IAsyncResult Beginbyroyalty(System.Data.SqlTypes.SqlInt32 percentage, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("byroyalty", new object[] {
         percentage
     }, callback, asyncState));
 }
コード例 #54
0
 public static SqlBoolean LessThanOrEqual(SqlInt32 x, SqlInt32 y)
 {
     return(x <= y);
 }