Ejemplo n.º 1
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder, List <BodyObject> requestBody)
 {
     try
     {
         ProviderDAL providerDAL = new ProviderDAL();
         DataTable   dt          = providerDAL.GetDataPaging("spGetBookPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         books       = dt.AsEnumerable().Select(row => new Book()
         {
             Id              = (int)row["id"],
             BookCode        = (string)row["bookcode"],
             BookName        = (string)row["bookname"],
             Inventory       = (int)row["inventory"],
             Author          = (string)row["author"],
             MainContent     = (string)row["maincontent"],
             Description     = (string)row["description"],
             BookCategory_Id = (int)row["bookcategory_id"],
             IsActive        = (bool)row["isactive"],
             Image           = (string)row["image"]
         }).ToList();
         return(books);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from BookDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 2
0
        public string ModifyProvider(Provider provider)
        {
            ProviderDAL providerdal = new ProviderDAL();


            return(providerdal.ModifyProvider(provider));
        }
Ejemplo n.º 3
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder)
 {
     try
     {
         ProviderDAL providerDAL = new ProviderDAL();
         DataTable   dt          = providerDAL.GetDataPaging("spGetStudentPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         students    = dt.AsEnumerable().Select(row => new Student()
         {
             Id          = (int)row["id"],
             StudentCode = (string)row["studentcode"],
             StudentName = (string)row["studentname"],
             Class       = (string)row["class"],
             DoB         = (DateTime)row["dob"],
             NativeLand  = (string)row["nativeland"],
             Course      = (string)row["course"],
             Faculty     = (string)row["faculty"],
             Description = (string)row["description"],
             IsActive    = (bool)row["isactive"]
         }).ToList();
         return(students);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from StudentDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 4
0
        public string DeleteProvider(long code)
        {
            ProviderDAL providerdal = new ProviderDAL();


            return(providerdal.DeleteProvider(code));
        }
Ejemplo n.º 5
0
    public bool ChangePassword(ProviderDTO provider, string NewPassword)
    {
        int result = 0;

        providerdal = new ProviderDAL();
        result      = providerdal.ChangePassword(provider, NewPassword);

        if (result > 0)
        {
            return(true);
        }
        return(false);
    }
Ejemplo n.º 6
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder)
 {
     try
     {
         ProviderDAL providerDAL = new ProviderDAL();
         DataTable   dt          = providerDAL.GetDataPaging("spGetUserPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         users       = dt.AsEnumerable().Select(row => new User()
         {
             Id          = (int)row["id"],
             Username    = (string)row["username"],
             Description = (string)row["description"],
             IsActive    = (bool)row["isactive"]
         }).ToList();
         return(users);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from UserDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 7
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder)
 {
     try
     {
         ProviderDAL providerDAL = new ProviderDAL();
         DataTable   dt          = providerDAL.GetDataPaging("spGetPostPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         posts       = dt.AsEnumerable().Select(row => new Post()
         {
             Id          = (int)row["id"],
             CodePost    = (string)row["codepost"],
             Message     = (string)row["message"],
             Description = (string)row["description"],
             IsActive    = (bool)row["isactive"],
         }).ToList();
         return(posts);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from PostDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 8
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder)
 {
     try
     {
         ProviderDAL providerDAL    = new ProviderDAL();
         DataTable   dt             = providerDAL.GetDataPaging("spGetBookCategoryPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         bookCategories = dt.AsEnumerable().Select(row => new BookCategory()
         {
             Id = (int)row["id"],
             BookCategoryCode = (string)row["bookcategorycode"],
             BookCategoryName = (string)row["bookcategoryname"],
             Description      = (string)row["description"],
             IsActive         = (bool)row["isactive"],
         }).ToList();
         return(bookCategories);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from BookCategoryDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 9
0
 public IEnumerable <Object> GetAllPaging(int pageIndex, int pageSize, string sortColumn, int sortOrder, List <BodyObject> requestBody)
 {
     try
     {
         ProviderDAL providerDAL = new ProviderDAL();
         DataTable   dt          = providerDAL.GetDataPaging("spGetBorrowBookPaging", pageIndex, pageSize, sortColumn, sortOrder);
         var         borrowBooks = dt.AsEnumerable().Select(row => new BorrowBook()
         {
             Id                = (int)row["id"],
             BorrowBookCode    = (string)row["borrowbookcode"],
             BorrowDate        = (DateTime)row["borrowdate"],
             NumberOfDayBorrow = (int)row["numberofdayborrow"],
             Description       = (string)row["description"],
             Student_Id        = (int)row["student_id"],
             IsReturn          = (bool)row["isreturn"]
         }).ToList();
         return(borrowBooks);
     }
     catch (Exception ex)
     {
         throw new Exception("Error from borrowBookDAL: " + ex.Message.ToString());
     }
 }
Ejemplo n.º 10
0
        public List <Provider> ExtractAllProviders()
        {
            ProviderDAL providerdal = new ProviderDAL();

            return(providerdal.ExtractAllProviders());
        }
Ejemplo n.º 11
0
        public Provider Extractprovider(string provider)
        {
            ProviderDAL providerdal = new ProviderDAL();

            return(providerdal.Extractprovider(provider));
        }
Ejemplo n.º 12
0
        public string InsertProvider(Provider provider)
        {
            ProviderDAL providerdal = new ProviderDAL();

            return(providerdal.InsertProvider(provider));
        }
Ejemplo n.º 13
0
        public Provider ExtractById(long?code)
        {
            ProviderDAL provider = new ProviderDAL();

            return(provider.ExtractById(code));
        }
Ejemplo n.º 14
0
        public Provider ExtractproviderByID(long code)
        {
            ProviderDAL providerdal = new ProviderDAL();

            return(providerdal.ExtractById(code));
        }
Ejemplo n.º 15
0
 public int UpdateProvider(ProviderDTO Provider)
 {
     providerdal = new ProviderDAL();
     return(providerdal.UpdateProvider(Provider));
 }
Ejemplo n.º 16
0
 public long AuthenticateUser(ProviderDTO provider)
 {
     providerdal = new ProviderDAL();
     return(providerdal.AuthenticateUser(provider));
 }
Ejemplo n.º 17
0
 public int UpdateProviderIntroducation(ProviderDTO Provider)
 {
     providerdal = new ProviderDAL();
     return(providerdal.UpdateProviderIntroducation(Provider));
 }
Ejemplo n.º 18
0
 public ProviderDTO GetProviderPassword(long providerid)
 {
     providerdal = new ProviderDAL();
     return(providerdal.GetProviderPassword(providerid));
 }
Ejemplo n.º 19
0
 public Stream GetProviderImage(long providerid)
 {
     providerdal = new ProviderDAL();
     return(providerdal.GetProviderImage(providerid));
 }
Ejemplo n.º 20
0
 public ProviderDTO GetProviderContactById(long ProviderId)
 {
     providerdal = new ProviderDAL();
     return(providerdal.GetProviderContactById(ProviderId));
 }
Ejemplo n.º 21
0
 public long UpdateProviderContact(ProviderDTO Provider)
 {
     providerdal = new ProviderDAL();
     return(providerdal.UpdateProviderContact(Provider));
 }
Ejemplo n.º 22
0
 public List <ProviderDTO> SelectAllProvider(int PageNo, int PageSize)
 {
     providerdal = new ProviderDAL();
     return(providerdal.SelectAllProvider(PageNo, PageSize));
 }
Ejemplo n.º 23
0
 public long InsertProvider(ProviderDTO Provider)
 {
     providerdal = new ProviderDAL();
     return(providerdal.InsertProvider(Provider));
 }
Ejemplo n.º 24
0
 public void AddProviderImage(long providerid, byte[] imagename)
 {
     providerdal = new ProviderDAL();
     providerdal.AddProviderImage(providerid, imagename);
 }
Ejemplo n.º 25
0
 public ProviderDTO GetProviderIntroductionById(long ProviderId)
 {
     providerdal = new ProviderDAL();
     return(providerdal.GetProviderIntroductionById(ProviderId));
 }