ax1234
سه شنبه 16 اردیبهشت 1393, 15:20 عصر
سلام دوستان میشه کدهای زیرو برام توضیح بدین( مثلا اینکه هر خط کد چیکار می کنه؟)
try
{
if (PH.GetCount(txtBarcode.Text)-int.Parse(txtcount.Text) > 0)
{
string forush;
string kharid;
string sood;
//dar in soorat karbar ghablan dar system sabt shode
if (Takhfif != 0)
{
float darsad = Convert.ToSingle(Convert.ToSingle(Takhfif) / Convert.ToSingle(100));
//MessageBox.Show(darsad);
float takhfifDarsad = Convert.ToSingle(int.Parse(PH.GetPriceForush(txtBa rcode.Text)) * int.Parse(txtcount.Text)) * darsad;
forush = ((int.Parse(PH.GetPriceForush(txtBarcode.Text)) * int.Parse(txtcount.Text)) - takhfifDarsad).ToString();
kharid = (int.Parse(txtcount.Text) * int.Parse((PH.GetPriceKharid(txtBarcode.Text)))).T oString();
sood = (int.Parse(forush) - int.Parse(kharid)).ToString();
O = new Order(Initializer.CashierId, CustomerId, PH.GetId(txtBarcode.Text).ToString(), int.Parse(txtcount.Text), forush,
sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text,cmbPayType.Text,false);
//MessageBox.Show(PH.GetPrice(txtBarcode.Text));
//MessageBox.Show("darsade takhfif : " + takhfifDarsad + "forush : " + O.SumForush + " , Kharid : " + kharid + " , sood : " + sood);
}
else
{
CustomerId = 0;
forush = ((int.Parse(PH.GetPriceForush(txtBarcode.Text)) * int.Parse(txtcount.Text))).ToString();
kharid = (int.Parse(txtcount.Text) * int.Parse((PH.GetPriceKharid(txtBarcode.Text)))).T oString();
sood = (int.Parse(forush) - int.Parse(kharid)).ToString();
O = new Order(Initializer.CashierId, CustomerId, PH.GetId(txtBarcode.Text).ToString(), int.Parse(txtcount.Text), forush,
sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text, cmbPayType.Text, false);
//MessageBox.Show("forush : " + O.SumForush + " , Kharid : " + kharid + " , sood : " + sood);
}
O = new Order(Initializer.CashierId, CustomerId, txtBarcode.Text, int.Parse(txtcount.Text), forush, sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text, cmbPayType.Text, false);
if (OH.Insert(O))
{
//az counte mahsool kam mishavad
PH.MinuseCount(txtBarcode.Text, int.Parse(txtcount.Text));
dataGridView1.DataSource = OH.ShowAll(CustomerId,int.Parse( cmbToYear.Text),int.Parse( cmbToMonth.Text),int.Parse( cmbToDay.Text));
}
}
else
{
MessageBox.Show("از این محصول به در فروشگاه به تعداد خواسته شده وجود ندارد");
}
lblCount.Text = PH.GetCount(txtBarcode.Text).ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
------------------------------------------------------------
{
try
{
for (int i = 1390; i < 1500; i++)
{
cmbToYear.Items.Add(i.ToString());
}
cmbToDay.SelectedIndex = 1;
cmbToMonth.SelectedIndex = 1;
cmbToYear.SelectedIndex = 1;
cmbPayType.SelectedIndex = 1;
// dgCustomer.DataSource = CH.ShowAllSP();
}
catch (Exception ex)
{
MessageBox.Show("خطای سیستم : " + ex.Message);
}
}
-------------------------------------------------------------
try
{
double forush = 0.0;
double kharid = 0.0;
double sood = 0.0;
double daramad = 0.0;
dataGridView1.DataSource = RH.PrintAllOrder(int.Parse(cmbFromYear.Text), int.Parse(cmbToYear.Text), int.Parse(cmbFromMonth.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbFromDay.Text), int.Parse(cmbToDay.Text));
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
forush += double.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString());
sood += double.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString());
}
kharid = forush - sood;
daramad = forush;
//lblForush.Text = forush.ToString();
lblKharid.Text = kharid.ToString();
lblSood.Text = sood.ToString();
lblDaramad.Text = daramad.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
try
{
if (PH.GetCount(txtBarcode.Text)-int.Parse(txtcount.Text) > 0)
{
string forush;
string kharid;
string sood;
//dar in soorat karbar ghablan dar system sabt shode
if (Takhfif != 0)
{
float darsad = Convert.ToSingle(Convert.ToSingle(Takhfif) / Convert.ToSingle(100));
//MessageBox.Show(darsad);
float takhfifDarsad = Convert.ToSingle(int.Parse(PH.GetPriceForush(txtBa rcode.Text)) * int.Parse(txtcount.Text)) * darsad;
forush = ((int.Parse(PH.GetPriceForush(txtBarcode.Text)) * int.Parse(txtcount.Text)) - takhfifDarsad).ToString();
kharid = (int.Parse(txtcount.Text) * int.Parse((PH.GetPriceKharid(txtBarcode.Text)))).T oString();
sood = (int.Parse(forush) - int.Parse(kharid)).ToString();
O = new Order(Initializer.CashierId, CustomerId, PH.GetId(txtBarcode.Text).ToString(), int.Parse(txtcount.Text), forush,
sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text,cmbPayType.Text,false);
//MessageBox.Show(PH.GetPrice(txtBarcode.Text));
//MessageBox.Show("darsade takhfif : " + takhfifDarsad + "forush : " + O.SumForush + " , Kharid : " + kharid + " , sood : " + sood);
}
else
{
CustomerId = 0;
forush = ((int.Parse(PH.GetPriceForush(txtBarcode.Text)) * int.Parse(txtcount.Text))).ToString();
kharid = (int.Parse(txtcount.Text) * int.Parse((PH.GetPriceKharid(txtBarcode.Text)))).T oString();
sood = (int.Parse(forush) - int.Parse(kharid)).ToString();
O = new Order(Initializer.CashierId, CustomerId, PH.GetId(txtBarcode.Text).ToString(), int.Parse(txtcount.Text), forush,
sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text, cmbPayType.Text, false);
//MessageBox.Show("forush : " + O.SumForush + " , Kharid : " + kharid + " , sood : " + sood);
}
O = new Order(Initializer.CashierId, CustomerId, txtBarcode.Text, int.Parse(txtcount.Text), forush, sood, int.Parse(cmbToYear.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbToDay.Text), txtDesc.Text, cmbPayType.Text, false);
if (OH.Insert(O))
{
//az counte mahsool kam mishavad
PH.MinuseCount(txtBarcode.Text, int.Parse(txtcount.Text));
dataGridView1.DataSource = OH.ShowAll(CustomerId,int.Parse( cmbToYear.Text),int.Parse( cmbToMonth.Text),int.Parse( cmbToDay.Text));
}
}
else
{
MessageBox.Show("از این محصول به در فروشگاه به تعداد خواسته شده وجود ندارد");
}
lblCount.Text = PH.GetCount(txtBarcode.Text).ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
------------------------------------------------------------
{
try
{
for (int i = 1390; i < 1500; i++)
{
cmbToYear.Items.Add(i.ToString());
}
cmbToDay.SelectedIndex = 1;
cmbToMonth.SelectedIndex = 1;
cmbToYear.SelectedIndex = 1;
cmbPayType.SelectedIndex = 1;
// dgCustomer.DataSource = CH.ShowAllSP();
}
catch (Exception ex)
{
MessageBox.Show("خطای سیستم : " + ex.Message);
}
}
-------------------------------------------------------------
try
{
double forush = 0.0;
double kharid = 0.0;
double sood = 0.0;
double daramad = 0.0;
dataGridView1.DataSource = RH.PrintAllOrder(int.Parse(cmbFromYear.Text), int.Parse(cmbToYear.Text), int.Parse(cmbFromMonth.Text), int.Parse(cmbToMonth.Text), int.Parse(cmbFromDay.Text), int.Parse(cmbToDay.Text));
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
forush += double.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString());
sood += double.Parse(dataGridView1.Rows[i].Cells[3].Value.ToString());
}
kharid = forush - sood;
daramad = forush;
//lblForush.Text = forush.ToString();
lblKharid.Text = kharid.ToString();
lblSood.Text = sood.ToString();
lblDaramad.Text = daramad.ToString();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}