예제 #1
0
파일: Form1.cs 프로젝트: trase8/kurs
    private void gdg_handler1(object sender, EventArgs e) {

        for (int i = 0; i < f.Controls.Count; i++){
            if (f.Controls[i].Tag == "dish") {
                f.Controls[i].Visible = false;
            }
        }

        sender_parser sp = new sender_parser();
        db_adapter db = new db_adapter();
        DataTable dt = new DataTable();
        dt = db.get_dishtype();
        string name_sender = sp.parse(sender.ToString());
        int sender_id = -1;
        for (int i = 0; i < dt.Rows.Count; i++) {
            if (dt.Rows[i].Field<string>("name") == name_sender) {
                sender_id = dt.Rows[i].Field<int>("id");
            } 
        }
        if (sender_id != -1) generate_dishes(sender_id);
    }
예제 #2
0
파일: Form1.cs 프로젝트: trase8/kurs
    private void gd_handler1(object sender, EventArgs e) {
        sender_parser sp = new sender_parser();
        db_adapter db = new db_adapter();
        DataTable dt = new DataTable();
        int order_id = 0;
        string name_sender = sp.parse(sender.ToString());
        dt = db.get_dish();
        int sender_id = -1;
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i].Field<string>("name") == name_sender)
            {
                sender_id = dt.Rows[i].Field<int>("id");
            }
        }
        dt = db.get_dish_by_id(sender_id);

        os.orders.Last().check.quantity++;
        os.orders.Last().check.total_cost += dt.Rows[0].Field<int>("cost");
        os.orders.Last().check.add_dish(sender_id);
        os.orders.Last().id = order_id;
        order_id++;

        this.f.Controls[3].Text += "\n";
        this.f.Controls[3].Text += dt.Rows[0].Field<string>("name");
        this.f.Controls[0].Text = os.orders.Last().check.total_cost.ToString();

        this.f.Controls[2].Text += "\n";
        this.f.Controls[2].Text += dt.Rows[0].Field<int>("cost");
        this.f.Controls[0].Text = os.orders.Last().check.total_cost.ToString();

    }
예제 #3
0
파일: Form1.cs 프로젝트: trase8/kurs
    private void ov_handler1(object sender, EventArgs e) { 
        sender_parser sp = new sender_parser();
        string ss = sp.parse(sender.ToString());
        ss = sp.get_digit(ss);
        int order_number = Convert.ToInt32(ss);

        int waiter = this.os.orders[order_number].waiter_id;
        int table = this.os.orders[order_number].table.number;
        int client = 0;
        //if (this.os.orders[order_number].client.id != 0)  client = this.os.orders[order_number].client.id;
        int total_price = this.os.orders[order_number].check.total_cost;

        this.os.orders[order_number] = null;

        db_adapter db = new db_adapter();
        db.send_order(waiter, table, client, total_price);
        orders_view();
    }