How to make a product catalog in C#? - c#

I need to develop a product catalog (about 4000 products) application, which would be given to clients on CD or DVD. The catalog exists in webpage format using PHP and MySQL.
IMPORTANT: the application is given to clients who maight have old PC, old System. For minimal requirements I would put Windows XP and Internet Explorer 6 (if needed).
I need the following features:
1 search option (after productID AND after keyword)
2 print option (by selecting multiple products)
3 shopping cart (making a list which will be sent to an email address if there is any Internet Connection on the computer)
When I was asked to do it I had 2 days to realise a very basic version, so I took the whole website and exported it in HTML pages, and developed an application in C# which contains an embeded browser. So the whole website is now static and put on a CD. Everything fine so far. Now here are the problems:
1. the search option was realized by parsing the html files and reading the productID or looking for keywords inside of them. Put on a CD it was extremely slow (searching in 600MB of html files). FOR THIS I WOULD NEED A SOLUTION WITH A STATIC DATABASE (USING ACCESS OR SOMETHING) TO HAVE INDEXED ROWS, SO THE SEARCH COULD BE A VERY FAST ONE.
2. the printing option was a simply call of the embeded Internet Explorer print functions. Here are two problems:
a) user needs IE7 for printing the website scaled (FIT TO PAGE), otherwise the edges of the page are cut down.
b) users of this app does not have even the basic PC usage skills, so they can't set the printing settings, so there will appear in header and footer the page numbers and titles. QUESTION: can I set these settings from CSS for printing?
3. couldn't make a a shopping cart as I don't use a database, so I have static websites and content is inside the HTML.
QUESTION: WHICH ARE THE BEST SOLUTIONS FOR THE PROBLEMS DESCRIBED ABOVE?
PLEASE ANSWER EVEN IF YOUR ANSWER IS FOR ONE QUESTION ONLY. THANKS

If you have existing applications written in PHP / MySQL, maybe it is better to use XAMPP and put the application on a CD than to write new application from scratch.
In this case user doesn't need to install .NET Framework on his computer.
If you must write C# application, convert your MySQL database to xml file and load it into memory on application startup instead of parsing html files.

How about using javascript and cookies/url variables, for passing the shopping cart around? Is javascript enabled in you embedded browser?

I know this is completely different to the direction you're going in, but could you use an Excel spreadsheet instead?
One sheet for the complete catalogue & searching.
One sheet for individual item display/printing.

Related

C# Download a website with the content needed to display it properly

following scenario: We've developed around 400 personal sites and we are currently trying to build our portfolio. Due to multiple reasons we would like to display the index so we can put it on our portfolio. First thought was to make programatically screenshots of every site. The heads in our company promptly debunked it because they want to show it live. Iframes are not an alternative apparently. So we have to download the index. Possibly only with the styles and images needed to display it properly.
I am unsure on how to start doing this.
Do you guys have any ideas?
The underlying technology of CodedUI (and Selenium) uses a web crawler to isolate specific useful parts of a web page. I recommend using that underlying library to crawl your webpages running live, and extract whatever images and divs make up your page structure.
You can then emit these as static HTML to make page snapshots suitable for a site index.
Doing it this way means you will be using the same technology as you use for test automation, but instead of running tests, you can extract the useful structure from your HTML and emit it as a page snapshot. You will have to mark the "useful" parts of your HTML to enable the crawler to extract just the items you think should be indexed (i.e. include a data- property if HTML5). This might be a lot of work - so if you just need a screenshot of each of your pages, just use Selenium or CodedUI to crawl your sites and capture the screen image.

C#: Drupal database access

I am making a C# program that recreates websites in offline mode for use at computers within the company, that are not connected to the internet. These offline websites are identical to their online versions, with all content displayed.
I already have a solution for websites with simple MySQL access, but I need to rewrite the program, so that it can handle Drupal based websites aswell. However, I couldn't figure out how to access Drupal's SQL database, or even what to look for.
The original program uses the website's templates (that are already rewritten in HTML), and places the data mined out of it's database in the templates. Problem is, I don't know where to look for Drupal's templates, or if there aren't any, what data should I gather from it's database.
I use MySQL Connector to reach the database with C#. Should I look for the nodes? If yes, where?
If you want to go down that path you will have to sort of act like Drupal, in order to know which things to read from where. Each module installed has their own tables and functions in a particular way, so not always all the data are nodes with fields.
I you need to work with websites in offline mode, I would suggest using a portable webserver, that way you just copy the website to the root folder and run a script to copy the MySQL database as well, the point being that it's portable, you can carry it around in a flash drive and to run it, you don't need to install anything.
Again, what you want to do is possible, but it will require a tremendous amount of work and you cannot guarantee that things will behave well when you install new modules.
Another approach would be to look into the Boost module, which creates offline, static files based on the request you make to the site, and stores them in a configurable folder.
Another way: build a screenscrapper which reads the HTML from the homepage, and recursively follows the links and modify them before saving the HTML yo your local copy.
Summing it up.. avoid accessing the database yourself and try to read the HTML already rendered.

