Exemple #1
0
        public int ReManufacure(string id)
        {
            WorkerFileEntities db = new WorkerFileEntities();
            int data = db.HangXes.Where(item => item.Name.Equals(id)).Select(item => item.ID).FirstOrDefault();

            db.Dispose();
            return(data);
        }
Exemple #2
0
        public string GetManufacture(int id)
        {
            WorkerFileEntities db   = new WorkerFileEntities();
            string             data = db.HangXes.Where(item => item.ID.Equals(id)).Select(item => item.Name).FirstOrDefault();

            db.Dispose();
            return(data);
        }
Exemple #3
0
        public ChuXe[] Owners()
        {
            WorkerFileEntities db = new WorkerFileEntities();

            ChuXe[] result = db.ChuXes.ToArray();
            db.Dispose();
            return(result);
        }
Exemple #4
0
        public Xe[] GetBikes()
        {
            WorkerFileEntities db = new WorkerFileEntities();

            Xe[] result = db.Xes.ToArray();
            db.Dispose();
            return(result);
        }
Exemple #5
0
        public HangXe[] GetManufactures()
        {
            WorkerFileEntities db = new WorkerFileEntities();

            HangXe[] result = db.HangXes.ToArray();
            db.Dispose();
            return(result);
        }
Exemple #6
0
        public void thayDoi(string bienSo, string tenXe, int hangXe, DateTime guiXe)
        {
            WorkerFileEntities db = new WorkerFileEntities();
            var soXe = db.Xes.Find(bienSo);

            soXe.Name         = tenXe;
            soXe.Manufacture  = hangXe;
            soXe.Time_Parking = guiXe;
            db.SaveChanges();
            db.Dispose();
        }
Exemple #7
0
        public void AddBikes(string bienSo, string tenXe, int hangXe, DateTime guiXe)
        {
            WorkerFileEntities db  = new WorkerFileEntities();
            XeDeleted          xed = new XeDeleted();

            xed.License_Plates = bienSo;
            xed.Name           = tenXe;
            xed.Manufacture    = hangXe;
            xed.Time_Parking   = guiXe;
            db.XeDeleteds.Add(xed);
            db.SaveChanges();
            db.Dispose();
        }
Exemple #8
0
        public void AddOwners(string cMND, string hoVaTen, DateTime ngaySinh, string bienSoXe)
        {
            WorkerFileEntities db = new WorkerFileEntities();
            ChuXe chuxe           = new ChuXe();

            chuxe.CMND           = cMND;
            chuxe.Name           = hoVaTen;
            chuxe.Birthday       = ngaySinh;
            chuxe.License_Plates = bienSoXe;
            db.ChuXes.Add(chuxe);
            db.SaveChanges();
            db.Dispose();
        }