using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BAI1_SQL
{
public partial class danhsachthethao : Form
{
public danhsachthethao()
{
InitializeComponent();
}
//
this.lstdanhsach.Items.Add("Bóng đá");
this.lstdanhsach.Items.Add("Bóng bàn");
this.lstdanhsach.Items.Add("Cầu lông");
this.lstdanhsach.Items.Add("Bóng bầu dục");
}
try
{
int count = lstdanhsach.Items.Count;
for (int i = 0; i < count; i++)
{
lstdanhsach.SelectedIndex = 0;
lstdachon.Items.Add(lstdanhsach.SelectedItem.ToString());
lstdanhsach.Items.Remove(lstdanhsach.SelectedItem.ToString());
}
}
catch(Exception)
{
MessageBox.Show("Bạn chưa chọn item?", "Thông báo");
}
}
private void btnchuyenindex_Click(object sender, EventArgs e)
{
try
{
int n = lstdanhsach.SelectedIndex;
string item = lstdanhsach.Items[n].ToString();
lstdachon.Items.Add(item);
lstdanhsach.Items.Remove(item);
}
catch(Exception)
{
MessageBox.Show("Bạn chưa chọn item?", "Thông báo");
}
}
}
}
}
namespace BAI1_SQL
{
public partial class daysotinhtong : Form
{
public daysotinhtong()
{
InitializeComponent();
}
private void daysotinhtong_Load(object sender, EventArgs e)
{
}
int tongchan = 0;
int tongle = 0;
int tongday = 0;
private void btnnhap_Click(object sender, EventArgs e)
{
int x = Convert.ToInt32(txtnhapso.Text);
txtdayso.Text += x.ToString().Trim()+" ";
tongday += x;
txttongso.Text = tongday.ToString();
if(x%2==0)
{
tongchan += x;
txttongchan.Text = tongchan.ToString();
}
else
{
tongle += x;
txttongle.Text = tongle.ToString();
}
CÔNG TY DU LỊCH