Example #1
0
        public List <SupplierType> GetSupplierType(string lang)
        {
            UserQuery userQuery = new UserQuery(language);

            System.Data.DataTable dataTable;



            SupplierType type;

            dataTable = conn_db.ReadTable(userQuery.GetMasterTranslated("suppliertype", lang));

            List <SupplierType> workshopTypes = new List <SupplierType>();

            if (dataTable.Rows.Count == 0)
            {
                throw new EmptyViewException(language);
            }


            foreach (System.Data.DataRow row in dataTable.Rows)
            {
                type          = new SupplierType();
                type.id       = Convert.ToInt32(row["ID"].ToString());
                type.typeName = row["suppliertype_name"].ToString();
                workshopTypes.Add(type);
            }


            return(workshopTypes);
        }