public object GetLockRecord(int roomid)
    {
        try
        {
            string url = "http://wx.zhisuroom.com/API/LockHandler.ashx";
            IDictionary <string, string> parameters = new Dictionary <string, string>();
            parameters.Add("interface", "GetLockRecord");
            parameters.Add("roomid", roomid.ToString());
            parameters.Add("start", "");
            parameters.Add("end", "");
            string    result = WebService.CallService(url, parameters);
            JObject   json   = JsonConvert.DeserializeObject(result) as JObject;
            JSReader  jsr    = JSReader.ParseJSON(json["Info"].ToString());
            DataTable dt     = new DataTable();
            dt.Columns.Add("date");
            dt.Columns.Add("type");
            for (int i = 0; i < jsr.Count(); i++)
            {
                DataRow dr = dt.NewRow();
                dr["date"] = jsr[i]["ActionTime"].ToString();
                dr["type"] = jsr[i]["Action"].ToString();
                dt.Rows.Add(dr);
            }

            DataView dv = dt.DefaultView;
            dv.Sort = "date desc";
            DataTable dt2 = dv.ToTable();

            return(new { status = json["Status"].ToString(), dt = dt2 });
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Exemple #2
0
 public object GetHotelBJList(int RoomId)
 {
     try
     {
         string url = "http://wx.zhisuroom.com/API/LockHandler.ashx";
         IDictionary <string, string> parameters = new Dictionary <string, string>();
         parameters.Add("interface", "GetHotelBJList");
         parameters.Add("roomid", RoomId.ToString());
         string  result = WebService.CallService(url, parameters);
         JObject json   = JsonConvert.DeserializeObject(result) as JObject;
         return(new { status = json["Status"].ToString(), result = JSReader.ParseJSON(json["Info"].ToString()) });
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
    public object SendCMDAgainTF(string authno)
    {
        try
        {
            string url = "http://wx.zhisuroom.com/API/LockHandler.ashx";
            IDictionary <string, string> parameters = new Dictionary <string, string>();
            parameters.Add("interface", "SendCMDAgainTF");
            parameters.Add("authno", authno);
            string  result = WebService.CallService(url, parameters);
            JObject json   = JsonConvert.DeserializeObject(result) as JObject;

            return(new { status = json["Status"].ToString(), info = JSReader.ParseJSON(json["Info"].ToString()) });
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    public object CancelAuthorizeOrder(int authid, int type)
    {
        try
        {
            string url = "http://wx.zhisuroom.com/API/LockHandler.ashx";
            IDictionary <string, string> parameters = new Dictionary <string, string>();
            parameters.Add("interface", "CancelAuthorizeOrder");
            parameters.Add("type", type.ToString());
            parameters.Add("authid", authid.ToString());
            string  result = WebService.CallService(url, parameters);
            JObject json   = JsonConvert.DeserializeObject(result) as JObject;

            return(new { status = json["Status"].ToString(), info = JSReader.ParseJSON(json["Info"].ToString()) });
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
    public object AddRefundLive(JSReader jsr, string authno)
    {
        try
        {
            string url = "http://wx.zhisuroom.com/API/LockHandler.ashx";
            IDictionary <string, string> parameters = new Dictionary <string, string>();
            parameters.Add("interface", "AddRefundLive");
            parameters.Add("authno", authno);
            parameters.Add("refundtime", DateTime.Now.ToString());
            parameters.Add("ActualTotalPrice", jsr["ActualTotalPrice"].ToString());
            parameters.Add("OtherPrice", jsr["OtherPrice"].ToString());
            parameters.Add("RefundPrice", jsr["RefundPrice"].ToString());
            string  result = WebService.CallService(url, parameters);
            JObject json   = JsonConvert.DeserializeObject(result) as JObject;

            return(new { status = json["Status"].ToString(), info = JSReader.ParseJSON(json["Info"].ToString()) });
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }