Search Results

Search found 2 results on 1 pages for 'spagetticode'.

Page 1/1 | 1 

  • Barcode to Product Name Converter

    - by spagetticode
    Hi All, We are designing a mobile shopping system. The camera on the phone will read the barcode and then we have to convert the barcode to a standard product name in order to save it to our database. We are saving it to our database because we are connecting to a web service of local e-commerce sites to get their price about the related product. We are sending the product name to get the price from them, so that the user can see the prices, compare and buy. We cannot send barcode number to get the data from the e-commerce sites because some sites do not have the info of the barcode number. I have to somehow get the product name by only knowing the barcode. Google returns the result when barcode number is searched. But how am I going to parse the data? or how am I going to know which answer of google search best suits my input? Is there a site that sells barcode and product name data match? We are designing the system with C# Thanks alot.

    Read the article

  • Searching a Better Solution with Delegates

    - by spagetticode
    Hey All, I am a newbie in C# and curious about the better solution of my case. I have a method which gets the DataTable as a parameter and creates a List with MyClass's variables and returns it. public static List<Campaigns> GetCampaignsList(DataTable DataTable) { List<Campaigns> ListCampaigns = new List<Campaigns>(); foreach (DataRow row in DataTable.Rows) { Campaigns Campaign = new Campaigns(); Campaign.CampaignID = Convert.ToInt32(row["CampaignID"]); Campaign.CustomerID = Convert.ToInt32(row["CustomerID"]); Campaign.ClientID = Convert.ToInt32(row["ClientID"]); Campaign.Title = row["Title"].ToString(); Campaign.Subject = row["Subject"].ToString(); Campaign.FromName = row["FromName"].ToString(); Campaign.FromEmail = row["FromEmail"].ToString(); Campaign.ReplyEmail = row["ReplyEmail"].ToString(); Campaign.AddDate = Convert.ToDateTime(row["AddDate"]); Campaign.UniqueRecipients = Convert.ToInt32(row["UniqueRecipients"]); Campaign.ClientReportVisible = Convert.ToBoolean(row["ClientReportVisible"]); Campaign.Status = Convert.ToInt16(row["Status"]); ListCampaigns.Add(Campaign); } return ListCampaigns; } And one of my another DataTable method gets the DataTable from the database with given parameters. Here is the method. public static DataTable GetNewCampaigns() { DataTable dtCampaigns = new DataTable(); Campaigns Campaigns = new Campaigns(); dtCampaigns = Campaigns.SelectStatus(0); return dtCampaigns; } But the problem is that, this GetNewCampaigns method doesnt take parameters but other methods can take parameters. For example when I try to select a campaign with a CampaignID, I have to send CampaignID as parameter. These all Database methods do take return type as DataTable but different number of parameters. public static DataTable GetCampaignDetails(int CampaignID) { DataTable dtCampaigns = new DataTable(); Campaigns Campaigns = new Campaigns(); dtCampaigns = Campaigns.Select(CampaignID); return dtCampaigns; } At the end, I want to pass a Delegate to my first GetCampaignList Method as parameter which will decide which Database method to invoke. I dont want to pass DataTable as parameter as it is newbie programming. Could you pls help me learn some more advance features. I searched over it and got to Func< delegate but could not come up with a solution.

    Read the article

1