public void loadForm() { ClearFields(); firstLoad = true; using (var db = new WTCCeresEntities()) { { var withBlock = cboRateTier; withBlock.DataSource = CompanyRateTypeService.GetAllCustomerRateType(db); withBlock.DisplayMember = "RateCode"; withBlock.ValueMember = "CustomerRateTypeId"; } cblCompanyType.DataSource = null; { var withBlock1 = cblCompanyType; withBlock1.DataSource = CompanyTypeService.GetAll(db); withBlock1.DisplayMember = "DescCompanyType"; withBlock1.ValueMember = "CompanyTypeId"; } { var withBlock2 = cboCompanyCategory; withBlock2.DataSource = CompanyCategoryService.GetAll(db); withBlock2.DisplayMember = "Category"; withBlock2.ValueMember = "CompanyCategoryId"; } cboRateTier.SelectedValue = 0; } cboCompanyCategory.SelectedValue = 1; isCustomer = true; firstLoad = false; }
public async Task <ResponceModel> GetAll([FromQuery(Name = "text")] string text, [FromQuery(Name = "page")] int page = 1, [FromQuery(Name = "offset")] int offset = 20) { try { var companyTypes = await companyTypeService.GetAll(text, page, offset); return(new ResponceModel(200, "OK", companyTypes, null)); } catch (Exception ex) { await _logService.Add(new SystemLog() { Content = ex.Message, CreateDate = DateTime.Now, UserId = 0, EntityName = companyTypeService.GetType().Name }); return(new ResponceModel(500, "ERROR", null, new string[] { "Şirketler getirilirken bir hata oluştu." })); } }