ahmed elbarbary

ahmed elbarbary

  • 636
  • 1.6k
  • 282.1k

How to get English text of label from database based on tab

Dec 21 2018 6:08 PM
I make project in SQL server 2012 asp.net core 2.1 visualstudio2017 and technology i using entity framework core 2.1
 
what I need is to get text of label control from database based on table name and field name from reference table
 
so that i need to make function can be used to get the label text when table fields match what exist on reference file based on table and field name .
 
so that How to do that ?
 
to more explain what i need see this example
 
suppose i have item table and product table
 
Item table have two fields
 
Item Code
Item Name
 
Product table have two fields
 
Product No
Product Name
 
reference table have 5 fields
 
 serial  tablename  fieldname  ArabictextforLabel EnglishtextforLabel 
 1  Item  ItemCode  ??? ?????  ItemCodeVal
 2  Item  ItemName  ??? ?????  ItemNameVal
 3  Product  ProductNo  ??? ??????  ProductNoVal
 4  Product  ProductName  ??? ??????  ProductNameVal
 
so that when go to view Items
 
get text for labeles as (ItemCodeval then display itemnameval) for viewmodels for items
and same thing on product view display label text as ( productnoval and productnameval) for view model Products
 
and when this text for product table and items table changed this will changed on view as dynamically
 
this will make dynamically show text per labels
 
Can this available on asp.net core 2.1 entity framework core 2.1 or not and how to do it if allowed ?

Answers (2)