public EmbeeObject GetStatus(string transid) { EmbeeObject embeetemp = new EmbeeObject(); embeetemp.Transstatus = 1; Hashtable hstemp = new Hashtable(); string strresponse = Web_Request("?method=get_status&trans_id="+transid, hstemp); JObject o = JObject.Parse(strresponse); int result = (int)o["result"]; if (result == 1) { string strstatus = (string)o["status"]; if (strstatus.ToUpper() == "COMPLETED") { embeetemp.Transstatus = 2; } if (strstatus.ToUpper() == "CANCELED") { embeetemp.Transid = -1; } embeetemp.Message = (string)o["message"]; } return embeetemp; }
public EmbeeObject getEmbeeObject(int paymentkey) { EmbeeObject embeetemp = new EmbeeObject(); embeetemp.Payment_key = paymentkey; DataTable dttemp = Peerfx_DB.SPs.ViewEmbeeObjectsBypaymentkey(paymentkey).GetDataSet().Tables[0]; if (dttemp.Rows[0]["embee_object_key"] != DBNull.Value) { embeetemp.Embee_object_key = Convert.ToInt32(dttemp.Rows[0]["embee_object_key"].ToString()); } if (dttemp.Rows[0]["country"] != DBNull.Value) { embeetemp.Country = Convert.ToInt32(dttemp.Rows[0]["country"].ToString()); } if (dttemp.Rows[0]["carrier"] != DBNull.Value) { embeetemp.Carrier = dttemp.Rows[0]["carrier"].ToString(); } if (dttemp.Rows[0]["product_id"] != DBNull.Value) { embeetemp.Productid = Convert.ToInt32(dttemp.Rows[0]["product_id"].ToString()); } if (dttemp.Rows[0]["product_name"] != DBNull.Value) { embeetemp.Productname = dttemp.Rows[0]["product_name"].ToString(); } if (dttemp.Rows[0]["price_in_dollars"] != DBNull.Value) { embeetemp.Price = Convert.ToDecimal(dttemp.Rows[0]["price_in_dollars"].ToString()); } if (dttemp.Rows[0]["transstatus"] != DBNull.Value) { embeetemp.Transstatus = Convert.ToInt32(dttemp.Rows[0]["transstatus"].ToString()); } if (dttemp.Rows[0]["transid"] != DBNull.Value) { embeetemp.Transid = Convert.ToInt32(dttemp.Rows[0]["transid"].ToString()); } if (dttemp.Rows[0]["date_created"] != DBNull.Value) { embeetemp.Date_created = Convert.ToDateTime(dttemp.Rows[0]["date_created"].ToString()); } if (dttemp.Rows[0]["phonenumber"] != DBNull.Value) { embeetemp.Phone = dttemp.Rows[0]["phonenumber"].ToString(); } if (dttemp.Rows[0]["message"] != DBNull.Value) { embeetemp.Message = dttemp.Rows[0]["message"].ToString(); } if (dttemp.Rows[0]["date_processed"] != DBNull.Value) { embeetemp.Date_processed = Convert.ToDateTime(dttemp.Rows[0]["date_processed"].ToString()); } return embeetemp; }