public string Encoder(Order order) { string str = Convert.ToString(order.getID()) + "_" + Convert.ToString(order.getCardNo()) + "_" + Convert.ToString(order.getAmt()) + "_" + Convert.ToString(order.getPrice()); webEncrypt.ServiceClient proxy = new webEncrypt.ServiceClient();//make sure your internet is connected return(proxy.Encrypt(str)); // proxy.Close(); }
public Order Decoder(string orderstr) { Order ord = new Order(); webEncrypt.ServiceClient proxy = new webEncrypt.ServiceClient(); string str = proxy.Decrypt(orderstr); string[] arr = str.Split(new char[] { '_' }); //from string to order ord.setID(Convert.ToInt32(arr[0])); ord.setCardNo(Convert.ToInt32(arr[1])); ord.setAmt(Convert.ToInt32(arr[2])); ord.setPrice(Convert.ToInt32(arr[3])); return(ord); }