Notes
Notes - notes.io |
{
}
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
{
}
protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
{
}
protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
{
}
protected void RadioButton4_CheckedChanged(object sender, EventArgs e)
{
hesapla(4,"PortakalSuyu");
}
private void hesapla(int fiyat, string icecek)
{
int adet;
int toplam = 0;
if(TextBox1.Text.Trim().Length > 0 && int.TryParse(TextBox1.Text,out adet))
{
toplam = adet * fiyat;
Label2.Text=String.Format("{0},{1},{2}",adet,toplam,icecek);
}
}
}
}
//DESTİNASYON
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication5
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string[] destinasyon = new string[0];
int[] katilimci = new int[0];
int[] sayi = new int[0];
ViewState.Add("DESTİNASYON", destinasyon);
ViewState.Add("KATILIMCI", katilimci);
ViewState.Add("SAYI", sayi);
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string[] destinasyon = (string[])ViewState["DESTİNASYON"];
int[] katilimci = (int[])ViewState["KATILIMCI"];
int[] sayi = (int[])ViewState["SAYI"];
int uzunluk = destinasyon.Length;
Array.Resize(ref destinasyon, uzunluk + 1);
Array.Resize(ref katilimci, uzunluk + 1);
Array.Resize(ref sayi, uzunluk + 1);
int yeniSonIndis = destinasyon.Length - 1;
destinasyon[yeniSonIndis] = TextBox1.Text;
katilimci[yeniSonIndis] = int.Parse(TextBox2.Text);
sayi[yeniSonIndis] = int.Parse(TextBox3.Text);
ViewState["DESTİNASYON"] = destinasyon;
ViewState["KATILIMCI"] = katilimci;
ViewState["SAYI"] = sayi;
double ort = (double)katilimci.Sum() / sayi.Sum();
Label1.Text = String.Format("Toplam Katılımcı {0}</br>Ortalama Katılımcı {1:N2}</br>Son Destinasyon {2}", katilimci.Sum(), ort, destinasyon[yeniSonIndis]);
}
}
}
//HAVA KARA DENİZ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void OrtakDinleyici(object sender, EventArgs e)
{
hesapla();
}
private void hesapla()
{
if (secimYapildiMi() && sayiGirildiMi())
{
double carpan = carpanBul();
double hacim = hacimBul();
double fiyat = hacim * carpan / 100;
Label1.Text = String.Format("Toplam Tutar {0}", fiyat);
}
else
{
Label1.Text = "Bir ulaşım yolu seçilmeli ve boyutların tamamı sayı olarak girilmelidir.";
}
}
private bool secimYapildiMi()
{
if (karaRB.Checked || havaRB.Checked || denizRB.Checked)
{
return true;
}
else
{
return false;
}
}
private bool sayiGirildiMi()
{
double a, b, c;
bool g = double.TryParse(genislikTB.Text, out a);
bool u = double.TryParse(uzunlukTB.Text, out b);
bool y = double.TryParse(yukseklikTB.Text, out c);
if (g && u && y)
return true;
else
return false;
}
private double carpanBul()
{
double carpan;
if (karaRB.Checked)
{
carpan = 5.5;
}
else if (havaRB.Checked)
{
carpan = 10;
}
else
{
carpan = 1; ;
}
return carpan;
}
private double hacimBul()
{
double genislik = double.Parse(genislikTB.Text);
double uzunluk = double.Parse(uzunlukTB.Text);
double yukseklik = double.Parse(yukseklikTB.Text);
double hacim = genislik * uzunluk * yukseklik;
return hacim;
}
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team