Click here to Skip to main content
15,898,036 members
Home / Discussions / C#
   

C#

 
GeneralRe: Clean code in C# development Pin
OriginalGriff11-Jun-23 8:32
mveOriginalGriff11-Jun-23 8:32 
GeneralRe: Clean code in C# development Pin
trønderen11-Jun-23 11:20
trønderen11-Jun-23 11:20 
QuestionGetting Google Contacts Pin
Kevin Marois6-Jun-23 16:46
professionalKevin Marois6-Jun-23 16:46 
AnswerRe: Getting Google Contacts Pin
OriginalGriff6-Jun-23 18:47
mveOriginalGriff6-Jun-23 18:47 
GeneralRe: Getting Google Contacts Pin
Kevin Marois7-Jun-23 5:51
professionalKevin Marois7-Jun-23 5:51 
AnswerRe: Getting Google Contacts Pin
Richard MacCutchan6-Jun-23 22:02
mveRichard MacCutchan6-Jun-23 22:02 
GeneralRe: Getting Google Contacts Pin
jschell7-Jun-23 5:19
jschell7-Jun-23 5:19 
GeneralRe: Getting Google Contacts Pin
Richard MacCutchan7-Jun-23 5:42
mveRichard MacCutchan7-Jun-23 5:42 
GeneralRe: Getting Google Contacts Pin
Kevin Marois7-Jun-23 5:53
professionalKevin Marois7-Jun-23 5:53 
GeneralRe: Getting Google Contacts Pin
Richard MacCutchan7-Jun-23 6:09
mveRichard MacCutchan7-Jun-23 6:09 
GeneralRe: Getting Google Contacts Pin
Kevin Marois7-Jun-23 7:00
professionalKevin Marois7-Jun-23 7:00 
GeneralRe: Getting Google Contacts Pin
jschell8-Jun-23 6:53
jschell8-Jun-23 6:53 
GeneralRe: Getting Google Contacts Pin
Richard MacCutchan8-Jun-23 8:01
mveRichard MacCutchan8-Jun-23 8:01 
AnswerRe: Getting Google Contacts Pin
OriginalGriff6-Jun-23 23:33
mveOriginalGriff6-Jun-23 23:33 
AnswerRe: Getting Google Contacts Pin
Gerry Schmitz7-Jun-23 3:24
mveGerry Schmitz7-Jun-23 3:24 
QuestionProcess.Start() Default Browser and Detect Close Pin
Kevin Marois6-Jun-23 13:46
professionalKevin Marois6-Jun-23 13:46 
AnswerRe: Process.Start() Default Browser and Detect Close Pin
Richard Andrew x646-Jun-23 14:56
professionalRichard Andrew x646-Jun-23 14:56 
GeneralRe: Process.Start() Default Browser and Detect Close Pin
Kevin Marois6-Jun-23 17:07
professionalKevin Marois6-Jun-23 17:07 
AnswerRe: Process.Start() Default Browser and Detect Close Pin
Richard Deeming6-Jun-23 21:46
mveRichard Deeming6-Jun-23 21:46 
AnswerRe: Process.Start() Default Browser and Detect Close Pin
jschell7-Jun-23 5:23
jschell7-Jun-23 5:23 
QuestionI've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Vượng Phát Nội thất4-Jun-23 16:37
Vượng Phát Nội thất4-Jun-23 16:37 
AnswerRe: I've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Pete O'Hanlon4-Jun-23 21:13
mvePete O'Hanlon4-Jun-23 21:13 
GeneralRe: I've fumbled and bumbled my way though being able to read an rtsp stream, I've learned how to capture frames and Pin
Richard Deeming4-Jun-23 21:42
mveRichard Deeming4-Jun-23 21:42 
QuestionSaving Data from a dynamically created form Pin
Member 136122631-Jun-23 11:41
Member 136122631-Jun-23 11:41 
Here are the constraints that I am facing

Can only use SQL Server
Cannot use Entity Framework or Dapper
Can only use .NET Framework (can't use any Python or JS)
What I am working on is a project for a factory I work for is that I am digitizing our quality inspections, of which there are numerous. The first step is that I created some models to that are used to create a Quality Inspection plan, which are here below:

C#
public class QualityInspection
{
   public int Id;
   public string Name;
   public double Frequency;
   public List<InspectionSection> Sections;
}

public class InspectionSection
{
   public int Id;
   public int InspectionId;
   public string Name;
   public List<InspectionPoint> Points;
}

public class InspectionPoint
{
   public int Id;
   public int SectionId;
   public string Name;
   public List<NonConformance> InspectionResults;
}

public class NonConformance
{
   public int Id;
   public string Name;
   public List<NonConformanceLevel> Level;
}

public enum NonConformanceLevel
{
   None,
   Minor,
   Major
}


This is an example of a dummy inspections plan:

C#
QualityInspection inspection = new QualityInspection()
{
    Id = 1,
    Name = "FgInspection",
    Frequency = 2,
    Sections.AddRange(new[]
        {
            new InspectionSection() {
                Id = 1,
                InspectionId = 1,
                Name = "Packaging",
                Points.AddRange(new[]
                    {
                        new InspectionPoint()
                        {
                            Id = 1,
                            SectionId = 1,
                            Name = "Seals",
                            InspectionResults.AddRange(new[]
                                {
                                    new NonConformance() {Id = 1, Name = "Torn", Level = NonConformanceLevel.Minor},
                                    new NonConformance() {Id = 2, Name = "None", Level = NonConformanceLevel.None})
                                });
                        },
                        new InspectionPoint()
                        {
                            Id = 2,
                            SectionId = 1,
                            Name = "Dates",
                            InspectionResults.AddRange(new[]
                                {
                                    new NonConformance() {Id = 3, Name = "Smudged", Level = NonConformanceLevel.Minor},
                                    new NonConformance() {Id = 4, Name = "None", Level = NonConformanceLevel.None})
                                });
                        }
                    });
                }
            }),
        });
};

To clarify, saving this inspection is NOT THE ISSUE. This is able to be saved to a SQL table without a problem.

Let's use the "Packaging" section as an example here. The user pulls up this Inspection to fill out. The page displays Two dropdowns: one for "Seals" Inspection Point and one for "Dates" Inspection Point. The "Seals" dropdown displays the two NonConformances as options to select. The user hits a Submit button to submit the choices for the dropdown.

This is where I run into a problem. This Inspection Plan is created by a USER in a different portion of the app. As such, I don't have a table so save the "Seals" or "Dates" data, because the user created those fields when they created the inspection plan. In essence I am trying to save the RESULTS of an a user created inspection plan.
AnswerRe: Saving Data from a dynamically created form Pin
Gerry Schmitz1-Jun-23 16:21
mveGerry Schmitz1-Jun-23 16:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.