Click here to Skip to main content
14,829,981 members
Home / Discussions / C#
   

C#

 
GeneralRe: .Net Core Windows App, using database repositories Pin
jkirkerx7-Sep-20 12:12
professionaljkirkerx7-Sep-20 12:12 
Question.NetCore dependency injection and optional params on assembly scanning Pin
Member 148747204-Sep-20 8:17
MemberMember 148747204-Sep-20 8:17 
AnswerRe: .NetCore dependency injection and optional params on assembly scanning Pin
Richard Deeming6-Sep-20 22:23
mveRichard Deeming6-Sep-20 22:23 
QuestionHow to create a method in a User control Pin
Member 147923934-Sep-20 7:49
MemberMember 147923934-Sep-20 7:49 
AnswerRe: How to create a method in a User control Pin
Mycroft Holmes4-Sep-20 12:08
professionalMycroft Holmes4-Sep-20 12:08 
GeneralRe: How to create a method in a User control Pin
Member 147923935-Sep-20 7:34
MemberMember 147923935-Sep-20 7:34 
AnswerRe: How to create a method in a User control Pin
Ralf Meier4-Sep-20 21:18
professionalRalf Meier4-Sep-20 21:18 
GeneralRe: How to create a method in a User control Pin
Member 147923935-Sep-20 7:33
MemberMember 147923935-Sep-20 7:33 
Hi Ralf and thanks for your interest.
I’m using C# in Visual Studio and this application is in forms. The component I’ve created is composed of a TextBox and a ComboBox.
For example, suppose the main table is Sales and the secondary tables are Client [CodCli(integer, PK), NameCli(string)] and PayForm [CodPay(integer, PK), DescPay(string)].
In the table Sales, suppose the fields are: NumSale (integer, PK), CodCli (FK for Client), CodPay (FK for PayForm), Price and Date.
Suppose there’s a Grid that shows data from the main table and data related to the other tables. See figure below.
(Sorry, but I coudn't post an image. I'm trying and if I can, you'll see it).

So, when in navigating mode, this is what we see. When you click a register in the grid, the fields below are updated to show the corresponding data.
When you click the Create button (+), both fields Cliente and Forma de Recebimento become Comboboxes so you can choose the client and the pay form. Data are retrieved from the corresponding tables (datasource). The other fields become empty. When you click the edit button (pencil), those fields also become comboboxes, but all fields show the data of the grid.
The component I’ve made is working fine for all of this. My problem is: in create or edit mode, when I select the client, it’s necessary to select the pay forms allowed for that client (cash, credit card or others), which are in another relation table, so to fill the second combobox. If it were a simple combobox, it would be easy: use the SelectedIndexChanged event. But, as the combobox is now part of a User control, I don’t know how to do this. If you need any more information, let me know.
Can you help me?
AnswerRe: How to create a method in a User control Pin
Ralf Meier5-Sep-20 12:11
professionalRalf Meier5-Sep-20 12:11 
GeneralRe: How to create a method in a User control Pin
Member 147923935-Sep-20 12:41
MemberMember 147923935-Sep-20 12:41 
AnswerRe: How to create a method in a User control Pin
Ralf Meier6-Sep-20 2:29
professionalRalf Meier6-Sep-20 2:29 
GeneralRe: How to create a method in a User control Pin
Member 147923936-Sep-20 5:37
MemberMember 147923936-Sep-20 5:37 
GeneralRe: How to create a method in a User control Pin
Ralf Meier6-Sep-20 9:34
professionalRalf Meier6-Sep-20 9:34 
GeneralRe: How to create a method in a User control Pin
Member 147923936-Sep-20 16:25
MemberMember 147923936-Sep-20 16:25 
QuestionCannot Create and Return an Instance of a Class Pin
Liagapi3-Sep-20 21:52
MemberLiagapi3-Sep-20 21:52 
AnswerRe: Cannot Create and Return an Instance of a Class Pin
Richard Deeming3-Sep-20 22:05
mveRichard Deeming3-Sep-20 22:05 
GeneralRe: Cannot Create and Return an Instance of a Class Pin
Richard MacCutchan3-Sep-20 22:29
mveRichard MacCutchan3-Sep-20 22:29 
GeneralRe: Cannot Create and Return an Instance of a Class Pin
Richard Deeming4-Sep-20 3:10
mveRichard Deeming4-Sep-20 3:10 
QuestionProper Error handling Pin
Exoskeletor3-Sep-20 12:11
MemberExoskeletor3-Sep-20 12:11 
AnswerRe: Proper Error handling Pin
Gerry Schmitz3-Sep-20 16:30
mveGerry Schmitz3-Sep-20 16:30 
GeneralRe: Proper Error handling Pin
Exoskeletor3-Sep-20 17:48
MemberExoskeletor3-Sep-20 17:48 
AnswerRe: Proper Error handling Pin
GuyThiebaut4-Sep-20 3:08
professionalGuyThiebaut4-Sep-20 3:08 
GeneralRe: Proper Error handling Pin
Exoskeletor4-Sep-20 3:23
MemberExoskeletor4-Sep-20 3:23 
QuestionCsvHelper, converting $0.00 to 0.00 Pin
jkirkerx3-Sep-20 12:08
professionaljkirkerx3-Sep-20 12:08 
AnswerRe: CsvHelper, converting $0.00 to 0.00 Pin
Gerry Schmitz3-Sep-20 12:55
mveGerry Schmitz3-Sep-20 12:55 

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.