コード例 #1
0
        /// <summary>
        /// This method Display Image
        /// </summary>
        private void DisplayImage()
        {
            // locals
            Image image = null;
            int   delay = 0;

            // determine what image to show
            switch (this.Count)
            {
            case 0:
            case 10:
            case 12:

                // Set the image
                image = Properties.Resources.YellowBox;

                // use the Delay on 10 only so nothing is held up until it starts
                if (this.Count > 0)
                {
                    // set the delay
                    delay = TimerInterval;
                }

                // required
                break;

            case 1:

                // Set the image
                image = Properties.Resources.S;

                // required
                break;

            case 2:

                // Set the image
                image = Properties.Resources.Sh;

                // required
                break;

            case 3:

                // Set the image
                image = Properties.Resources.Shu;

                // required
                break;

            case 4:

                // Set the image
                image = Properties.Resources.Shuf;

                // required
                break;

            case 5:

                // Set the image
                image = Properties.Resources.Shuff;

                // required
                break;

            case 6:

                // Set the image
                image = Properties.Resources.Shuffl;

                // required
                break;

            case 7:

                // Set the image
                image = Properties.Resources.Shuffli;

                // required
                break;

            case 8:

                // Set the image
                image = Properties.Resources.Shufflin;

                // required
                break;

            case 9:
            case 11:
            case 13:

                // Set the image
                image = Properties.Resources.Shuffling;

                // Stay on the word Shuffling for an extra half a second
                delay = TimerInterval;

                // required
                break;
            }

            // If the image object exists
            if (NullHelper.Exists(image))
            {
                // set the image
                this.BackgroundImage = image;

                // Refresh this object
                this.Refresh();

                // if the ParentForm exists
                if (NullHelper.Exists(this.ParentForm))
                {
                    // Refresh the parent form
                    this.ParentForm.Refresh();

                    // Refersh everything
                    Application.DoEvents();

                    // if the delay is set
                    if (delay > 0)
                    {
                        // Delay for a second
                        System.Threading.Thread.Sleep(delay);
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// This method returns the Member With EF
        /// </summary>
        public EF.Member CreateMemberWithEF()
        {
            // initial value
            EF.Member member = new EF.Member();

            // Locals
            EF.ZipCode zipCode = null;

            // locals
            string unit = "";

            try
            {
                // set each property
                member.Active = true;

                // Create Address
                member.Address = new EF.Address();

                // get the AddressNumber
                int addressNumber = AddressNumberShuffler.PullNumber();

                // if the AddressNumber
                if (addressNumber % 100 < Info.PercentInApartments)
                {
                    // now get a number % 26
                    int isUnitNumericValue = ((addressNumber * 67) % 100) + 1;

                    // If this value is higher than percent needed for UnitNumeric
                    if (isUnitNumericValue > Info.PercentUnitNumeric)
                    {
                        // This is a letter instead of a number
                        unit = "Unit " + ((char)((isUnitNumericValue % 26) + 65)).ToString();
                    }
                    else
                    {
                        // split half up to say 'Apt.' and half up to say #'
                        if (addressNumber % 2 == 0)
                        {
                            unit = "Apt. #" + isUnitNumericValue.ToString();
                        }
                        else if (addressNumber % 3 == 1)
                        {
                            unit = "#" + isUnitNumericValue.ToString();
                        }
                    }
                }

                // Set the properties on the Address
                member.Address.StreetAddress = (addressNumber.ToString() + " " + EFStreetNames[StreetNameShuffler.PullNumber()].Name);
                member.Address.Unit          = unit;

                // set the ZipCode
                zipCode = EFZipCodes[ZipCodeShuffler.PullNumber()];

                // if the zipCode exists
                if (NullHelper.Exists(zipCode))
                {
                    // Set the City
                    member.Address.City    = zipCode.CityName;
                    member.Address.StateId = zipCode.StateId;
                    member.Address.ZipCode = zipCode.Name;
                }

                // Seft the FirstName & LastName
                member.FirstName = EFFirstNames[FirstNameShuffler.PullNumber()].Name;
                member.LastName  = EFLastNames[LastNameShuffler.PullNumber()].Name;
            }
            catch (Exception error)
            {
                // for debugging only
                DebugHelper.WriteDebugError("CreateMemberWithEF", "MemberGenerator", error);
            }

            // return value
            return(member);
        }
コード例 #3
0
        // <Summary>
        // This method is used to export a CustomReader object to xml.
        // </Summary>
        public string ExportCustomReader(CustomReader customReader, int indent = 0)
        {
            // initial value
            string customReaderXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the customReader object exists
            if (NullHelper.Exists(customReader))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open customReader node
                sb.Append("<CustomReader>" + Environment.NewLine);

                // Write out each property

                // Write out the value for ClassName

                sb.Append(indentString2);
                sb.Append("<ClassName>" + customReader.ClassName + "</ClassName>" + Environment.NewLine);

                // Write out the value for FetchAllForTable

                sb.Append(indentString2);
                sb.Append("<FetchAllForTable>" + customReader.FetchAllForTable + "</FetchAllForTable>" + Environment.NewLine);

                // If the value for the property customReader.HasFieldSet is true
                if (customReader.HasFieldSet)
                {
                    // Write out the value for FieldSet

                    // create a second writer
                    FieldSetsWriter fieldSetsWriter = new FieldSetsWriter();

                    // get the fieldSetsExml
                    string fieldSetXml = fieldSetsWriter.ExportFieldSet(customReader.FieldSet, indent + 1);

                    sb.Append(indentString2);
                    sb.Append(fieldSetXml);
                }

                // Write out the value for FieldSetId

                sb.Append(indentString2);
                sb.Append("<FieldSetId>" + customReader.FieldSetId + "</FieldSetId>" + Environment.NewLine);

                // Write out the value for DataWatcherFileName

                sb.Append(indentString2);
                sb.Append("<DataWatcherFileName>" + customReader.FileName + "</DataWatcherFileName>" + Environment.NewLine);

                // Write out the value for ReaderName

                sb.Append(indentString2);
                sb.Append("<ReaderName>" + customReader.ReaderName + "</ReaderName>" + Environment.NewLine);

                // Write out the value for TableId

                sb.Append(indentString2);
                sb.Append("<TableId>" + customReader.TableId + "</TableId>" + Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close customReader node
                sb.Append("</CustomReader>" + Environment.NewLine);

                // set the return value
                customReaderXml = sb.ToString();
            }
            // return value
            return(customReaderXml);
        }
コード例 #4
0
        /// <summary>
        /// This method returns a GatewayInfo object
        /// </summary>
        public static GatewayInfo GetGatewayInfo(string gatewayFilePath, List <string> methodNames)
        {
            // initial value
            GatewayInfo gatewayInfo = new GatewayInfo();

            // locals
            List <GatewayMethodInfo> methodInformation = new List <GatewayMethodInfo>();
            int  index                   = -1;
            bool methodRegionOn          = false;
            GatewayMethodInfo methodInfo = null;

            // Set the MethodInformation
            gatewayInfo.MethodInformation = methodInformation;

            // if the gatewayFilePath exists
            if ((TextHelper.Exists(gatewayFilePath)) && (File.Exists(gatewayFilePath)) && (ListHelper.HasOneOrMoreItems(methodNames)))
            {
                // Get the fileText
                string fileText = File.ReadAllText(gatewayFilePath);

                // If the fileText string exists
                if (TextHelper.Exists(fileText))
                {
                    // Parse the lines
                    List <TextLine> lines = WordParser.GetTextLines(fileText);

                    // If the lines collection exists and has one or more items
                    if (ListHelper.HasOneOrMoreItems(lines))
                    {
                        // set the lines
                        gatewayInfo.TextLines = lines;

                        // Iterate the collection of string objects
                        foreach (string methodName in methodNames)
                        {
                            // reset
                            methodRegionOn = false;
                            index          = -1;

                            // Iterate the collection of TextLine objects
                            foreach (TextLine line in lines)
                            {
                                // Increment the value for index
                                index++;

                                // Create a codeLine
                                CodeLine codeLine = new CodeLine(line.Text);

                                // if the TextLine exists
                                if (codeLine.HasTextLine)
                                {
                                    // Get the words for this line
                                    codeLine.TextLine.Words = WordParser.GetWords(line.Text);
                                }

                                // if the value for methodRegionOn is true
                                if (methodRegionOn)
                                {
                                    // if this is the
                                    if ((codeLine.IsEndRegion) && (NullHelper.Exists(methodInfo)))
                                    {
                                        // turn this off
                                        methodRegionOn = false;

                                        // Set the methodInfo
                                        methodInfo.EndIndex = index;

                                        // break out of the loop
                                        break;
                                    }
                                }
                                else
                                {
                                    // if this is a Region
                                    if (codeLine.IsRegion)
                                    {
                                        // if this is the method being sought
                                        if (methodName == codeLine.RegionName)
                                        {
                                            // set to true
                                            methodRegionOn = true;

                                            // Create a new instance of a 'MethodInfo' object.
                                            methodInfo = new GatewayMethodInfo();

                                            // Set the methodName
                                            methodInfo.Name = methodName;

                                            // Set the startIndex
                                            methodInfo.StartIndex = index;

                                            // Add this item
                                            methodInformation.Add(methodInfo);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // return value
            return(gatewayInfo);
        }
コード例 #5
0
 /// <summary>
 /// Reset the pool.
 /// </summary>
 public void Reset()
 {
     NullHelper.ToImplement();
 }
コード例 #6
0
 private bool IsFlipped()
 {
     NullHelper.ToImplement();
     return(false);
 }
コード例 #7
0
        // <Summary>
        // This method is used to export a DataField object to xml.
        // </Summary>
        public string ExportDataField(DataField dataField, int indent = 0)
        {
            // initial value
            string dataFieldXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the dataField object exists
            if (NullHelper.Exists(dataField))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open dataField node
                sb.Append("<DataField>" + Environment.NewLine);

                // Write out each property

                // Manually moved FieldName to the top for readabilty
                // Write out the value for FieldName

                sb.Append(indentString2);
                sb.Append("<FieldName>" + dataField.FieldName + "</FieldName>" + Environment.NewLine);

                // Write out the value for DataType

                sb.Append(indentString2);
                sb.Append("<DataType>" + dataField.DataType + "</DataType>" + Environment.NewLine);

                // Write out the value for DBDataType

                sb.Append(indentString2);
                sb.Append("<DBDataType>" + dataField.DBDataType + "</DBDataType>" + Environment.NewLine);

                // Write out the value for DBFieldName

                sb.Append(indentString2);
                sb.Append("<DBFieldName>" + dataField.DBFieldName + "</DBFieldName>" + Environment.NewLine);

                // Write out the value for DecimalPlaces

                sb.Append(indentString2);
                sb.Append("<DecimalPlaces>" + dataField.DecimalPlaces + "</DecimalPlaces>" + Environment.NewLine);

                // Write out the value for DefaultValue

                // if there is a DefaultValue
                if (TextHelper.Exists(dataField.DefaultValue))
                {
                    // Write out the Default Value
                    sb.Append(indentString2);
                    sb.Append("<DefaultValue>" + dataField.DefaultValue.Replace("(", "").Replace(")", "") + "</DefaultValue>" + Environment.NewLine);
                }
                else
                {
                    // Write out the Default Value
                    sb.Append(indentString2);
                    sb.Append("<DefaultValue></DefaultValue>" + Environment.NewLine);
                }

                // Write out the value for EnumDataTypeName

                sb.Append(indentString2);
                sb.Append("<EnumDataTypeName>" + dataField.EnumDataTypeName + "</EnumDataTypeName>" + Environment.NewLine);



                // Write out the value for HasDefault

                sb.Append(indentString2);
                sb.Append("<HasDefault>" + dataField.HasDefault + "</HasDefault>" + Environment.NewLine);

                // Write out the value for IsAutoIncrement

                sb.Append(indentString2);
                sb.Append("<IsAutoIncrement>" + dataField.IsAutoIncrement + "</IsAutoIncrement>" + Environment.NewLine);

                // Write out the value for IsEnumeration

                sb.Append(indentString2);
                sb.Append("<IsEnumeration>" + dataField.IsEnumeration + "</IsEnumeration>" + Environment.NewLine);

                // Write out the value for IsNullable

                sb.Append(indentString2);
                sb.Append("<IsNullable>" + dataField.IsNullable + "</IsNullable>" + Environment.NewLine);

                // Write out the value for IsReadOnly

                sb.Append(indentString2);
                sb.Append("<IsReadOnly>" + dataField.IsReadOnly + "</IsReadOnly>" + Environment.NewLine);

                // Write out the value for Precision

                sb.Append(indentString2);
                sb.Append("<Precision>" + dataField.Precision + "</Precision>" + Environment.NewLine);

                // Write out the value for PrimaryKey

                sb.Append(indentString2);
                sb.Append("<PrimaryKey>" + dataField.PrimaryKey + "</PrimaryKey>" + Environment.NewLine);

                // Write out the value for Required

                sb.Append(indentString2);
                sb.Append("<Required>" + dataField.Required + "</Required>" + Environment.NewLine);

                // Write out the value for Scale

                sb.Append(indentString2);
                sb.Append("<Scale>" + dataField.Scale + "</Scale>" + Environment.NewLine);

                // Write out the value for Size

                sb.Append(indentString2);
                sb.Append("<Size>" + dataField.Size + "</Size>" + Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close dataField node
                sb.Append("</DataField>" + Environment.NewLine);

                // set the return value
                dataFieldXml = sb.ToString();
            }
            // return value
            return(dataFieldXml);
        }
コード例 #8
0
        /// <summary>
        /// This class is used to Shuffle a list of type 'T'.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="list"></param>
        public static List <T> Shuffle <T>(this IList <T> list)
        {
            // List
            List <T> shuffledList = new List <T>();

            // locals
            int randomIndex = -1;
            int cycles      = 1;

            // Use the RNGCryptoServiceProvider to create random zeros or 1
            RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider();

            // Create the byte array that serves asa
            byte[] container = new byte[1];

            // if the list exists
            if ((list != null) && (list.Count > 0))
            {
                // we can't use the collection count it changes
                int listCount = list.Count;

                // set the cycles
                cycles = (listCount / 255) + 1;

                // now we have to 'Randomly' pull items and add them to the end results
                for (int x = 0; x < listCount; x++)
                {
                    // reset
                    randomIndex = -1;

                    // Fill the topOrBottom byteArray
                    crypto.GetBytes(container);

                    // iterate the cycles
                    for (int c = 0; c < cycles; c++)
                    {
                        // Get the value of topOrBottom
                        object randomByte = container.GetValue(0);

                        // if the randomByte exists
                        if (NullHelper.Exists(randomByte))
                        {
                            // get a randomValue
                            int randomValue = NumericHelper.ParseInteger(randomByte.ToString(), -1, -1);

                            // set the randomIndex to the modulas of the the listCount
                            randomIndex += randomValue;
                        }
                    }

                    // ensure in range
                    randomIndex = (randomIndex % list.Count);

                    // verify the index is in range
                    if ((randomIndex < list.Count) && (randomIndex >= 0))
                    {
                        // Add this integer
                        shuffledList.Add(list[randomIndex]);

                        // if the index is in rage
                        if ((list.Count > 0) && (list.Count > randomIndex))
                        {
                            // Remove the item from the sourceList now that we have it
                            list.RemoveAt(randomIndex);
                        }
                    }
                }
            }

            // return value
            return(shuffledList);
        }
コード例 #9
0
        // <Summary>
        // This method is used to export a DataIndex object to xml.
        // </Summary>
        public string ExportDataIndex(DataIndex dataIndex, int indent = 0)
        {
            // initial value
            string dataIndexXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the dataIndex object exists
            if (NullHelper.Exists(dataIndex))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open dataIndex node
                sb.Append("<DataIndex>" + Environment.NewLine);

                // Write out each property

                // Write out the value for AllowPageLocks

                sb.Append(indentString2);
                sb.Append("<AllowPageLocks>" + dataIndex.AllowPageLocks + "</AllowPageLocks>" + Environment.NewLine);

                // Write out the value for AllowRowLocks

                sb.Append(indentString2);
                sb.Append("<AllowRowLocks>" + dataIndex.AllowRowLocks + "</AllowRowLocks>" + Environment.NewLine);

                // Write out the value for Clustered

                sb.Append(indentString2);
                sb.Append("<Clustered>" + dataIndex.Clustered + "</Clustered>" + Environment.NewLine);

                // Write out the value for DataSpaceId

                sb.Append(indentString2);
                sb.Append("<DataSpaceId>" + dataIndex.DataSpaceId + "</DataSpaceId>" + Environment.NewLine);

                // Write out the value for FillFactor

                sb.Append(indentString2);
                sb.Append("<FillFactor>" + dataIndex.FillFactor + "</FillFactor>" + Environment.NewLine);

                // Write out the value for FilterDefinition

                sb.Append(indentString2);
                sb.Append("<FilterDefinition>" + dataIndex.FilterDefinition + "</FilterDefinition>" + Environment.NewLine);

                // Write out the value for HasFilter

                sb.Append(indentString2);
                sb.Append("<HasFilter>" + dataIndex.HasFilter + "</HasFilter>" + Environment.NewLine);

                // Write out the value for IgnoreDuplicateKey

                sb.Append(indentString2);
                sb.Append("<IgnoreDuplicateKey>" + dataIndex.IgnoreDuplicateKey + "</IgnoreDuplicateKey>" + Environment.NewLine);

                // Write out the value for IndexId

                sb.Append(indentString2);
                sb.Append("<IndexId>" + dataIndex.IndexId + "</IndexId>" + Environment.NewLine);

                // Write out the value for IndexType

                sb.Append(indentString2);
                sb.Append("<IndexType>" + dataIndex.IndexType + "</IndexType>" + Environment.NewLine);

                // Write out the value for IsDisabled

                sb.Append(indentString2);
                sb.Append("<IsDisabled>" + dataIndex.IsDisabled + "</IsDisabled>" + Environment.NewLine);

                // Write out the value for IsHypothetical

                sb.Append(indentString2);
                sb.Append("<IsHypothetical>" + dataIndex.IsHypothetical + "</IsHypothetical>" + Environment.NewLine);

                // Write out the value for IsPadded

                sb.Append(indentString2);
                sb.Append("<IsPadded>" + dataIndex.IsPadded + "</IsPadded>" + Environment.NewLine);

                // Write out the value for IsPrimary

                sb.Append(indentString2);
                sb.Append("<IsPrimary>" + dataIndex.IsPrimary + "</IsPrimary>" + Environment.NewLine);

                // Write out the value for IsUnique

                sb.Append(indentString2);
                sb.Append("<IsUnique>" + dataIndex.IsUnique + "</IsUnique>" + Environment.NewLine);

                // Write out the value for IsUniqueConstraint

                sb.Append(indentString2);
                sb.Append("<IsUniqueConstraint>" + dataIndex.IsUniqueConstraint + "</IsUniqueConstraint>" + Environment.NewLine);

                // Write out the value for Name

                sb.Append(indentString2);
                sb.Append("<Name>" + dataIndex.Name + "</Name>" + Environment.NewLine);

                // Write out the value for ObjectId

                sb.Append(indentString2);
                sb.Append("<ObjectId>" + dataIndex.ObjectId + "</ObjectId>" + Environment.NewLine);

                // Write out the value for TypeDescription

                sb.Append(indentString2);
                sb.Append("<TypeDescription>" + dataIndex.TypeDescription + "</TypeDescription>" + Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close dataIndex node
                sb.Append("</DataIndex>" + Environment.NewLine);

                // set the return value
                dataIndexXml = sb.ToString();
            }
            // return value
            return(dataIndexXml);
        }
コード例 #10
0
        // <Summary>
        // This method is used to export a Database object to xml.
        // </Summary>
        public string ExportDatabase(Database database, int indent = 0)
        {
            // initial value
            string databaseXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the database object exists
            if (NullHelper.Exists(database))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open database node
                sb.Append("<Database>" + Environment.NewLine);

                // Write out each property

                // Write out the value for Functions

                // Create the FunctionsWriter
                FunctionsWriter functionsWriter = new FunctionsWriter();

                // Export the Functions collection to xml
                string functionXml = functionsWriter.ExportList(database.Functions, indent + 2);
                sb.Append(functionXml);
                sb.Append(Environment.NewLine);

                // Write out the value for Name

                sb.Append(indentString2);
                sb.Append("<Name>" + database.Name + "</Name>" + Environment.NewLine);

                // Write out the value for StoredProcedures

                // Create the StoredProceduresWriter
                StoredProceduresWriter storedProceduresWriter = new StoredProceduresWriter();

                // Export the StoredProcedures collection to xml
                string storedProcedureXml = storedProceduresWriter.ExportList(database.StoredProcedures, indent + 2);
                sb.Append(storedProcedureXml);
                sb.Append(Environment.NewLine);

                // Write out the value for Tables

                // Create the TablesWriter
                TablesWriter tablesWriter = new TablesWriter();

                // Export the Tables collection to xml
                string dataTableXml = tablesWriter.ExportList(database.Tables, indent + 2);
                sb.Append(dataTableXml);
                sb.Append(Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close database node
                sb.Append("</Database>" + Environment.NewLine);

                // set the return value
                databaseXml = sb.ToString();
            }
            // return value
            return(databaseXml);
        }
コード例 #11
0
        /// <summary>
        /// This method prepares this control to be shown
        /// </summary>
        public void Setup(MethodInfo methodInfo, Project openProject, CustomReader customReader = null, DTNField orderByField = null, FieldSet orderByFieldSet = null)
        {
            // store the args
            this.MethodInfo  = methodInfo;
            this.OpenProject = openProject;

            // locals
            DataJuggler.Net.DataField        parameter  = null;
            List <DataJuggler.Net.DataField> parameters = null;
            ProcedureWriter writer = null;

            // If the MethodInfo object exists
            if (this.HasMethodInfo)
            {
                // create a new
                MethodsWriter methodsWriter = new MethodsWriter();

                // get the StoredXml
                StoredXml = methodsWriter.ExportMethodInfo(this.MethodInfo);

                // if the OrderByFieldSet object exists
                if (NullHelper.Exists(orderByFieldSet))
                {
                    // set the gateway
                    Gateway gateway = new Gateway();

                    // load the orderByFields
                    orderByFieldSet.FieldSetFields = gateway.LoadFieldSetFieldViewsByFieldSetId(orderByFieldSet.FieldSetId);
                }

                // Set the Name of the Table
                this.SelectedTableControl.Text = this.MethodInfo.SelectedTable.TableName;

                // set the procedureName
                this.ProcedureNameControl.Text = MethodInfo.ProcedureName;

                // Check the button for Manual Update (user clicks Copy and goes to their SQL instance and executes).
                this.ManualUpdateRadioButton.Checked = true;

                // Check the box if UseCustomReader is true
                this.CustomWhereCheckBox.Checked = MethodInfo.UseCustomWhere;

                // Set the CustomWhereText (if any)
                this.WhereTextBox.Text = MethodInfo.WhereText;

                // convert the table
                DataJuggler.Net.DataTable table = DataConverter.ConvertDataTable(MethodInfo.SelectedTable, this.OpenProject);

                // if this is a Single Field Parameter and the Parameter Field exists
                if ((MethodInfo.ParameterType == ParameterTypeEnum.Single_Field) && (MethodInfo.HasParameterField))
                {
                    // convert the field from a DTNField to a DataJuggler.Net.DataField
                    parameter = DataConverter.ConvertDataField(MethodInfo.ParameterField);

                    // Create a new instance of a 'ProcedureWriter' object (in TextWriter mode).
                    writer = new ProcedureWriter(true);

                    // if this is a FindByField method
                    if (writer.HasTextWriter)
                    {
                        // If Delete By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Delete_By)
                        {
                            // Write out the Delete Proc
                            writer.CreateDeleteProc(table, MethodInfo.ProcedureName, parameter);
                        }
                        // If Find By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Find_By)
                        {
                            // create a find procedure
                            writer.CreateFindProc(table, false, MethodInfo.ProcedureName, parameter, customReader, orderByField, orderByFieldSet, methodInfo.OrderByDescending, methodInfo.TopRows);
                        }
                        // if Load By is the Method Type
                        else if (MethodInfo.MethodType == MethodTypeEnum.Load_By)
                        {
                            // If the orderByField object exists
                            if (NullHelper.Exists(orderByFieldSet))
                            {
                                // if there are not any fields loaded
                                if (!ListHelper.HasOneOrMoreItems(orderByFieldSet.Fields))
                                {
                                    // load the Fields
                                    orderByFieldSet.Fields = FieldSetHelper.LoadFieldSetFields(orderByFieldSet.FieldSetId);
                                }
                            }

                            // create a find procedure
                            writer.CreateFindProc(table, true, MethodInfo.ProcedureName, parameter, customReader, orderByField, orderByFieldSet, methodInfo.OrderByDescending, methodInfo.TopRows);
                        }
                    }
                }
                else if ((MethodInfo.ParameterType == ParameterTypeEnum.Field_Set) && (MethodInfo.HasParameterFieldSet) && (MethodInfo.ParameterFieldSet.HasFields))
                {
                    // convert the DTNFields to DataFields
                    parameters = DataConverter.ConvertDataFields(MethodInfo.ParameterFieldSet.Fields);

                    // If the parameters collection exists and has one or more items
                    if (ListHelper.HasOneOrMoreItems(parameters))
                    {
                        // set the FieldSetName so the description writes the method description correctly
                        parameters[0].FieldSetName = MethodInfo.ParameterFieldSet.Name;
                    }

                    // Create a new instance of a 'ProcedureWriter' object (in TextWriter mode).
                    writer = new ProcedureWriter(true);

                    // if this is a FindByField method
                    if (writer.HasTextWriter)
                    {
                        // If Delete By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Delete_By)
                        {
                            // Write out the Delete Proc
                            writer.CreateDeleteProc(table, MethodInfo.ProcedureName, parameters);
                        }
                        // If Find By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Find_By)
                        {
                            // create a find procedure
                            writer.CreateFindProc(table, false, MethodInfo.ProcedureName, parameters, MethodInfo.CustomReader, orderByField, orderByFieldSet);
                        }
                        // if Load By is the Method Type
                        else if (MethodInfo.MethodType == MethodTypeEnum.Load_By)
                        {
                            // create a find procedure
                            writer.CreateFindProc(table, true, MethodInfo.ProcedureName, parameters, MethodInfo.CustomReader, orderByField, orderByFieldSet);
                        }
                    }
                }
                else if ((MethodInfo.ParameterType == ParameterTypeEnum.No_Parameters))
                {
                    // Create a new instance of a 'ProcedureWriter' object (in TextWriter mode).
                    writer = new ProcedureWriter(true);

                    // if this is a FindByField method
                    if (writer.HasTextWriter)
                    {
                        // If Delete By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Delete_By)
                        {
                            // Write out the Delete Proc
                            writer.CreateDeleteProc(table, MethodInfo.ProcedureName, parameters);
                        }
                        // If Find By is the Method Type
                        if (MethodInfo.MethodType == MethodTypeEnum.Find_By)
                        {
                            // create a find procedure
                            writer.CreateFindProc(table, false, MethodInfo.ProcedureName, parameters, MethodInfo.CustomReader, orderByField, orderByFieldSet);
                        }
                        // if Load By is the Method Type
                        else if (MethodInfo.MethodType == MethodTypeEnum.Load_By)
                        {
                            // create a find procedure
                            writer.CreateFindProc(table, true, MethodInfo.ProcedureName, parameters, MethodInfo.CustomReader, orderByField, orderByFieldSet);
                        }
                    }
                }

                // if the writer exists
                if (NullHelper.Exists(writer))
                {
                    // get the procedureText
                    string procedureText = writer.TextWriter.ToString();

                    // Show the Where Panel if CustomWhere is true
                    WherePanel.Visible = MethodInfo.UseCustomWhere;

                    // if CustomWhere
                    if (MethodInfo.UseCustomWhere)
                    {
                        // now the existing where text must be replaced
                        int whereIndex = procedureText.ToLower().IndexOf("where [");

                        // if the WhereText does not exist yet
                        if ((!MethodInfo.HasWhereText) && (whereIndex > 0))
                        {
                            // Set the text as it is now
                            string whereText = procedureText.Substring(whereIndex);

                            // If the whereText string exists
                            if (TextHelper.Exists(whereText))
                            {
                                // get the textLines
                                List <TextLine> textLines = WordParser.GetTextLines(whereText);

                                // If the textLines collection exists and has one or more items
                                if (ListHelper.HasOneOrMoreItems(textLines))
                                {
                                    // Create a new instance of a 'StringBuilder' object.
                                    StringBuilder sb = new StringBuilder();

                                    // add each textLine of the Where Clause except the last one
                                    foreach (TextLine textLine in textLines)
                                    {
                                        // if this is the End line
                                        if (!textLine.Text.ToLower().StartsWith("end"))
                                        {
                                            // Add this line
                                            sb.Append(textLine.Text);
                                        }
                                    }

                                    // Get the Where Clause
                                    MethodInfo.WhereText = sb.ToString().Trim();
                                }
                            }
                        }

                        // Set the WhereText
                        WhereTextBox.Text = MethodInfo.WhereText;

                        // if the whereIndex was found
                        if (whereIndex >= 0)
                        {
                            // if the WhereText does not already exist
                            if (!TextHelper.Exists(MethodInfo.WhereText))
                            {
                                // Set the default WhereText
                                MethodInfo.WhereText = procedureText.Substring(whereIndex);
                            }

                            // set the new ProcedureText
                            procedureText = procedureText.Substring(0, whereIndex) + MethodInfo.WhereText + Environment.NewLine + Environment.NewLine + "END";
                        }
                    }

                    // Remove any double blank lines
                    procedureText = CodeLineHelper.RemoveDoubleBlankLines(procedureText);

                    // display the procedure As Is for now.
                    this.ProcedureTextBox.Text = procedureText;
                }
            }
        }
コード例 #12
0
 /// <summary>
 /// Resize the depth stencil buffer to accommodate a dimension of <param name="width"/> by <param name="height"/> pixels and
 /// a given <param name="format"/>.
 /// </summary>
 /// <param name="width">The new width in pixels.</param>
 /// <param name="height">The new height in pixels.</param>
 /// <param name="format">The new format.</param>
 protected override void ResizeDepthStencilBuffer(int width, int height, PixelFormat format)
 {
     NullHelper.ToImplement();
 }
コード例 #13
0
 /// <summary>
 /// Present the swap chain.
 /// </summary>
 public override void Present()
 {
     NullHelper.ToImplement();
 }
コード例 #14
0
 /// <summary>
 /// Initializes a new instance of <see cref="SwapChainGraphicsPresenter"/> for <param name="device"/> using
 /// the <see cref="PresentationParameters"/> <param name="parameters"/>.
 /// </summary>
 /// <param name="device">The graphics device.</param>
 /// <param name="parameters">The presentation parameters.</param>
 public SwapChainGraphicsPresenter(GraphicsDevice device, PresentationParameters parameters) : base(device, parameters)
 {
     NullHelper.ToImplement();
 }
コード例 #15
0
 private void InitializeFromImpl(DataBox[] dataBoxes = null)
 {
     NullHelper.ToImplement();
 }
コード例 #16
0
        public static List <ErrorLogEntity> GetErrorLogs(string env, int?tzOffsetMinutes, int?errorLogId, int?userId)
        {
            var connectionString = ConfigurationManager.ConnectionStrings[env].ConnectionString;

            var resultEntity = new List <ErrorLogEntity>();

            using (var connection = new SqlConnection(connectionString))
            {
                using (var command = new SqlCommand("[GetErrorLogs]")
                {
                    CommandType = CommandType.StoredProcedure, Connection = connection
                })
                {
                    // =====================================================================================================
                    // Add Parameters
                    // =====================================================================================================

                    //SqlParameter[] paramCollection = new SqlParameter[0];

                    if (userId != null)
                    {
                        var param_UserId = new SqlParameter("@UserId", userId)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.Int
                        };
                        command.Parameters.Add(param_UserId);
                    }

                    if (errorLogId != null)
                    {
                        var param_errorLogId = new SqlParameter("@errorLogId", errorLogId)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.Int
                        };
                        command.Parameters.Add(param_errorLogId);
                    }

                    connection.Open();
                    using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                    {
                        if (reader != null)
                        {
                            while (reader.Read())
                            {
                                var entity = new ErrorLogEntity();

                                entity.ErrorLogId              = NullHelper.GetInt32FromReader(reader, "ErrorLogId");
                                entity.ErrorNumber             = NullHelper.GetInt32FromReader(reader, "ErrorNumber");
                                entity.ErrorSeverity           = NullHelper.GetInt32FromReader(reader, "ErrorSeverity");
                                entity.ErrorState              = NullHelper.GetInt32FromReader(reader, "ErrorState");
                                entity.ErrorProcedure          = NullHelper.GetStringFromReader(reader, "ErrorProcedure");
                                entity.ErrorLine               = NullHelper.GetInt32FromReader(reader, "ErrorLine");
                                entity.ErrorMessage            = NullHelper.GetStringFromReader(reader, "ErrorMessage");
                                entity.ErrorAdditionalInfo     = NullHelper.GetStringFromReader(reader, "ErrorAdditionalInfo");
                                entity.ExceptionHelpLink       = NullHelper.GetStringFromReader(reader, "ExceptionHelpLink");
                                entity.ExceptionTargetSite     = NullHelper.GetStringFromReader(reader, "ExceptionTargetSite");
                                entity.ExceptionMessage        = NullHelper.GetStringFromReader(reader, "ExceptionMessage");
                                entity.ExceptionSource         = NullHelper.GetStringFromReader(reader, "ExceptionSource");
                                entity.ExceptionStackTrace     = NullHelper.GetStringFromReader(reader, "ExceptionStackTrace");
                                entity.ExceptionAdditionalInfo = NullHelper.GetStringFromReader(reader, "ExceptionAdditionalInfo");
                                entity.UserId          = NullHelper.GetInt32FromReader(reader, "UserId");
                                entity.FriendlyMessage = NullHelper.GetStringFromReader(reader, "FriendlyMessage");
                                entity.CreatedDateTime = NullHelper.GetDateFromReader(reader, "CreatedDateTime", tzOffsetMinutes);

                                resultEntity.Add(entity);
                            }
                        }
                    }
                }
            }

            return(resultEntity);
        }
コード例 #17
0
 private void OnRecreateImpl()
 {
     NullHelper.ToImplement();
 }
コード例 #18
0
        public static List <UserEntity> GetUsers(string env, int?tzOffsetMinutes, int?userId, string userName, bool?active)
        {
            var connectionString = ConfigurationManager.ConnectionStrings[env].ConnectionString;

            var resultEntity = new List <UserEntity>();

            using (var connection = new SqlConnection(connectionString))
            {
                using (var command = new SqlCommand("[GetUsers]")
                {
                    CommandType = CommandType.StoredProcedure, Connection = connection
                })
                {
                    // =====================================================================================================
                    // Add Parameters
                    // =====================================================================================================

                    //SqlParameter[] paramCollection = new SqlParameter[0];

                    if (userId != null)
                    {
                        var param_UserId = new SqlParameter("@UserId", userId)
                        {
                            Direction = ParameterDirection.Input,
                        };
                        command.Parameters.Add(param_UserId);
                    }

                    if (userName != String.Empty)
                    {
                        var param_userName = new SqlParameter("@UserName", userName)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.VarChar,
                            Size      = 50
                        };
                        command.Parameters.Add(param_userName);
                    }

                    if (active != null)
                    {
                        var param_Active = new SqlParameter("@Active", active)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.Bit,
                        };
                        command.Parameters.Add(param_Active);
                    }

                    connection.Open();
                    using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                    {
                        if (reader != null) // does this always evaluate to true? Why is this line here?
                        {
                            while (reader.Read())
                            {
                                var entity = new UserEntity();

                                entity.UserId            = NullHelper.GetInt32FromReader(reader, "UserId");
                                entity.UserName          = NullHelper.GetStringFromReader(reader, "UserName");
                                entity.FirstName         = NullHelper.GetStringFromReader(reader, "FirstName");
                                entity.LastName          = NullHelper.GetStringFromReader(reader, "LastName");
                                entity.ActiveCode        = NullHelper.GetBooleanFromReader(reader, "ActiveCode");
                                entity.ActiveStatus      = NullHelper.GetStringFromReader(reader, "ActiveStatus");
                                entity.Email             = NullHelper.GetStringFromReader(reader, "Email");
                                entity.CreatedDateTime   = NullHelper.GetDateFromReader(reader, "CreatedDateTime", tzOffsetMinutes);
                                entity.CreatedBy         = NullHelper.GetInt32FromReader(reader, "CreatedBy");
                                entity.CreatedByUserName = NullHelper.GetStringFromReader(reader, "CreatedByUserName");

                                entity.UpdatedDateTime = NullHelper.GetDateFromReader(reader, "UpdatedDateTime", tzOffsetMinutes);

                                entity.UpdatedBy         = NullHelper.GetInt32FromReader(reader, "UpdatedBy");
                                entity.UpdatedByUserName = NullHelper.GetStringFromReader(reader, "UpdatedByUserName");
                                entity.FullName          = NullHelper.GetStringFromReader(reader, "FullName");

                                resultEntity.Add(entity);
                            }
                        }
                    }
                }
            }

            return(resultEntity);
        }
コード例 #19
0
 internal static PixelFormat ComputeShaderResourceFormatFromDepthFormat(PixelFormat format)
 {
     NullHelper.ToImplement();
     return(format);
 }
コード例 #20
0
        public static List <RoleEntity> GetRoles(string env, int?tzOffsetMinutes, bool?active, int?userId)
        {
            var resultEntity = new List <RoleEntity>();

            var connectionString = ConfigurationManager.ConnectionStrings[env].ConnectionString;

            using (var connection = new SqlConnection(connectionString))
            {
                using (var command = new SqlCommand("[GetRoles]")
                {
                    CommandType = CommandType.StoredProcedure, Connection = connection
                })
                {
                    // =====================================================================================================
                    // Add Parameters
                    // =====================================================================================================

                    if (userId != null)
                    {
                        var param_UserId = new SqlParameter("@UserId", userId)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.Int,
                        };
                        command.Parameters.Add(param_UserId);
                    }

                    if (active != null)
                    {
                        var param_Active = new SqlParameter("@Active", active)
                        {
                            Direction = ParameterDirection.Input,
                            SqlDbType = System.Data.SqlDbType.Bit,
                        };
                        command.Parameters.Add(param_Active);
                    }


                    connection.Open();
                    using (SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection))
                    {
                        if (reader != null)
                        {
                            while (reader.Read())
                            {
                                var entity = new RoleEntity();

                                entity.RoleId          = NullHelper.GetInt32FromReader(reader, "RoleId");
                                entity.RoleName        = NullHelper.GetStringFromReader(reader, "RoleName");
                                entity.Active          = NullHelper.GetBooleanFromReader(reader, "Active");
                                entity.ActiveStatus    = NullHelper.GetStringFromReader(reader, "ActiveStatus");
                                entity.CreatedDateTime = NullHelper.GetDateFromReader(reader, "CreatedDateTime", tzOffsetMinutes);
                                entity.CreatedBy       = NullHelper.GetInt32FromReaderNullable(reader, "CreatedBy");

                                resultEntity.Add(entity);
                            }
                        }
                    }
                }
            }

            return(resultEntity);
        }
コード例 #21
0
        /// <summary>
        /// This method returns the Next Card from the top of the 'Deck'.
        /// </summary>
        public Card PullNextCard(bool remove = true, bool ignoreShuffle = false, bool ignoreException = false)
        {
            // initial value
            Card nextCard = null;

            // If the RandomIntStorage object exists
            if (ListHelper.HasOneOrMoreItems(this.RandomCardStorage))
            {
                // if ignreShuffle is false and the ShuffleOptions exist and have one or more shuffles required
                if ((!ignoreShuffle) && (this.HasShuffleOptions) && (this.ShuffleOptions.HasBeforeItemIsPulledShuffles))
                {
                    // Shuffle the deck
                    this.Shuffle(this.ShuffleOptions.BeforeItemIsPulledShuffles);
                }

                // pull out the next Card off the top of the deck
                nextCard = this.RandomCardStorage[0];

                // if the value for remove is true
                if (remove)
                {
                    // Remove the Card that was just pulled
                    this.RandomCardStorage.RemoveAt(0);
                }
            }
            else if (!this.HasRandomCardStorage)
            {
                // if the value for ignoreException is false
                if (!ignoreException)
                {
                    // raise an exception
                    throw new Exception("The 'RandomCardStorage' property is not set in the 'PullNextCard' method.");
                }
            }
            else
            {
                // if the value for ignoreException is false
                if (!ignoreException)
                {
                    // raise an exception
                    throw new Exception("The 'RandomCardStorage' property is empty in the 'PullNextItem' method.");
                }
            }

            // If the nextCard object exists
            if (NullHelper.Exists(nextCard))
            {
                // Uncomment this to send a report to the console
                // LogReport(nextCard);

                // if ignreShuffle is false and the ShuffleOptions exist and have one or more shuffles required
                if ((!ignoreShuffle) && (this.HasShuffleOptions) && (this.ShuffleOptions.HasAfterItemIsPulledShuffles))
                {
                    // Shuffle the deck
                    this.Shuffle(this.ShuffleOptions.AfterItemIsPulledShuffles);
                }
            }

            // return value
            return(nextCard);
        }
コード例 #22
0
        /// <summary>
        /// This method returns true if the button given should be enabled
        /// </summary>
        /// <param name="button"></param>
        /// <returns></returns>
        public bool IsButtonEnabled(Button button)
        {
            // initial value
            bool isButtonEnabled = false;

            // If the button object exists
            if (NullHelper.Exists(button))
            {
                // determine the result by the name of the button
                switch (button.Text)
                {
                case "New Project":

                    // Set the return value
                    isButtonEnabled = EnableNewProject;

                    // required
                    break;

                case "Open Project":

                    // Set the return value
                    isButtonEnabled = EnableOpenProject;

                    // required
                    break;

                case "Edit Project":

                    // Set the return value
                    isButtonEnabled = EnableEditProject;

                    // required
                    break;

                case "Close Project":

                    // Set the return value
                    isButtonEnabled = EnableCloseProject;

                    // required
                    break;

                case "Build All":

                    // Set the return value
                    isButtonEnabled = EnableBuiildAll;

                    // required
                    break;

                case "Manage Data":

                    // Set to true
                    isButtonEnabled = true;

                    // required
                    break;

                default:

                    if ((button.Name.StartsWith("ViewPDF")) || (button.Name.StartsWith("ViewWord")))
                    {
                        // Set to true
                        isButtonEnabled = true;
                    }

                    // required
                    break;
                }
            }

            // return value
            return(isButtonEnabled);
        }
コード例 #23
0
 /// <summary>
 /// Initializes new instance of <see cref="DescriptorPool"/> that can handle the various
 /// <see cref="DescriptorTypeCount"/> from <param name="counts"/> for <param name="graphicsDevice"/>.
 /// </summary>
 /// <param name="graphicsDevice">The graphics device.</param>
 /// <param name="counts">Various Type and corresponding count for descriptors that this instance will handle.</param>
 private DescriptorPool(GraphicsDevice graphicsDevice, DescriptorTypeCount[] counts) : base(graphicsDevice)
 {
     NullHelper.ToImplement();
 }
コード例 #24
0
        public ActionResult Edit(int?projectId, int?siteId)
        {
            ViewBag.PId = projectId;
            ViewBag.SId = siteId;

            var procProjectId = db.ProcProject.FirstOrDefault(x => x.Id == projectId && x.ProjectSiteId == siteId);

            ViewBag.ProcProjectId = procProjectId.Id;

            ViewBag.ProcProjectIdEditForm = procProjectId.ProjectSite.Project.Name;



            ViewBag.ProjectId = new SelectList(db.Project, "Id", "Name");
            ViewBag.SiteId    = new SelectList(db.ProjectSite, "Id", "Name");



            ViewBag.ItemName = new SelectList(db.Item, "Id", "Name");
            ViewBag.Unit     = new SelectList(db.Unit, "Id", "Name");

            var projectTypeStatus = new SelectList(new List <SelectListItem> {
                new SelectListItem {
                    Text = "Government", Value = "Government"
                }, new SelectListItem {
                    Text = "Non-Government", Value = "Non-Government"
                },
            }, "Value", "Text");

            ViewBag.ProjectType = projectTypeStatus;

            ViewBag.PrManId = new SelectList(db.CompanyResource, "Id", "Name");
            ViewBag.StEngId = new SelectList(db.CompanyResource, "Id", "Name");

            var projectIdFinder = db.ProjectSite.SingleOrDefault(x => x.Id == siteId);

            var projects = db.Project.SingleOrDefault(x => x.Id == projectIdFinder.ProjectId);

            ViewBag.StartDate = NullHelper.DateToString(projects.StartDate);
            ViewBag.EndDate   = NullHelper.DateToString(projects.EndDate);

            var procProjects = db.ProcProject.SingleOrDefault(x => x.Id == projectId && x.ProjectSiteId == siteId);

            ViewBag.BOQDate = NullHelper.DateToString(procProjects.BOQDate);
            ViewBag.NOADate = NullHelper.DateToString(procProjects.NOADate);
            ViewBag.BOQNo   = NullHelper.ObjectToString(procProjects.BOQNo);
            ViewBag.NOANo   = NullHelper.ObjectToString(procProjects.NOANo);
            //ViewBag.PType = NullHelper.ObjectToString(procProjects.ProjectType);
            var projectType = new SelectList(new List <SelectListItem> {
                new SelectListItem {
                    Text = "Government", Value = "Government"
                },
                new SelectListItem {
                    Text = "Non-Government", Value = "Non-Government"
                },
            }, "Value", "Text", procProjects.ProjectType);

            ViewBag.ProjectType = projectType;
            ViewBag.PStatus     = NullHelper.ObjectToString(procProjects.Status);
            ViewBag.PRemarks    = NullHelper.ObjectToString(procProjects.Remarks);



            var projectRes = db.ProjectResource.SingleOrDefault(x => x.ProjectId == projectIdFinder.ProjectId);

            ViewBag.PrMan = NullHelper.ObjectToString(projectRes.CompanyResource.Name);

            var projectSiteRes = db.ProjectSiteResource.SingleOrDefault(x => x.ProjectSiteId == siteId);

            ViewBag.StEng = NullHelper.ObjectToString(projectSiteRes.CompanyResource.Name);

            VMProjectItem vmProjectItem = new VMProjectItem();

            vmProjectItem.ProcProjectItem = db.ProcProjectItem.Where(x => x.ProcProjectId == projectId /*&& x.ProjectSiteId == siteId*/).ToList();


            if (projectId == null || siteId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            ProcProject     procProject     = db.ProcProject.Where(x => x.Id == projectId && x.ProjectSiteId == siteId).FirstOrDefault();
            Project         project         = db.Project.Where(x => x.Id == projectId).FirstOrDefault();
            ProcProjectItem procProjectItem = db.ProcProjectItem.Where(x => x.ProcProjectId == projectId /*&& x.ProjectSiteId == siteId*/).FirstOrDefault();


            if (procProject == null)
            {
                return(HttpNotFound());
            }

            return(View(vmProjectItem));
        }
コード例 #25
0
 /// <summary>
 /// Recreate the pool.
 /// </summary>
 private void Recreate()
 {
     NullHelper.ToImplement();
 }
コード例 #26
0
 public static bool IsDepthStencilReadOnlySupported(GraphicsDevice device)
 {
     NullHelper.ToImplement();
     return(false);
 }
コード例 #27
0
        // <Summary>
        // This method is used to export a DataRow object to xml.
        // </Summary>
        public string ExportDataRow(DataRow dataRow, int indent = 0)
        {
            // initial value
            string dataRowXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the dataRow object exists
            if (NullHelper.Exists(dataRow))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open dataRow node
                sb.Append("<DataRow>" + Environment.NewLine);

                // Write out each property

                // Write out the value for Changes

                sb.Append(indentString2);
                sb.Append("<Changes>" + dataRow.Changes + "</Changes>" + Environment.NewLine);

                // Write out the value for Delete

                sb.Append(indentString2);
                sb.Append("<Delete>" + dataRow.Delete + "</Delete>" + Environment.NewLine);

                // Write out the value for Fields

                // Create the FieldsWriter
                FieldsWriter fieldsWriter = new FieldsWriter();

                // Export the Fields collection to xml
                string dataFieldXml = fieldsWriter.ExportList(dataRow.Fields, indent + 2);
                sb.Append(dataFieldXml);
                sb.Append(Environment.NewLine);

                // Write out the value for Index

                sb.Append(indentString2);
                sb.Append("<Index>" + dataRow.Index + "</Index>" + Environment.NewLine);

                // Write out the value for ParentTable

                sb.Append(indentString2);
                sb.Append("<ParentTable>" + dataRow.ParentTable + "</ParentTable>" + Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close dataRow node
                sb.Append("</DataRow>" + Environment.NewLine);

                // set the return value
                dataRowXml = sb.ToString();
            }
            // return value
            return(dataRowXml);
        }
コード例 #28
0
 internal void SwapInternal(Texture other)
 {
     NullHelper.ToImplement();
 }
コード例 #29
0
        // <Summary>
        // This method is used to export a StoredProcedure object to xml.
        // </Summary>
        public string ExportStoredProcedure(StoredProcedure storedProcedure, int indent = 0)
        {
            // initial value
            string storedProcedureXml = "";

            // locals
            string indentString  = TextHelper.Indent(indent);
            string indentString2 = TextHelper.Indent(indent + 2);

            // If the storedProcedure object exists
            if (NullHelper.Exists(storedProcedure))
            {
                // Create a StringBuilder
                StringBuilder sb = new StringBuilder();

                // Append the indentString
                sb.Append(indentString);

                // Write the open storedProcedure node
                sb.Append("<StoredProcedure>" + Environment.NewLine);

                // Write out each property

                // Write out the value for DoesNotHaveParameters

                sb.Append(indentString2);
                sb.Append("<DoesNotHaveParameters>" + storedProcedure.DoesNotHaveParameters + "</DoesNotHaveParameters>" + Environment.NewLine);

                // Write out the value for Parameters

                // Create the ParametersWriter
                ParametersWriter parametersWriter = new ParametersWriter();

                // Export the Parameters collection to xml
                string storedProcedureParameterXml = parametersWriter.ExportList(storedProcedure.Parameters, indent + 2);
                sb.Append(storedProcedureParameterXml);
                sb.Append(Environment.NewLine);

                // Write out the value for ProcedureName

                sb.Append(indentString2);
                sb.Append("<ProcedureName>" + storedProcedure.ProcedureName + "</ProcedureName>" + Environment.NewLine);

                // Write out the value for ReturnSetSchema

                // Create the ReturnSetSchemaWriter
                ReturnSetSchemaWriter returnSetSchemaWriter = new ReturnSetSchemaWriter();

                // Export the ReturnSetSchemas collection to xml
                string dataFieldXml = returnSetSchemaWriter.ExportList(storedProcedure.ReturnSetSchema, indent + 2);
                sb.Append(dataFieldXml);
                sb.Append(Environment.NewLine);

                // Write out the value for StoredProcedureType

                sb.Append(indentString2);
                sb.Append("<StoredProcedureType>" + storedProcedure.StoredProcedureType + "</StoredProcedureType>" + Environment.NewLine);

                // Write out the value for Text

                // I accidently overwrote this line making the video:
                // The xml has to be formatted if the procedure text contains any greater than or less than symbos or ampersands:
                string encodedText = XmlPatternHelper.Encode(storedProcedure.Text);

                sb.Append(indentString2);
                sb.Append("<Text>" + encodedText + "</Text>" + Environment.NewLine);

                // Append the indentString
                sb.Append(indentString);

                // Write out the close storedProcedure node
                sb.Append("</StoredProcedure>" + Environment.NewLine);

                // set the return value
                storedProcedureXml = sb.ToString();
            }
            // return value
            return(storedProcedureXml);
        }
コード例 #30
0
ファイル: DescriptorSet.Null.cs プロジェクト: vvvv/stride
 /// <summary>
 /// Sets an unordered access view descriptor.
 /// </summary>
 /// <param name="slot">The slot.</param>
 /// <param name="unorderedAccessView">The unordered access view.</param>
 public void SetUnorderedAccessView(int slot, GraphicsResource unorderedAccessView)
 {
     NullHelper.ToImplement();
 }