private void BindSource()
        {
            CompanyProvider provider = new CompanyProvider();

            this.ddl_company.DataSource = provider.GetAll();
            this.ddl_company.DataBind();
        }
Example #2
0
 /// <summary>
 ///  绑定Company信息的数据源
 /// </summary>
 private void BindSource(int start, string name)
 {
     if (name != null)
     {
         Company company = new Company();
         company.Company_name = name;
         CompanyProvider provider = new CompanyProvider();
         DataTable       table    = provider.Select(company, start, this.ListPager1.PageSize);
         this.GridView1.DataSource = table.DefaultView;
         this.GridView1.DataBind();
     }
     else
     {
         CompanyProvider provider = new CompanyProvider();
         DataTable       table    = provider.GetAll(start, this.ListPager1.PageSize);
         this.GridView1.DataSource = table.DefaultView;
         this.GridView1.DataBind();
     }
 }
Example #3
0
 public ResponseModel <List <Company> > GetAll([FromQuery] Pagination request)
 {
     try
     {
         CompanyProvider companyProvider = new CompanyProvider(_context);
         var             lst             = companyProvider.GetAll(request);
         ResponseModel <List <Company> > objResponseModel = new ResponseModel <List <Company> >
         {
             Message        = "Successfully Retrieved",
             StatusCode     = 1,
             ResponseObject = lst
         };
         return(objResponseModel);
     }
     catch (Exception ex)
     {
         ResponseModel <List <Company> > objResponseModel = new ResponseModel <List <Company> >
         {
             Message    = ex.Message,
             StatusCode = 0
         };
         return(objResponseModel);
     }
 }
Example #4
0
 public IActionResult Get()
 {
     return(Ok(CompanyProvider.GetAll()));
 }