Пример #1
0
        public BACSI ChuSoHuu(TAIKHOAN a)
        {
            BACSI ans = new BACSI();

            BACSIFactory BACSIService = new BACSIFactory();

            ans = BACSIService.GetAllEntities().ToList()
                  .Where(p => p.TAIKHOANID == a.ID)
                  .FirstOrDefault();

            return(ans);
        }
Пример #2
0
        public int LoaiTaiKhoan(TAIKHOAN a)
        {
            // 0: tài khoản tự do
            // 1: tài khoản sở hữu
            BACSIFactory BACSIService = new BACSIFactory();
            int          soluong      = BACSIService.GetAllEntities().ToList()
                                        .Where(p => p.TAIKHOANID == a.ID)
                                        .ToList()
                                        .Count;

            if (soluong == 0)
            {
                return(0);
            }
            return(1);
        }
Пример #3
0
        /// <summary>
        /// delete by primary key
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>true for succesfully deleted</returns>
        public bool Delete(TAIKHOANKeys keys)
        {
            BACSIFactory BACSIService = new BACSIFactory();

            try
            {
                BACSI bacsi = BACSIService.GetAllEntities().ToList()
                              .Where(p => p.TAIKHOANID == keys.ID)
                              .FirstOrDefault();
                bacsi.TAIKHOANID = null;
                BACSIService.Update(bacsi);
            }
            catch
            {
            }
            return(_dataObject.Delete(keys));
        }