示例#1
0
        private void labelReturnClick(object sender, EventArgs e)
        {
            this.Visible = false;
            FormEmployReturn frm = new FormEmployReturn(mainform, id);

            frm.Owner = this;
            frm.Show();
            frm.Activate();
        }
示例#2
0
        private void buttonPayClick(object sender, EventArgs e)
        {
            if (textBoxWanttMoney.Text == "0")
            {
                oracleConnection1.Open();
                int    fiveM   = int.Parse(textBox5M.Text);
                int    oneM    = int.Parse(textBoxM.Text);
                int    fiveT   = int.Parse(textBox5T.Text);
                int    oneT    = int.Parse(textBoxT.Text);
                int    fiveH   = int.Parse(textBox5H.Text);
                int    oneH    = int.Parse(textBoxH.Text);
                int    fiveTen = int.Parse(textBox5Ten.Text);
                int    oneTen  = int.Parse(textBoxTen.Text);
                string day     = DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day;
                oracleCommand1.CommandText = "insert into return values('" + consuID + "','" + itemID + "','" + cateID + "','" + employID + "',to_date('" + day + "','YYYY-MM-DD')," + fiveM + "," + oneM + "," + fiveT + "," + oneT + "," + fiveH + "," + oneH + "," + fiveTen + "," + oneTen + "," + stoStock + ")";
                oracleCommand1.ExecuteNonQuery();

                MessageBox.Show("반납이 완료 되었습니다.");
                oracleConnection1.Close();


                stockTableAdapter1.Fill(dataSet11.STOCK);
                stockTable = dataSet11.Tables["stock"];

                string    str       = "sto_stock='" + stoStock + "' AND item_id='" + itemID + "'";
                DataRow[] mydataRow = stockTable.Select(str);
                foreach (DataRow mydata in mydataRow)
                {
                    mydata["sto_num"] = (int.Parse(mydata["sto_num"].ToString()) + 1).ToString();
                }
                consumerTableAdapter1.Fill(dataSet11.CONSUMER);
                consumerTable = dataSet11.Tables["consumer"];
                string    str2      = "consu_id='" + consuID + "'";
                DataRow[] foundrows = consumerTable.Select(str2);

                foreach (DataRow mydataRow2 in foundrows)
                {
                    int a = int.Parse(mydataRow2["consu_mileage"].ToString());
                    int b = int.Parse(textBoxMile.Text);

                    mydataRow2["consu_mileage"] = ((a - b) + jukmileage).ToString();
                    oracleConnection1.Open();
                    oracleCommand1.CommandText = "insert into mileage values('" + consuID + "','" + jukmileage + "',to_date('" + day + "','YYYY-MM-DD'))";
                    oracleCommand1.ExecuteNonQuery();
                    oracleConnection1.Close();
                }
                consumerTableAdapter1.Update(dataSet11.CONSUMER);
                stockTableAdapter1.Update(dataSet11.STOCK);
                returnForm.F5(consuID, itemID);
                this.Visible = false;
                returnForm.Activate();
            }
            else//돈내야하는데 안냄
            {
                MessageBox.Show("돈을 지불하여 주십시오");
            }
        }