Exemple #1
0
        public prison_mst GetPrisonById(string ma_dang_ky)
        {
            prison_mst prison = (from prisoner in _dbcontext.prison_mst
                                 where prisoner.ma_dang_ky == ma_dang_ky
                                 select prisoner).SingleOrDefault();

            return(prison);
        }
Exemple #2
0
        public void Delete(string ma_dang_ky)
        {
            var x = new prison_mst {
                ma_dang_ky = ma_dang_ky
            };

            _dbcontext.prison_mst.Attach(x);
            _dbcontext.prison_mst.Remove(x);
            _dbcontext.SaveChanges();
        }
Exemple #3
0
        public string GetIcrementCodeForDummy()
        {
            prison_mst list = (from prison in _dbcontext.prison_mst
                               where prison.ma_trai_giam == "0VLB0002"
                               orderby prison.ngay_tao descending
                               select prison).FirstOrDefault();

            string incrementCode = (Int32.Parse(list.ma_dang_ky.Substring(4, 4)) + 1).ToString();

            return(incrementCode);
        }
Exemple #4
0
 public void Update(prison_mst updObj)
 {
     _dbcontext.prison_mst.Attach(updObj);
     _dbcontext.Entry(updObj).State = System.Data.Entity.EntityState.Modified;
     _dbcontext.SaveChanges();
 }
Exemple #5
0
 public void Add(prison_mst addObj)
 {
     _dbcontext.prison_mst.Add(addObj);
     _dbcontext.SaveChanges();
 }