hello guys.. I'm mega in Indonesia. sorry for my english so bad.. I have script like :
private void btnDelete_Click(object sender, EventArgs e)
{
if (idx != -1)
{
int yy = Int32.Parse(txtTotal1.Text);
int ap = yy - Convert.ToInt16(arTotal[idx].ToString());
txtTotal1.Text = ap.ToString();
arId.RemoveAt(idx);
arNama.RemoveAt(idx);
arHarga.RemoveAt(idx);
arBanyak.RemoveAt(idx);
arTotal.RemoveAt(idx);
}
listView1.Items.Clear();
for (int i = 0; i < this.arId.Count; i++)
{
listView1.Items.Add(new ListViewItem(new string[] { arId[i].ToString(), arNama[i].ToString(), arHarga[i].ToString(), arBanyak[i].ToString(), arTotal[i].ToString() }));
}
}
{
if (idx != -1)
{
int yy = Int32.Parse(txtTotal1.Text);
int ap = yy - Convert.ToInt16(arTotal[idx].ToString());
txtTotal1.Text = ap.ToString();
arId.RemoveAt(idx);
arNama.RemoveAt(idx);
arHarga.RemoveAt(idx);
arBanyak.RemoveAt(idx);
arTotal.RemoveAt(idx);
}
listView1.Items.Clear();
for (int i = 0; i < this.arId.Count; i++)
{
listView1.Items.Add(new ListViewItem(new string[] { arId[i].ToString(), arNama[i].ToString(), arHarga[i].ToString(), arBanyak[i].ToString(), arTotal[i].ToString() }));
}
}
but error in "int ap = yy - Convert.ToInt16(arTotal[idx].ToString());" can you help me ?
Upendra Pratap ShahiPosted Jun 26, 2015, 4:38 AM
Mega SaraswatiPosted Jun 26, 2015, 4:03 AM
Upendra Pratap ShahiPosted Jun 26, 2015, 3:59 AM
Mega SaraswatiPosted Jun 26, 2015, 3:54 AM
Pankaj Kumar ChoudharyPosted Jun 26, 2015, 3:14 AM
Mega SaraswatiPosted Jun 25, 2015, 11:56 PM
Pankaj Kumar ChoudharyPosted Jun 25, 2015, 11:44 PM
{
if condition will not execute
Mega SaraswatiPosted Jun 25, 2015, 11:15 PM
Pankaj Kumar ChoudharyPosted Jun 25, 2015, 11:13 PM