Click here to Skip to main content
15,901,735 members
Home / Discussions / C#
   

C#

 
GeneralRe: web controls in windows forms Pin
pr1mem0ver30-Jul-23 10:32
pr1mem0ver30-Jul-23 10:32 
GeneralRe: web controls in windows forms Pin
OriginalGriff30-Jul-23 18:29
mveOriginalGriff30-Jul-23 18:29 
AnswerRe: web controls in windows forms Pin
Graeme_Grant19-Aug-23 15:10
mvaGraeme_Grant19-Aug-23 15:10 
QuestionKindly help me i tried to do it for 3 days but i could not solve it. Pin
Hillymalen26-Jul-23 20:18
Hillymalen26-Jul-23 20:18 
AnswerRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 20:26
mveOriginalGriff26-Jul-23 20:26 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
Hillymalen26-Jul-23 20:55
Hillymalen26-Jul-23 20:55 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 21:40
mveOriginalGriff26-Jul-23 21:40 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
Hillymalen26-Jul-23 22:00
Hillymalen26-Jul-23 22:00 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 22:08
mveOriginalGriff26-Jul-23 22:08 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
Hillymalen26-Jul-23 22:13
Hillymalen26-Jul-23 22:13 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
Ralf Meier26-Jul-23 22:35
mveRalf Meier26-Jul-23 22:35 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 22:47
mveOriginalGriff26-Jul-23 22:47 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 22:45
mveOriginalGriff26-Jul-23 22:45 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
Hillymalen26-Jul-23 23:23
Hillymalen26-Jul-23 23:23 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 23:40
mveOriginalGriff26-Jul-23 23:40 
GeneralRe: Kindly help me i tried to do it for 3 days but i could not solve it. Pin
OriginalGriff26-Jul-23 23:47
mveOriginalGriff26-Jul-23 23:47 
Questionc# Pin
Impana D patel24-Jul-23 0:54
Impana D patel24-Jul-23 0:54 
AnswerRe: c# Pin
Richard Deeming24-Jul-23 1:08
mveRichard Deeming24-Jul-23 1:08 
AnswerRe: c# Pin
Richard MacCutchan24-Jul-23 1:33
mveRichard MacCutchan24-Jul-23 1:33 
AnswerRe: c# Pin
OriginalGriff24-Jul-23 1:55
mveOriginalGriff24-Jul-23 1:55 
Questionc# Pin
Impana D patel23-Jul-23 23:46
Impana D patel23-Jul-23 23:46 
AnswerRe: c# Pin
Richard MacCutchan24-Jul-23 0:03
mveRichard MacCutchan24-Jul-23 0:03 
QuestionWhat should be the principles of multilayer software design? Pin
farshad valizade 202323-Jul-23 22:00
farshad valizade 202323-Jul-23 22:00 
hi every body.I am coding with c# .net core and my first app is a multilayer database project.
this app get datat from user input control and add/del/edit on it.
I have made 3 project in my solution:
1 : Datalayer 2:Business Layer 3:View

in my forms I should Join three or four or more table with each other and show in a datagridview to the user.so I have coded all sql query in datalayer with ado.net bcoz it is easy to join table instead of EF.
I put my code here and you please see it and notice me about each layers.(I think in BLL layer I just didn't do anything special)

and In the UI I put all of my code that I think it is not very interesting.

so see it :
DAL :

C#
public static DataTable GetAll()
{
    using DataTable dt = new();
    try
    {
        string query = "
                        select
                            l.LineID,
                            s.SheetID,
                            z.ZoneID,
                            j.JointTypeID,
                            j.JointClassID ,
                            j.PipeClassID ,
                            j.HoldID,
                            l.[LineNo] ,
                            s.Sheet,
                            s.Rev ,
                            s.RevIndex ,
                            z.Unit,
                            z.Area,
                            s.SheetStatus as LineStatus,
                            j.JointID,
                            j.JointNo ,
                            j.JointIndex ,
                            j.JointStatus ,
                            cast(CAST(j.JointSize as decimal(18,2)) as float) as JointSize,
                            j.[Location],
                            j.Spool,
                            jt.JointType,
                            jc.JointClassName as Class,
                            pc.PipeClass,
                            m.MaterialName as Mat,
                            j.Thk
                        from
                        Joint  as j
                        inner join Sheet as s on s.SheetID = j.SheetID and s.VoidDate is null
                        inner join  Line as l on l.LineID=s.LineID
                        left join Zone as z on z.ZoneID = j.ZoneID
                        left join JointType as jt on jt.JointTypeID = j.JointTypeID
                        left join JointClass as jc on jc.JointClassID = j.JointClassID
                        left join PipingClass as pc on pc.PipeClassID = j.PipeClassID
                        left join Material as m on m.MaterialID = pc.MaterialID
                        left join MTO as m1 on m1.SheetID = j.SheetID AND m1.PTNo = Mat1
                        left join MTO as m2 on m2.SheetID = j.SheetID AND m2.PTNo = Mat2
                        ";
        using SqlCommand cmd = new SqlCommand(query, Connection.Conn);
        Connection.Open();
        using SqlDataReader rd = cmd.ExecuteReader();
        dt.Load(rd);

    }
    catch (SqlException ex)
    {
        Error = ex.Message;
    }
    finally
    {
        Connection.Close();
    }
    return dt;
}


BLL:
C#
public static DataTable GetAll()
      {
          return JointDAL.GetAll();
      }


UI:
C#
DG_Joint.DataSource = JointBLL.GetAll();


I put code in dgv contentclick() for show selected rows into textbox above it.
(There is another way like bindingsource for do it but it use only that table but my query joined many tables and it doesn't work.
I don't know if I wrote it explicitly or not, but what I mean by creating this topic is to review the multi-layer program, what codes should be written in each layer.

AnswerRe: What should be the principles of multilayer software design? Pin
Richard Deeming23-Jul-23 23:11
mveRichard Deeming23-Jul-23 23:11 
QuestionMulti-threading Pin
MAW3017-Jul-23 9:52
MAW3017-Jul-23 9:52 

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.