Esempio n. 1
0
        public void LoadData()
        {
            ClassDataBase db = new ClassDataBase();
            string        a  = "select id_r, t.name_t,(select t1.name_t from town t1,rout r1, price pr1 where r1.id_end=t1.id_t and pr1.ID_PR=r1.ID_PR and r1.ID_R=r.ID_R ) as end_r,";
            string        b  = "r.DAY_R, strdate_r,enddate_r,DISTANCE_R*pr.PRICE, pr.Price, DISTANCE_R from rout r, town t, price pr where r.id_st = t.id_t and pr.ID_PR=r.ID_PR";
            string        d  = a + b;

            db.Execute <timetable>(ref sp, d, ref r.list1);
        }
Esempio n. 2
0
        public void Search(string a, int forfunction)
        {
            string        command = "select r2.id_r from rout r2, btown bt2, town t2 where  (r2.ID_END=t2.ID_T or (bt2.ID_T=t2.ID_T and bt2.ID_R=r2.ID_R)) and t2.NAME_T like '" + a + "'    group by r2.ID_R";
            ClassDataBase db      = new ClassDataBase();

            db.Execute <Shearch>(ref sp, command, ref r.search1);
            SortDataGrid();
            r.Answear();
            r.search1.Clear();
        }
Esempio n. 3
0
        public void SearchFrom(string a, string data)
        {
            string        command = "select r2.id_r from rout r2, btown bt2, town t2 where  (r2.ID_ST=t2.ID_T or (bt2.ID_T=t2.ID_T and bt2.ID_R=r2.ID_R)) and t2.NAME_T like '" + a + "' and instr(r2.DAY_R,'" + r.dtpm.Value.ToString("ddd") + "')!=0   group by r2.ID_R";
            ClassDataBase db      = new ClassDataBase();

            db.Execute <Shearch>(ref sp, command, ref r.search1);
            SortDataGrid();
            r.Answear();
            r.search1.Clear();
        }
Esempio n. 4
0
        //public void InfaTickat(int counter)
        //{


        //    t.tbfrm.Text = r.list1[counter - 1].str_tw;
        //    t.tbto.Text = r.list1[counter - 1].end_tw;
        //    t.tbdtt.Text = r.list1[counter - 1].date_end;
        //    t.u = counter;
        //   t.id = r.list1[counter - 1].id.ToString();


        //    t.Show();
        //}
        #region
        public void Search(string a, string b)
        {
            string        command1 = "SELECT r.id_r from rout r,town t, btown bt where (r.ID_ST=t.ID_T or (bt.ID_T=t.ID_T and bt.ID_R=r.ID_R))and instr(r.DAY_R,'" + r.dtpm.Value.ToString("ddd") + "')!=0 and t.NAME_T like'" + a + "'and r.ID_R=(select r2.id_r from rout r2, btown bt2, town t2 where";
            string        command2 = "(r2.ID_END=t2.ID_T or (bt2.ID_T=t2.ID_T and bt2.ID_R=r2.ID_R and bt2.ID_BT>=bt.ID_BT)) and t2.NAME_T like '" + b + "'  and r2.ID_R=r.ID_R   group by r2.ID_R) group by r.ID_R";
            string        command  = command1 + command2;
            ClassDataBase db       = new ClassDataBase();

            db.Execute <Shearch>(ref sp, command, ref r.search1);
            SortDataGrid();
            r.Answear();
            r.search1.Clear();
        }
Esempio n. 5
0
        public void LoadDataCB()
        {
            ClassDataBase db = new ClassDataBase();

            db.Execute <towns>(ref sp, "Select id_t,name_t from town", ref r.ttowns);
        }