16,014,759 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by faayez (Top 12 by date)
faayez
6-May-20 6:06am
View
I thought about that but the problem every country does not like to see the data of another country, the second I wand also to have the second language English.
the spouse that someone in Syria he wants to buy or to sell these will be interesting only for Syria or someone in Egypt or... so the idea that not to select the country your country per default selected depends on the IP Address Of the user.
please if you have any suggestion can you provide it to me
faayez
6-May-20 5:00am
View
Thanks, Mr.Garth in my application I have to create it for 23 countries speak one language only Arabic and every country want to see only the data of the country only if he needs to see another country he can select it from the dropdown list.
so the problem of language is not the issue but my question this has any effect in the database (security, safety .....) if not how do you think I can manage it just IP per country the data loaded for the country
faayez
6-May-20 3:56am
View
do you are a pro or anti automatic selecting or filtering data and language your application by using Geolocation and IP Address?
faayez
13-Apr-18 3:05am
View
Please any link , Idea ,
faayez
21-Jul-14 5:16am
View
sorry what you mean with that
how can i clean the solution and build application
the problem not only with this project ,the problem with debugging no matter which project
I tried to build many project to see the if the problem from project or from the software
and i re installed the visual studio 2013 but does not help
Pleas can you help me please
faayez
6-Jul-14 18:49pm
View
my quastion how i have to do it
I tried many times but i did not succsed can you help me please
faayez
5-Jul-14 18:46pm
View
so please can you help me
faayez
5-Jul-14 18:46pm
View
when i run the project and click create
i get this:An exception of type 'System.NotImplementedException' occurred in ITCompany.dll but was not handled in user code
faayez
5-Jul-14 18:44pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.IO;
using System.Web;
namespace ITCompany.Models
{
public class barcodecs
{
public string generateBarcode()
{
try
{
string[] charPool = "1-2-3-4-5-6-7-8-9-0".Split('-');
StringBuilder rs = new StringBuilder();
int length = 6;
Random rnd = new Random();
while (length-- > 0)
{
int index = (int)(rnd.NextDouble() * charPool.Length);
if (charPool[index] != "-")
{
rs.Append(charPool[index]);
charPool[index] = "-";
}
else
length++;
}
return rs.ToString();
}
catch (Exception )
{
//ErrorLog.WriteErrorLog("Barcode", ex.ToString(), ex.Message);
}
return "";
}
//31 December 2012 Prapti
public Byte[] getBarcodeImage(string barcode, string file)
{
try
{
BarCode39 _barcode = new BarCode39();
int barSize = 16;
string fontFile = HttpContext.Current.Server.MapPath("~/fonts/FREE3OF9.TTF");
return (_barcode.Code39(barcode, barSize, true, file, fontFile));
}
catch (Exception )
{
//ErrorLog.WriteErrorLog("Barcode", ex.ToString(), ex.Message);
}
return null;
}
}
}
faayez
5-Jul-14 18:43pm
View
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Text;
using System.IO;
using System.Text.RegularExpressions;
using System.Configuration;
namespace ITCompany.Models
{
public class BarCode39
{
private const int _itemSepHeight = 3;
SizeF _titleSize = SizeF.Empty;
SizeF _barCodeSize = SizeF.Empty;
SizeF _codeStringSize = SizeF.Empty;
public BarCode39()
{
_titleFont = new Font("Arial", 10);
_codeStringFont = new Font("Arial", 10);
}
#region Barcode Title
private string _titleString = null;
private Font _titleFont = null;
public string Title
{
get { return _titleString; }
set { _titleString = value; }
}
public Font TitleFont
{
get { return _titleFont; }
set { _titleFont = value; }
}
#endregion
#region Barcode code string
private bool _showCodeString = false;
private Font _codeStringFont = null;
public bool ShowCodeString
{
get { return _showCodeString; }
set { _showCodeString = value; }
}
public Font CodeStringFont
{
get { return _codeStringFont; }
set { _codeStringFont = value; }
}
#endregion
#region Barcode Font
private Font _c39Font = null;
private float _c39FontSize = 12;
private string _c39FontFileName = null;
private string _c39FontFamilyName = null;
public string FontFileName
{
get { return _c39FontFileName; }
set { _c39FontFileName = value; }
}
public string FontFamilyName
{
get { return _c39FontFamilyName; }
set { _c39FontFamilyName = value; }
}
public float FontSize
{
get { return _c39FontSize; }
set { _c39FontSize = value; }
}
private Font Code39Font
{
get
{
if (_c39Font == null)
{
// Load the barcode font
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(_c39FontFileName);
FontFamily family = new FontFamily(_c39FontFamilyName, pfc);
_c39Font = new Font(family, _c39FontSize);
}
return _c39Font;
}
}
#endregion
#region Barcode Generation
public byte[] Code39(string code, int barSize, bool showCodeString, string title, string fontFile)
{
// Create stream....
MemoryStream ms = new MemoryStream();
FontFamilyName = "Free 3 of 9";//ConfigurationSettings.AppSettings["BarCodeFontFamily"];
FontFileName = fontFile;//@"C:\Documents and Settings\Desktop\Barcode\WSBarCode\Code39Font\FREE3OF9.TTF";// ConfigurationSettings.AppSettings["BarCodeFontFile"];
FontSize = barSize;
ShowCodeString = showCodeString;
if (title + "" != "")
Title = title;
Bitmap objBitmap = GenerateBarcode(code);
objBitmap.Save(ms, ImageFormat.Png);
//return bytes....
return ms.GetBuffer();
}
public Bitmap GenerateBarcode(string barCode)
{
int bcodeWidth = 0;
int bcodeHeight = 0;
// Get the image container...
Bitmap bcodeBitmap = CreateImageContainer(barCode, ref bcodeWidth, ref bcodeHeight);
Graphics objGraphics = Graphics.FromImage(bcodeBitmap);
// Fill the background
objGraphics.FillRectangle(new SolidBrush(Color.White), new Rectangle(0, 0, bcodeWidth, bcodeHeight));
faayez
5-Jul-14 18:42pm
View
model Is:
namespace ITCompany.Models
{
using System;
using System.Collections.Generic;
public partial class BProduct
{
public BProduct()
{
this.StoreProducts = new HashSet<storeproduct>();
this.SupplierProducts = new HashSet<supplierproduct>();
}
public int BarCodeID { get; set; }
public byte[] BarcodeImage { get; set; }
public string ImageUrl { get; set; }
public string Barcode { get; set; }
public string ProductName { get; set; }
public string Description { get; set; }
public virtual ICollection<storeproduct> StoreProducts { get; set; }
public virtual ICollection<supplierproduct> SupplierProducts { get; set; }
internal static void InsertOnSubmit(BProduct objprod)
{
throw new NotImplementedException();
}
}
}
faayez
5-Jul-14 18:41pm
View
I want to create Barcode for products that what i did barcode controller:
public ActionResult Index(BProduct model)
{
barcodecs objbar = new barcodecs();
BProduct objprod = new BProduct()
{
ProductName = model.ProductName,
Description = model.Description,
ImageUrl = model.ImageUrl,
BarCodeID = model.BarCodeID,
Barcode = objbar.generateBarcode(),
BarcodeImage = objbar.getBarcodeImage(objbar.generateBarcode(), model.ProductName)
};
BProduct.InsertOnSubmit(objprod);
SubmitChanges();
return RedirectToAction("Mixxim_ICT", "Home");
}
private void SubmitChanges()
{
throw new NotImplementedException();
}
static void Main(string[] args)
{
try
{
FutureFeature();
}
catch (NotImplementedException notImp)
{
Console.WriteLine(notImp.Message);
}
}
static void FutureFeature()
{
// Not developed yet.
throw new NotImplementedException();
}
public ActionResult BarCode()
SqlConnection con = new SqlConnection("Data Source=-------\\SQLEXPRESS;Initial Catalog=storage;Integrated Security=sspi");
string query = "select * From Barcode";
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(query, con);
sda.Fill(dt);
con.Close();
IList<bproduct> model = new List<bproduct>();
for (int i = 0; i < dt.Rows.Count; i++)
{
var p = dt.Rows[i]["BarCodeImage"];
model.Add(new BProduct()
{
ProductName = dt.Rows[i]["ProductName"].ToString(),
Description = dt.Rows[i]["Description"].ToString(),
Barcode = dt.Rows[i]["Barcode1"].ToString(),
ImageUrl = dt.Rows[i]["BarCodeImage"] != null ? "data:image/jpg;base64," + Convert.ToBase64String((byte[])dt.Rows[i]["BarCodeImage"]) : ""
}
);
}
return View(model);
}
}
}
Show More