دوستان این برنامرو نوشتم ولی انگار مشکل داره کسی می تونه درستش کنه؟ برای پروژه می خوام .ممنون
مشکل من اینه که اگه عدد های تکست باکس کامل پر نشن مثلا اگه 3 تا از تکست باکسای اول مربوط به زمان پردازش و سود پردازش فقط پر بشن مشکل شکل زیر بوجود میاد که سود ها رو قاطی نشون میده و زمان اجرا هارو جدا!!! کسی میتونه درستش کنه ؟
لینک دانلود
واقعا که !!! خودم حلش کردم :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace time_schedule
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int[] sod = new int[10];
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
// sod////////////////////////////////
if (textBox11.Text != "")
sod[0] = Convert.ToInt32(textBox11.Text);
if (textBox12.Text != "")
sod[1] = Convert.ToInt32(textBox12.Text);
if (textBox13.Text != "")
sod[2] = Convert.ToInt32(textBox13.Text);
if (textBox14.Text != "")
sod[3] = Convert.ToInt32(textBox14.Text);
if (textBox15.Text != "")
sod[4] = Convert.ToInt32(textBox15.Text);
if (textBox16.Text != "")
sod[5] = Convert.ToInt32(textBox16.Text);
if (textBox17.Text != "")
sod[6] = Convert.ToInt32(textBox17.Text);
if (textBox18.Text != "")
sod[7] = Convert.ToInt32(textBox18.Text);
if (textBox19.Text != "")
sod[8] = Convert.ToInt32(textBox19.Text);
if (textBox20.Text != "")
sod[9] = Convert.ToInt32(textBox20.Text);
///////////////////////////////////////////////////////////
///////// moratab sazi sod/////////////////////////////////
int temp1;
for (int i = 9; i > 0; i--)
{
for (int j = 0; j < i; j++)
{
if (sod[j] < sod[j + 1])
{
temp1 = sod[j];
sod[j] = sod[j + 1];
sod[j + 1] = temp1;
}
}
}
/////////////////////////////////////////////////////////
for (int i = 0; i <= 9; i++)
{
if (sod[i].ToString() == textBox11.Text && textBox1.Text!="" && textBox11.Text !="")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox1.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox12.Text && textBox2.Text != "" && textBox12.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox2.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox13.Text && textBox3.Text != "" && textBox13.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox3.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox14.Text && textBox4.Text != "" && textBox14.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox4.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox15.Text && textBox5.Text != "" && textBox15.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox5.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox16.Text && textBox6.Text != "" && textBox16.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox6.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox17.Text && textBox7.Text != "" && textBox17.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox7.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox18.Text && textBox8.Text != "" && textBox18.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox8.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox19.Text && textBox9.Text != "" && textBox19.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox9.Text + " sood " + sod[i]);
//
else if (sod[i].ToString() == textBox20.Text && textBox10.Text != "" && textBox20.Text != "")
listBox1.Items.Add("Job" + (i + 1) + " " + textBox10.Text + " sood " + sod[i]);
}
////// 0 kardan arrye//////////
for (int i = 0; i <= 9; i++)
sod[i] = 0;
//////////////////////////////
}
}
}