public P2(List<String> Resources, int Index, Double Amount) { List<Image> ResourceImg = new List<Image>(); InitializeComponent(); Stream ResourceStream = null; Final.Text = Resources[0]; P1_1Label.Text = Resources[1]; P1_1_RMLabel.Text = Resources[2]; P1_2Label.Text = Resources[3]; P1_2_RMLabel.Text = Resources[4]; for(int i = 0; i < Resources.Count; i++) { try { ResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + Resources[i] + ".png"); ResourceImg.Add(Image.FromStream(ResourceStream, true, true)); } catch (ArgumentException){ResourceImg.Add(null);} } P2Pic.Image = ResourceImg[0]; P1Pic.Image = ResourceImg[1]; P0Pic.Image = ResourceImg[2]; P1_1Pic.Image = ResourceImg[3]; P0_1Pic.Image = ResourceImg[4]; if (Index == 0) { if (Amount % 5 == 0) { double P1, RM; P1 = (Amount / 5) * 40; RM = (P1 / 20) * 3000; FinalAmount.Text = String.Format("{0:n}", Amount) + "u"; P1Amount.Text = String.Format("{0:n}", P1) + "u"; RMAmount.Text = String.Format("{0:n}", RM) + "u"; } else { Popup error = new Popup("Invalid Entry", "The entered value must be a number divisible by 5"); error.Show(); } } if (Index == 1) { double P2, P1, RM; P2 = Math.Truncate(Amount / 1.5); P1 = (P2 / 5) * 40; RM = (P1 / 20) * 3000; FinalAmount.Text = String.Format("{0:n}", P2) + "u"; P1Amount.Text = String.Format("{0:n}", Math.Round(P1, 2)) + "u"; RMAmount.Text = String.Format("{0:n}", Math.Round(RM, 2)) + "u"; } }
public P1(List<String> P1Resources, int Index, Double Amount) { List<Image> ResourceImg = new List<Image>(); InitializeComponent(); Stream ResourceStream = null; Result.Text = P1Resources[0]; RMLabel.Text = P1Resources[1]; for (int i = 0; i < P1Resources.Count; i++) { try { // Pulls the image by the name of the resource stored in list from running assembly. ResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + P1Resources[i] + ".png"); ResourceImg.Add(Image.FromStream(ResourceStream, true, true)); } catch (ArgumentException){ResourceImg.Add(null);} } P1Pic.Image = ResourceImg[0]; P0Pic.Image = ResourceImg[1]; if (Index == 0) { if (Amount % 20 == 0) { double RM; RM = (Amount / 20) * 3000; ResultAmount.Text = Convert.ToString(Amount) + "u"; RMAmount.Text = Convert.ToString(RM) + "u"; } else { Popup error = new Popup("Invalid Entry", "The entered value must be a number divisible by 20"); error.Show(); } } if (Index == 1) { double P1, RM; P1 = Math.Truncate(Amount / 0.38); RM = (P1 / 20) * 3000; ResultAmount.Text = String.Format("{0:n}", P1) + "u"; RMAmount.Text = String.Format("{0:n}", RM) + "u"; } }
public P4_P1(List<String> P4_R1, List <String> P4_R2, List<String>P4_R3, int index, double Amount) { InitializeComponent(); P4_Res1 = new String[P4_R1.Count]; P4_Res2 = new String[P4_R2.Count]; List<Image> P4_R1Imgs = new List<Image>(); List<Image> P4_R2Imgs = new List<Image>(); List<Image> P4_R3Imgs = new List<Image>(); Stream ImgStream = null; for (int i = 0; i < P4_R1.Count; i++) P4_Res1[i] = P4_R1[i]; for (int i = 0; i < P4_R2.Count; i++) P4_Res2[i] = P4_R2[i]; FinalLabel.Text = P4_R1[0]; R1Label.Text = P4_R1[1]; R2Label.Text = P4_R3[1]; R2_P0Label.Text = P4_R3[2]; R3Label.Text = P4_R2[1]; for (int i = 0; i < P4_R1.Count; i++) { try { ImgStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + P4_R1[i] + ".png"); P4_R1Imgs.Add(Image.FromStream(ImgStream, true, true)); } catch (ArgumentException) { P4_R1Imgs.Add(null); } } for (int i = 1; i < P4_R2.Count; i++) { try { ImgStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + P4_R2[i] + ".png"); P4_R2Imgs.Add(Image.FromStream(ImgStream, true, true)); } catch (ArgumentException) { P4_R2Imgs.Add(null); } } for (int i = 1; i < P4_R3.Count; i++) { try { ImgStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + P4_R3[i] + ".png"); P4_R3Imgs.Add(Image.FromStream(ImgStream, true, true)); } catch (ArgumentException) { P4_R3Imgs.Add(null); } } FinalImg.Image = P4_R1Imgs[0]; R1Img.Image = P4_R1Imgs[1]; R1_P2_1Img.Image = P4_R1Imgs[2]; R1_P2_1_P1_1Img.Image = P4_R1Imgs[3]; R1_P2_1_P1_1_RMImg.Image = P4_R1Imgs[4]; R1_P2_1_P1_2Img.Image = P4_R1Imgs[5]; R1_P2_1_P1_2_RMImg.Image = P4_R1Imgs[6]; R1_P2_2Img.Image = P4_R1Imgs[7]; R1_P2_2_P1_1Img.Image = P4_R1Imgs[8]; R1_P2_2_P1_1_RMImg.Image = P4_R1Imgs[9]; R1_P2_2_P1_2Img.Image = P4_R1Imgs[10]; R1_P2_2_P1_2_RMImg.Image = P4_R1Imgs[11]; R2Img.Image = P4_R3Imgs[0]; R2_P0Img.Image = P4_R3Imgs[1]; R3Img.Image = P4_R2Imgs[0]; R3_P2_1Img.Image = P4_R2Imgs[1]; R3_P2_1_P1_1Img.Image = P4_R2Imgs[2]; R3_P2_1_P1_1_RMImg.Image = P4_R2Imgs[3]; R3_P2_1_P1_2Img.Image = P4_R2Imgs[4]; R3_P2_1_P1_2_RMImg.Image = P4_R2Imgs[5]; R3_P2_2Img.Image = P4_R2Imgs[6]; R3_P2_2_P1_1Img.Image = P4_R2Imgs[7]; R3_P2_2_P1_1_RMImg.Image = P4_R2Imgs[8]; R3_P2_2_P1_2Img.Image = P4_R2Imgs[9]; R3_P2_2_P1_2_RMImg.Image = P4_R2Imgs[10]; if (index == 0) { if (Amount % 1 == 0) { double P1, P1_1, P3, P2, RM, RM_1; FinalAmount.Text = String.Format("{0:n}", Amount) + "u"; P3 = (Amount * 6); P2 = (P3 / 3) * 40; P1 = (P2 / 5) * 40; P1_1 = (Amount * 40); RM = (P1 / 20) * 3000; RM_1 = (P1_1 / 20) * 3000; R1Amount.Text = String.Format("{0:n}", P3) + "u"; R2Amount.Text = String.Format("{0:n}", P1_1) + "u"; R3Amount.Text = R1Amount.Text; R1_P2Amount.Text = String.Format("{0:n}", P2) + "u"; R2_P0Amount.Text = String.Format("{0:n}", RM_1) + "u"; R3_P2Amount.Text = R1_P2Amount.Text; R1_P1Amount.Text = String.Format("{0:n}", P1) + "u"; R3_P1Amount.Text = R1_P1Amount.Text; R1_P0Amount.Text = String.Format("{0:n}", RM) + "u"; R3_P0Amount.Text = R1_P0Amount.Text; } else { Popup error = new Popup("Invalid Entry", "The entered value must be a number divisible by 1"); error.Show(); } } else if (index == 1) { double P4, P3, P2, P1, P1_1, RM, RM_1; P4 = Math.Truncate(Amount / 100); P3 = (P4 * 6); P2 = (P3 / 3) * 40; P1 = (P2 / 5) * 40; P1_1 = (P4 * 40); RM = (P1 / 20) * 3000; RM_1 = (P1_1 / 20) * 3000; FinalAmount.Text = String.Format("{0:n}", P4) + "u"; R1Amount.Text = String.Format("{0:n}", P3) + "u"; R2Amount.Text = String.Format("{0:n}", P1_1) + "u"; R3Amount.Text = R1Amount.Text; R1_P2Amount.Text = String.Format("{0:n}", P2) + "u"; R2_P0Amount.Text = String.Format("{0:n}", RM_1) + "u"; R3_P2Amount.Text = R1_P2Amount.Text; R1_P1Amount.Text = String.Format("{0:n}", P1) + "u"; R3_P1Amount.Text = R1_P1Amount.Text; R1_P0Amount.Text = String.Format("{0:n}", RM) + "u"; R3_P0Amount.Text = R1_P0Amount.Text; } }
public P3_3(List<String> RawMaterial, int index, Double Amount) { List<Image> ResourceImg = new List<Image>(); Stream ImgStream = null; InitializeComponent(); FinalLabel.Text = RawMaterial[0]; Resource1Label.Text = RawMaterial[1]; Resource1_P1_1Label.Text = RawMaterial[2]; Resource1_P1_1_RMLabel.Text = RawMaterial[3]; Resource1_P1_2Label.Text = RawMaterial[4]; Resource1_P1_2_RMLabel.Text = RawMaterial[5]; Resource2Label.Text = RawMaterial[6]; Resource2_P1_1Label.Text = RawMaterial[7]; Resource2_P1_1_RMLabel.Text = RawMaterial[8]; Resource2_P1_2Label.Text = RawMaterial[9]; Resource2_P1_2_RMLabel.Text = RawMaterial[10]; Resource3Label.Text = RawMaterial[11]; Resource3_P1_1Label.Text = RawMaterial[12]; Resource3_P1_1_RMLabel.Text = RawMaterial[13]; Resource3_P1_2Label.Text = RawMaterial[14]; Resource3_P1_2_RMLabel.Text = RawMaterial[15]; Arrow1.Image = Properties.Resources._9_64_6; Arrow2.Image = Properties.Resources._9_64_6; Arrow3.Image = Properties.Resources._9_64_6; Arrow4.Image = Properties.Resources._9_64_6; for (int i = 0; i < RawMaterial.Count; i++) { try { ImgStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("EVETool.Resources." + RawMaterial[i] + ".png"); ResourceImg.Add(Image.FromStream(ImgStream, true, true)); } catch (ArgumentException) { ResourceImg.Add(null); } } P3Pic.Image = ResourceImg[0]; P2Pic.Image = ResourceImg[1]; P1Pic.Image = ResourceImg[2]; P0Pic.Image = ResourceImg[3]; P1_1Pic.Image = ResourceImg[4]; P0_1Pic.Image = ResourceImg[5]; P2_1Pic.Image = ResourceImg[6]; P1_2Pic.Image = ResourceImg[7]; P0_2Pic.Image = ResourceImg[8]; P1_3Pic.Image = ResourceImg[9]; P0_3Pic.Image = ResourceImg[10]; P2_2Pic.Image = ResourceImg[11]; P1_4Pic.Image = ResourceImg[12]; P0_4Pic.Image = ResourceImg[13]; P1_5Pic.Image = ResourceImg[14]; P0_5Pic.Image = ResourceImg[15]; if (index == 0) { if (Amount % 3 == 0) { double P2, P1, RM; FinalAmount.Text = String.Format("{0:n}", Amount) + "u"; P2 = (Amount / 3) * 10; P1 = (P2 / 5) * 40; RM = (P1 / 20) * 3000; P2Amount.Text = String.Format("{0:n}", P2) + "u"; P2Box1Amount.Text = P2Amount.Text; P2Box2Amount.Text = P2Amount.Text; P1Amount.Text = String.Format("{0:n}", P1) + "u"; P1_1Amount.Text = P1Amount.Text; P1_2Amount.Text = P1Amount.Text; RMAmount.Text = String.Format("{0:n}", RM) + "u"; RM_1Amount.Text = RMAmount.Text; RM_2Amount.Text = RMAmount.Text; } else { Popup error = new Popup("Invalid Entry", "The entered value must be a number divisible by 3"); error.Show(); } } else if (index == 1) { double P3, P2, P1, RM; P3 = Math.Truncate(Amount / 6); P2 = (P3 / 3) * 10; P1 = (P2 / 5) * 40; RM = (P1 / 20) * 3000; FinalAmount.Text = String.Format("{0:n}", P3) + "u"; P2Amount.Text = String.Format("{0:n}", Math.Round(P2, 2)) + "u"; P2Box1Amount.Text = P2Amount.Text; P2Box2Amount.Text = P2Amount.Text; P1Amount.Text = String.Format("{0:n}", Math.Round(P1, 2)) + "u"; P1_1Amount.Text = P1Amount.Text; P1_2Amount.Text = P1Amount.Text; RMAmount.Text = String.Format("{0:n}", RM) + "u"; RM_1Amount.Text = RMAmount.Text; RM_2Amount.Text = RMAmount.Text; } }