Beispiel #1
0
        public void OnAdd(object sender, EventArgs e)
        {
            string      theCarid     = this.carid.Text;
            int         theCarYear   = int.Parse(this.carYear.Text);
            bool        theAvaliable = Convert.ToBoolean(this.avaliable.Text);
            bool        theInsurance = Convert.ToBoolean(this.avaliable.Text);
            bool        theYearCheck = Convert.ToBoolean(this.avaliable.Text);
            datacontrol a            = (datacontrol)Session["database"];

            a.insert(theCarid, theCarYear, theAvaliable, theInsurance, theYearCheck);
            Response.Write("<script>alert('添加完成');</script>");
        }
Beispiel #2
0
        public void OnSelect(object sender, EventArgs e)
        {
            String Year;

            myStrat = int.Parse(this.startYear.Text);
            Year    = this.endYear.Text;
            useYear = int.Parse(Year);
            datacontrol a        = (datacontrol)Session["database"];
            GridViewRow row      = carGrid.SelectedRow;
            String      driverid = ((Driver)Session["driver"]).driverid;

            a.insert(row.Cells[1].Text, driverid, myStrat, useYear, false, true);
        }
Beispiel #3
0
    protected void OnAddContract(object sender, EventArgs e)
    {
        Driver      a     = (Driver)Session["driver"];
        datacontrol b     = (datacontrol)Session["database"];
        String      id    = carid.Text;
        int         start = int.Parse(startText.Text);
        int         end   = int.Parse(endText.Text);

        if (!b.isCarContract(id, start, end))
        {
            System.Windows.Forms.MessageBox.Show("car not free");
            return;
        }
        if (!b.isDriverContract(a.driverid, start, end))
        {
            System.Windows.Forms.MessageBox.Show("driver not free");
            return;
        }
        else
        {
            System.Windows.Forms.MessageBox.Show("success");
        }
        b.insert(carid.Text, a.driverid, start, end, false, true);
    }
Beispiel #4
0
    static void Main(String[] argv)
    {
        datacontrol a = new datacontrol("D:\\asd");

        a.insert("H12345", 2013, true, true, true);
        a.insert("C12345", 2013, true, true, true);
        a.insert("J12345", 2013, false, true, true);
        a.insert("G12345", 2011, true, true, true);
        a.insert("M123", "123", true, "Amy", "19950125", "1234");
        a.insert("M456", "456", false, "Tom", "19941212", "5678");
        a.insert("M789", "789", false, "kitty", "19941212", "0789");
        a.insert("H12345", "M123", 20101020, 20151020, true, true);
        a.insert("G12345", "M456", 20121020, 20151020, false, true);
        a.insert("H12345", "M123", 20151020, 20171020, false, true);
        a.insert("G12345", "M789", 20151020, 20171020, true, true);
        a.insert("J12345", "H12345", 20121010, 20151010, true, true);
    }
Beispiel #5
0
 public static void Main(string[] argvs)
 {
     datacontrol a=new datacontrol("asd.data");
     a.insert("H12345",2013,true,true,true);
     a.insert("C12345",2013,true,true,true);
     a.insert("J12345",2013,false,true,true);
     a.insert("G12345",2011,true,true,true);
     a.insert("M123","123",true,"Amy","19950125","1234");
     a.insert("M456","456",false,"Tom","19941212","5678");
     a.insert("M789","789",false,"kitty","19941212","0789");
     a.insert("H12345","M123",20101020,20151020,true,true);
     a.insert("G12345","M456",20121020,20151020,false,true);
     a.insert("H12345","M123",20151020,20171020,false,true);
     a.insert("G12345","M789",20151020,20171020,true,true);
     a.avaliableCar(2020);
     a.insert("J12345","H12345",20121010,20151010,true,true);
     Console.Read();
 }
Beispiel #6
0
    public static void Main(string[] argvs)
    {
        datacontrol a = new datacontrol("asd.data");

        a.insert("H12345", 2013, true, true, true);
        a.insert("C12345", 2013, true, true, true);
        a.insert("J12345", 2013, false, true, true);
        a.insert("G12345", 2011, true, true, true);
        a.insert("M123", "123", true, "Amy", "19950125", "1234");
        a.insert("M456", "456", false, "Tom", "19941212", "5678");
        a.insert("M789", "789", false, "kitty", "19941212", "0789");
        a.insert("H12345", "M123", 20101020, 20151020, true, true);
        a.insert("G12345", "M456", 20121020, 20151020, false, true);
        a.insert("H12345", "M123", 20151020, 20171020, false, true);
        a.insert("G12345", "M789", 20151020, 20171020, true, true);
        a.avaliableCar(2020);
        a.insert("J12345", "H12345", 20121010, 20151010, true, true);
        Console.Read();
    }