|
Hello,
I want to design a software for check printing in c#.net. With the forms and design where the user can draw the labels. Is there any sample code available. Please send accross to me.
inform_ashok@yahoo.com
|
|
|
|
|
Read this[^].
You are in a wrong place.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Ashokref wrote: Is there any sample code available.
There may be if you try and look for it!
|
|
|
|
|
yes i have the code to print but it is leanthy if u have c#profetionals 2008 then see page no othereise i send you withen two days
|
|
|
|
|
|
Hi my freind
I need this sample (source code of cheque printing) . Plz send me.
Email : Rafiee_Nader@yahoo.com
Thanks :
Nader Rafiee
|
|
|
|
|
It would be great if you coulod send me the C# code for Cheque print to my email address transux@yahoo.com . Please help me.
Saravanan
INDIA
|
|
|
|
|
I don't have source code but I am using Cheque Printing Software. You can look at screen shots, forms and functionality they have implemented. I think GNPrinting.in is also developed in C# only. You can download demo and have a look at it.
|
|
|
|
|
Hi santosh do u have source code for check printing can u send me at zuberahmedsk@gmail.com
|
|
|
|
|
hi
i want to develop my project independent of versions
for example
i m generating drawings in AutoCad in c#
this task should work for any versions of AutoCad Application for example Autocad 2004,2006,2008,2010
to create a auto cad application object
i m using
AcadApplication AcadApp = new AcadApplication();
AcadApp = CreateObject("AutoCAD.Application");
while creating can i create a application of a particular version
is this possible
is this DLL Hell problem
i know that .net supports solves versioning problem
then how can i solve this type of problem...
does the only solutions is to leave it to o/s
plz can any one solve it
thanking you in advance
vijay kumar d
|
|
|
|
|
vijaylumar wrote: i know that .net supports solves versioning problem
It gives you some tools, but it does not solve the problem.
vijaylumar wrote: then how can i solve this type of problem...
Implement a strategy [^] for every version
I are Troll
|
|
|
|
|
I have two class;
public class AkdPerson
{
public int PersonID { get; set; }
public string PersonName { get; set; }
}
public class XPOPerson
{
public int PersonID { get; set; }
public string PersonName { get; set; }
}
How can I deep copy AkdPerson to XPOPerson, and XPOPerson to AkdPerson.
Actually I write DeepCopy metod, like this;
public static T DeepCopy<T>(T obj)
{
object result = null;
using (var ms = new MemoryStream())
{
var formatter = new BinaryFormatter();
formatter.Serialize(ms, obj);
ms.Position = 0;
result = (T)formatter.Deserialize(ms);
ms.Close();
}
return (T)result;
}
But I can't conver to AkdPerson to XPOPerson.
I GET ERROR - IMPLICITY CONVERT
AkdPerson akdPerson = new AkdPerson();
akdPerson.PersonID = 1;
akdPerson.PersonName = "Joe";
XPOPerson xpoPerson = DeepCopy(akdPerson);
|
|
|
|
|
Why don't you create an interface and both classes implement this interface. So you can cast.
|
|
|
|
|
If I write
IPerson xpoPerson = DeepCopy(akdPerson);
but if I write
AkdPerson xpoPerson = DeepCopy(akdPerson);
not work. And I dont want to any drive metod, because these classes autogenerated. And contain different attributes, like [Key] for OR/M, [DataContract] for WCF etc...
Any idea??
|
|
|
|
|
You can use reflection and copy the values from source to target for all the matching members. You should do something like,
1) DeepCopy method should take two types, source and target and return the target type
2) Get all fields including private fields from source.
3) Look for the same field name in target.
4) Assign source field value to target field value.
5) Continue until you finish all members.
Here is a generic DeepCopy implementation.
TSource Clone<TSource>(TSource source)
{
TSource cloned = default(TSource);
using (var stream = new MemoryStream())
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, source);
stream.Position = 0;
cloned = (TSource)formatter.Deserialize(stream);
}
return cloned;
}
TTarget DeepCopy<TSource,TTarget>(TSource source) where TTarget: new()
{
TSource cloned = Clone(source);
Type targetType = typeof(TTarget);
TTarget target = new TTarget();
BindingFlags memberSearchFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
BindingFlags fieldSearchFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField;
MemberInfo[] targetMembers = targetType.GetMembers(fieldSearchFlags);
foreach (MemberInfo sourceMember in typeof(TSource).GetMembers(memberSearchFlags))
{
if(sourceMember.MemberType == MemberTypes.Field)
{
FieldInfo sourceField = (FieldInfo) sourceMember;
FieldInfo targetField = (FieldInfo) targetMembers.SingleOrDefault(m => m.Name == sourceField.Name);
if (targetField != null)
targetField.SetValue(target, sourceField.GetValue(source));
}
}
return target;
} Use this like.
AkdPerson akd = new AkdPerson() { PersonID = 10, PersonName = "Chuck Norris" };
XPOPerson xpo = DeepCopy<AkdPerson,XPOPerson>(akd); Note : This will copy only the members whose name matches. This will leave all other members uninitialized and you should take care about initializing them before you use them.
|
|
|
|
|
|
Create a base-class called "Person" and derive both classes from it
|
|
|
|
|
If I write
Person xpoPerson = DeepCopy(akdPerson);
but if I write
AkdPerson xpoPerson = DeepCopy(akdPerson);
not work. And I dont want to any drive metod, because these classes autogenerated. And contain different attributes, like [Key] for OR/M, [DataContract] for WCF etc...
Any idea??
|
|
|
|
|
Yup, use reflection to determine what properties to copy
I are Troll
|
|
|
|
|
How can I following class for my class;
I GET ERROR
public object Copy(Type source, object sourceToCopy, Type destination)
{
XmlSerializer serializer = new XmlSerializer(source);
MemoryStream memoryStream = new MemoryStream();
XmlSerializerNamespaces nameSpacesList = new XmlSerializerNamespaces();
nameSpacesList.Add("", "");
serializer.Serialize(memoryStream, sourceToCopy, nameSpacesList);
byte[] byteArr = memoryStream.ToArray();
ASCIIEncoding encoder = new ASCIIEncoding();
string xmlString = encoder.GetString(byteArr);
ASCIIEncoding newEncoder = new ASCIIEncoding();
byte[] newByteArr = newEncoder.GetBytes(xmlString);
MemoryStream newMemoryStream = new MemoryStream(newByteArr);
XmlSerializer deSer = new XmlSerializer(destination);
object deserializedObject = deSer.Deserialize(newMemoryStream);
return deserializedObject;
}
|
|
|
|
|
Are you just trying things randomly until one works?
|
|
|
|
|
There is a more fundamental question here; why are you trying to "copy" one of these things to another?
If both Person classes have the same properties, they should probably derive from the same class or interface, meaning any reference to the concrete XPOPerson or AkdPerson is irrelevant.
What is it you are trying to achive? That would enable us to get a better answer for you.
|
|
|
|
|
Yeah, some base class is a good idea. Or consider writing converters -- look into the implicit and explicit operators.
|
|
|
|
|
When i send mail above error occurred.
would anyone say:
code is below:
MailAddress SendFrom = new MailAddress("test@nibssolutions.net");
MailAddress SendTo = new MailAddress("rudro_aiub@yahoo.com");
MailMessage myMessage = new MailMessage(SendFrom, SendTo);
myMessage.Subject = "Subject";
myMessage.Body = "Body";
SmtpClient _smtpClient = new SmtpClient("mail.nibssolutions.net", 587);
_smtpClient.EnableSsl = true;
_smtpClient.Credentials = new System.Net.NetworkCredential("test@nibssolutions.net", "********");
_smtpClient.Send(myMessage);
//}
MessageBox.Show("Mail Sent...");
|
|
|
|
|
i download insecure pop3 mail. But i can not download secure mail like gmail.
would you help me?
Thanks in advance
Shafik
|
|
|
|