Md Nayeem

Md Nayeem

  • NA
  • 75
  • 24k

I want to make another Electronic Products Information Row

Mar 31 2017 2:55 PM

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;

  6. namespace SalesInformationApp
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {

  12. Program s = new Program();
  13. List InfoList = s.GetSales();
  14. Console.WriteLine("---------------Sales Information-----------------");
  15. Console.WriteLine("------------Computer ProductsInformation-----------");
  16. Console.WriteLine("SID\tPID\tPName\tCustomerName\tUprice\tNopro\tTPrice");
  17. foreach (SalesInfo pr in InfoList)
  18. {
  19. Console.WriteLine(pr.SID.ToString() + "\t"+ pr.PID.ToString()+"\t" + pr.PName + "\t" +pr.CustomerName+"\t"+pr.UPrice+"\t"+pr.Nopro+"\t"+pr.TPrice) ;
  20. }


  21. Console.ReadKey();



  22. }

  23. public List GetSales()
  24. {
  25. List InfoList = new List();
  26. //----------------------------------Computer--------------------------------------
  27. SalesInfo a = new SalesInfo();
  28. a.SID = 1;
  29. a.PID = 1;
  30. a.PName = "Mouse";
  31. a.CustomerName = "Md.Belal";
  32. a.UPrice = 300.00M;
  33. a.Nopro = 2;
  34. a.TPrice = 600;
  35. InfoList.Add(a);




  36. SalesInfo b = new SalesInfo();
  37. b.SID = 2;
  38. b.PID = 2;
  39. b.PName = "Monitor";
  40. b.CustomerName = "Md.Helal";
  41. b.UPrice = 5000.00M;
  42. b.Nopro = 3;
  43. b.TPrice = 15000;
  44. InfoList.Add(b);




  45. SalesInfo c = new SalesInfo();
  46. c.SID = 3;
  47. c.PID = 3;
  48. c.PName = "Ram";
  49. c.CustomerName = "Md.Rasel";
  50. c.UPrice = 1500.00M;
  51. c.Nopro = 3;
  52. c.TPrice = 4500;
  53. InfoList.Add(c);





  54. SalesInfo d= new SalesInfo();
  55. d.SID = 4;
  56. d.PID = 4;
  57. d.PName = "Scanner";
  58. d.CustomerName = "Md.Kabir";
  59. d.UPrice = 3000.00M;
  60. d.Nopro = 2;
  61. d.TPrice = 6000;
  62. InfoList.Add(d);

  63. SalesInfo e = new SalesInfo();
  64. e.SID = 5;
  65. e.PID = 5;
  66. e.PName = "Battery";
  67. e.CustomerName = "Md.Robiul";
  68. e.UPrice = 6000.00M;
  69. e.Nopro = 10;
  70. e.TPrice = 60000;
  71. InfoList.Add(e);



  72. SalesInfo f = new SalesInfo();
  73. f.SID = 6;
  74. f.PID = 6;
  75. f.PName = "UPS";
  76. f.CustomerName = "Md.Badol";
  77. f.UPrice = 9000.00M;
  78. f.Nopro = 10;
  79. f.TPrice = 90000;
  80. InfoList.Add(f);


  81. SalesInfo g = new SalesInfo();
  82. g.SID = 7;
  83. g.PID = 7;
  84. g.PName = "Mpad";
  85. g.CustomerName = "Md.Karib";
  86. g.UPrice = 150.00M;
  87. g.Nopro = 5;
  88. g.TPrice = 750;
  89. InfoList.Add(g);




  90. SalesInfo h = new SalesInfo();
  91. h.SID = 8;
  92. h.PID = 8;
  93. h.PName = "Cdesk";
  94. h.CustomerName = "Md.Kader";
  95. h.UPrice = 2000.00M;
  96. h.Nopro = 5;
  97. h.TPrice = 10000;
  98. InfoList.Add(h);







  99. return InfoList;

  100. }

  101. }

  102. ///
  103. ///
  104. ///
  105. public class SalesInfo
  106. {
  107. public int SID { get; set; }
  108. public int PID { get; set; }
  109. public string PName { get; set; }
  110. public string CustomerName { get; set; }
  111. public decimal UPrice { get; set; }
  112. public decimal Nopro { get; set; }
  113. public decimal TPrice { get; set; }
  114. }
  115. }
I want to make another Electronic Products Information Row In this Project.Now how can i write Program For ThisElectronic Products Information Row.First Computer Products information Data Row Will show then I want to show Electronic Products Information DataRow.

Answers (1)