Using an editor like FckEditor in a form application

I am working on a contract management system on c# form application, one of the main parts of the project is to create a letter.
In this part of the application a user can send a letter with in the shape he or she wants, so I need an editor like FCK in html, because my users should be able to insert table insert image and etc.
Any idea how to get this working? Any concerns?
You could indeed use a HTML WYSIWYG editor, but depending on the quality of it, it might raise problems when converting the output of it to print. This may also depend on the framework used to generate the Word document.
In one of our environments, we use CKEditor and JasperReports. That combination is suitable to export to Word, since JasperReports supports reading HTML and convert that to Word.
However, the best solution may depend on your business requirements and personal preferences.
If the application is a business application, another option is to let them edit the document in Word. Our company (disclaimer: I am biased) has build a product that supports editing a Word document from a template loaded and filled from a database (or multiple databases). However, if it is useful to you depends on your business requirements.
FCK is history now and as mentioned by others CKEditor is the successor. TinyMCE would be another alternative, or any other might be..
But what I want to mention is along with possible printing issues (that I have never dealt with) I want to underline another aspect:
my users should be able to insert table insert image and etc.
uploading and inserting images might be another issue...they don't come with a built in uploader, they sell it. you have the option to buy CKFinder along with CKEditor and Moxiemanager along with TinyMCE unless you choose to handle upload and insert into the editor process yourself.

Get all data from DB and sort client side, is this optimal or ideal?

So I'm making a online chat program.
Technologies: -AJAX(methodology) -PHP -C# -ASP.net -JQuery -HTML5 -MYSQL -IIS
Issue (Long):
I've implemented group chat which works fine up to now. My issue is with multi-chat. Mind you I now realize i should have done the entire thing in PHP, but only knew ASP.net and C# when i started and will end up using PHP only, as a last resort. Anyway, when a multi-chat window is made, it injects the pre-made code via jquery into a div, stores it in sessionStorage for when the page refreshes, it loads the code from sessionstorage, and all ID's are incremented by one, for each user to have a max of 6 windows open at any given time. Now i'm trying to get specific query's for each specific users request like "SELECT * WHERE user1 privateChatID = '1' AND user2 privateChatID = '1'; (not the actual query, just pseudo code)", but since i'm using AJAX to get the query, I cant really manipulate the php file since it's loaded because the main file is a .aspx page. Now for group chat I'm using an update panel which works fine, but i can't dynamically make a draggable chat window, inside the update panel, because I'd have to use an ' runat="server" ' attribute, and if i run that in the pre-scripted jquery and wanted to increment the ID (like so: 'IDName "+ i +"'), visual studio/iis gives an error, hence the reason i'm trying to use Ajax. So all the problems I've worked out so far, once i get a working version I'll probably rethink the whole structure all together. My only issue now:
Issue (short):
Would it be easier since i can't manupulate functions or variables in the php file, to just select everything from the DB ('message table') and sort everything client side? or would that not be optimal? OR is there a way to alter query's externally for a php file that is loaded by jquery?
So my solution was to create php files on the server that would have their own queries, and users would have their own directories on the server for those files and i guess any other files that might need to be added to them in the future if any. I'm taking a chance if the load of bandwidth is too much because a number of users will be creating files on the server, when a chat window is create, i don't even know how secure it'll be but it's working for the time being, i'll tweak security issues, after i can get everything working.

Implementing search in web application

I am implementing an eCommerce application using ASP.Net. I would like to know if custom Google search is sufficient enough or if we plan to go implement our search functionality.. how do we go about doing it?
Ideas and Suggestions and best practices are most welcome.
Regards,
Abdel Olakara
If you don't plan on using Google Search then you really have 2 options:
If you are using SQL Server you can put all of your site text into ntext or varbinary fields so that it is search-able. Then if you have files like PDFs etc you can put the files into a table as varbinary and create a Full Text Catalog to search them. For PDFs you will need to have iFilter installed, it is part of the free Adobe Reader package. There are other iFilters. Check out http://www.ifilter.org/ for more info on them.
If you are using asp.net hosted on a windows server you can use the Windows Indexing Service and put any of the data that you want into text file or any other file format. You might still need iFilters for those formats.
I would suggest option 1 if you don't go with Google. It can be a little more complex but option 2 can have the issue that everything starts to look like it is being saved in a giant heap. You can also do some combination of 1 and 2.
You might like to look at Lucene.NET http://lucene.apache.org/lucene.net/
I have spent many years implementing search engines and using an established 3rd Party tool like Lucene will save you a lot of heartache. There are many, many gotchas and edge cases with searching. These have been dealt with to a large degree in Lucene.
As I read it, Custom Google Search is about searching web pages in your site. Contrast this with searching database contents such as lists of products or reviews of items.
What are your requirements? My guess is that when I go to an eCommerce site (eg. Amazon or something such as Trip Advisor) I want to search content that is stored in databases. So I'm doubtful that this particular Google capability fits my expectations of eCommerce.

Categories