Example #1
0
    public string REQUESTLOGS_Add(string REQUEST_HCCU_ID, string REQUEST_IP, string REQUEST_DATETIME, string REQUEST_TYPE_ID, string REQUEST_RESULT_ID, string REQUEST_METHOD_NAME, string SK)
    {
        string[,] p = new string[2, 6];
        p[0, 0]     = "REQUEST_HCCU_ID";
        p[1, 0]     = REQUEST_HCCU_ID;
        p[0, 1]     = "REQUEST_IP";
        p[1, 1]     = REQUEST_IP;
        p[0, 2]     = "REQUEST_DATETIME";
        p[1, 2]     = REQUEST_DATETIME;
        p[0, 3]     = "REQUEST_TYPE_ID";
        p[1, 3]     = REQUEST_TYPE_ID;
        p[0, 4]     = "REQUEST_RESULT_ID";
        p[1, 4]     = REQUEST_RESULT_ID;
        p[0, 5]     = "REQUEST_METHOD_NAME";
        p[1, 5]     = REQUEST_METHOD_NAME;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        REQUEST_HCCU_ID   = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(REQUEST_HCCU_ID);
        REQUEST_IP        = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(REQUEST_IP);
        REQUEST_DATETIME  = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(REQUEST_DATETIME);
        REQUEST_TYPE_ID   = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(REQUEST_TYPE_ID);
        REQUEST_RESULT_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(REQUEST_RESULT_ID);

        COS_WEBSERVICE_REQUESTLOGS cos_w_r = new COS_WEBSERVICE_REQUESTLOGS();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_r.REQUESTLOGS_Add(REQUEST_HCCU_ID, REQUEST_IP, DateTime.Parse(REQUEST_DATETIME), REQUEST_TYPE_ID, REQUEST_RESULT_ID, REQUEST_METHOD_NAME).ToString()));
    }
Example #2
0
    public string PROD_Add(string EP_PRODUCT_NAME, string EP_PRODUCT_DESCRIPTION, string DEV_ID, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "EP_PRODUCT_NAME";
        p[1, 0]     = EP_PRODUCT_NAME;
        p[0, 1]     = "EP_PRODUCT_DESCRIPTION";
        p[1, 1]     = EP_PRODUCT_DESCRIPTION;
        p[0, 2]     = "DEV_ID";
        p[1, 2]     = DEV_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4,-4"));
        }

        EP_PRODUCT_NAME        = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PRODUCT_NAME);
        EP_PRODUCT_DESCRIPTION = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PRODUCT_DESCRIPTION);
        DEV_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(DEV_ID);


        COS_WEBSERVICE_PROD cos_w_prod = new COS_WEBSERVICE_PROD();

        int[] s = new int[2];
        s = cos_w_prod.PROD_Add(EP_PRODUCT_NAME, EP_PRODUCT_DESCRIPTION, DEV_ID);
        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(s[0].ToString() + "," + s[1].ToString()));
    }
Example #3
0
    public string EP_Edit(string EP_ID, string EP_TYPEID, string EP_USERDEFINED_ALIAS, string EP_PRODUCT_ID, string SK)
    {
        string[,] p = new string[2, 4];
        p[0, 0]     = "EP_ID";
        p[1, 0]     = EP_ID;
        p[0, 1]     = "EP_TYPEID";
        p[1, 1]     = EP_TYPEID;
        p[0, 2]     = "EP_USERDEFINED_ALIAS";
        p[1, 2]     = EP_USERDEFINED_ALIAS;
        p[0, 3]     = "EP_PRODUCT_ID";
        p[1, 3]     = EP_PRODUCT_ID;


        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_ID                = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_ID);
        EP_TYPEID            = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_TYPEID);
        EP_USERDEFINED_ALIAS = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_USERDEFINED_ALIAS);
        EP_PRODUCT_ID        = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PRODUCT_ID);

        COS_WEBSERVICE_EP cos_w_e = new COS_WEBSERVICE_EP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_e.EP_Edit(EP_ID, EP_TYPEID, EP_USERDEFINED_ALIAS, EP_PRODUCT_ID)));
    }
Example #4
0
    public string TRANS_Add(string TARGET_EP_ID, string TRIGGER_TYPE_ID, string MISC, string DT, string SK)
    {
        string[,] p = new string[2, 4];
        p[0, 0]     = "TARGET_EP_ID";
        p[1, 0]     = TARGET_EP_ID;
        p[0, 1]     = "TRIGGER_TYPE_ID";
        p[1, 1]     = TRIGGER_TYPE_ID;
        p[0, 2]     = "MISC";
        p[1, 2]     = MISC;
        p[0, 3]     = "DT";
        p[1, 3]     = DT;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        TARGET_EP_ID    = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(TARGET_EP_ID);
        TRIGGER_TYPE_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(TRIGGER_TYPE_ID);
        MISC            = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(MISC);
        DT = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(DT);

        COS_WEBSERVICE_TRANS cos_w_trans = new COS_WEBSERVICE_TRANS();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_trans.TRANS_Add(TARGET_EP_ID, TRIGGER_TYPE_ID, MISC, DT).ToString()));
    }
Example #5
0
    public void UplinkData(string hccu_id, string _EP_ID, string _PROPERTY_COLLECTION)
    {
        string skraw = "HCCU_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id)
                       + "&EP_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_EP_ID)
                       + "&PROPERTY_COLLECTION=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_PROPERTY_COLLECTION);

        string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw);

        PROP p = new PROP();

        p.EP_PROPERTYDATA_Uplink(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id),
                                 COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_EP_ID),
                                 COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_PROPERTY_COLLECTION), sk);
    }
Example #6
0
    public string EP_Sync(string HCCU_Id, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "HCCU_Id";
        p[1, 0]     = HCCU_Id;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_Id = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_Id);

        COS_WEBSERVICE_EP cos_w_e = new COS_WEBSERVICE_EP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_e.EP_Sync(HCCU_Id)));
    }
Example #7
0
    public string NotifyEventUpdate(string EVENT_ID_Collection, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "EVENT_ID_Collection";
        p[1, 0]     = EVENT_ID_Collection;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EVENT_ID_Collection = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EVENT_ID_Collection);

        COS_WEBSERVICE_EVENTS cos_w_ev = new COS_WEBSERVICE_EVENTS();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_ev.NotifyEventUpdate(EVENT_ID_Collection)));
    }
Example #8
0
    public string EVENTS_Sync(string HCCU_ID, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);

        COS_WEBSERVICE_EVENTS cos_w_ev = new COS_WEBSERVICE_EVENTS();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_ev.EVENTS_Sync(HCCU_ID)));
    }
Example #9
0
    public string PROP_Delete(string EP_PROPERTY_ID, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "EP_PROPERTY_ID";
        p[1, 0]     = EP_PROPERTY_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_PROPERTY_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PROPERTY_ID);

        COS_WEBSERVICE_PROP cos_w_prop = new COS_WEBSERVICE_PROP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_prop.PROP_Delete(EP_PROPERTY_ID).ToString()));
    }
Example #10
0
    public string EXEC_ORDER_Get(string EP_ID, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "EP_ID";
        p[1, 0]     = EP_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_ID);

        COS_WEBSERVICE_EXEC_ORDER cos_w_exec = new COS_WEBSERVICE_EXEC_ORDER();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_exec.EXEC_ORDER_Get(EP_ID).ToString()));
    }
Example #11
0
    public string EP_PROPERTYFACT_Sync(string HCCU_ID, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);

        COS_WEBSERVICE_PROP cos_w_prop = new COS_WEBSERVICE_PROP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_prop.EP_PROPERTYFACT_Sync().ToString()));
    }
Example #12
0
    public string EP_Add_20140320(string EP_TypeId, string EP_UserDefined_Alias, string EP_ProductId, string HCCU_Id, string EP_MAC_Id, string PROPFORMAT, string IP, string SK)
    {
        string[,] p = new string[2, 7];
        p[0, 0]     = "EP_TypeId";
        p[1, 0]     = EP_TypeId;
        p[0, 1]     = "EP_UserDefined_Alias";
        p[1, 1]     = EP_UserDefined_Alias;
        p[0, 2]     = "EP_ProductId";
        p[1, 2]     = EP_ProductId;
        p[0, 3]     = "HCCU_Id";
        p[1, 3]     = HCCU_Id;
        p[0, 4]     = "EP_MAC_Id";
        p[1, 4]     = EP_MAC_Id;
        p[0, 5]     = "PROPFORMAT";
        p[1, 5]     = PROPFORMAT;
        p[0, 6]     = "IP";
        p[1, 6]     = IP;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_TypeId            = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_TypeId);
        EP_UserDefined_Alias = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_UserDefined_Alias);
        EP_ProductId         = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_ProductId);
        HCCU_Id   = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_Id);
        EP_MAC_Id = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_MAC_Id);
        IP        = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(IP);


        COS_WEBSERVICE_EP cos_w_e = new COS_WEBSERVICE_EP();

        int[] ret = cos_w_e.EP_Add_20140320(EP_TypeId, EP_UserDefined_Alias, EP_ProductId, HCCU_Id, EP_MAC_Id, PROPFORMAT, IP);

        string ret2 = "";

        if (ret[0] > 0)
        {
            COS_WEBSERVICE_PROD cos_w_p = new COS_WEBSERVICE_PROD();
            ret2 = cos_w_p.GET_PROD_ByEPID(ret[0].ToString());
        }

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ret[0].ToString() + "," + ret[1].ToString() + "," + ret[2].ToString() + "|" + ret2));
    }
Example #13
0
    public string EPTYPE_GetList(string HCCU_ID, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);

        COS_WEBSERVICE_EPTYPE cos_w_ep = new COS_WEBSERVICE_EPTYPE();
        ArrayList             a        = new ArrayList();

        a = cos_w_ep.EPTYPE_GetList(HCCU_ID);

        if (a.Count == 0)
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("0"));
        }
        else
        {
            if (a[0].ToString().Trim() == "-1")
            {
                return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-1"));
            }
            else if (a[0].ToString().Trim() == "-2")
            {
                return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-2"));
            }
            else
            {
                string ret = "";
                for (int j = 0; j < a.Count; j++)
                {
                    ret += a[j].ToString().Trim() + "|";
                }
                ret = ret.Substring(0, ret.Length - 1);
                return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ret));
            }
        }
    }
Example #14
0
    public string UpdateHCCUStatus(string mac, string SK)
    {
        string[,] p = new string[2, 1];
        p[0, 0]     = "mac";
        p[1, 0]     = mac;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        mac = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(mac);

        //UPDATE_STM_HCCU_STATUS
        string query = "UPDATE HCCU_MAC_FACT SET HCCU_LASTUPDATETIME = GETDATE() WHERE HCCU_MAC = '" + mac + "'";

        DataHelper.Query_ExecuteNonQuery(DataHelper.DataBaseFact.CENTRAL, query, null);
        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1"));
    }
Example #15
0
    public string HCCU_Offline_Notify(string MAC_ID, string ifLogOutAccount, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "MAC_ID";
        p[1, 0]     = MAC_ID;
        p[0, 1]     = "ifLogOutAccount";
        p[1, 1]     = ifLogOutAccount;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        MAC_ID          = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(MAC_ID);
        ifLogOutAccount = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(ifLogOutAccount);

        COS_WEBSERVICE_HCCU cos_w_hccu = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_hccu.HCCU_Offline_Notify(MAC_ID, ifLogOutAccount)));
    }
Example #16
0
    public string HCCU_Online_Notify(string HCCU_ID, string MAC, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;
        p[0, 1]     = "MAC";
        p[1, 1]     = MAC;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);
        MAC     = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(MAC);

        COS_WEBSERVICE_HCCU cos_w_hccu = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_hccu.HCCU_Online_Notify(HCCU_ID, MAC)));
    }
Example #17
0
    public string PROP_Add(string EP_PROPERTY_TABLE_ID, string EP_PROPERTY_NAME, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "EP_PROPERTY_TABLE_ID";
        p[1, 0]     = EP_PROPERTY_TABLE_ID;
        p[0, 1]     = "EP_PROPERTY_NAME";
        p[1, 1]     = EP_PROPERTY_NAME;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_PROPERTY_TABLE_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PROPERTY_TABLE_ID);
        EP_PROPERTY_NAME     = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_PROPERTY_NAME);

        COS_WEBSERVICE_PROP cos_w_prop = new COS_WEBSERVICE_PROP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_prop.PROP_Add(EP_PROPERTY_TABLE_ID, EP_PROPERTY_NAME).ToString()));
    }
Example #18
0
    public string EP_Delete(string EP_Id, string COSID, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "EP_Id";
        p[1, 0]     = EP_Id;
        p[0, 1]     = "COSID";
        p[1, 1]     = COSID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_Id = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_Id);
        COSID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(COSID);

        COS_WEBSERVICE_EP cos_w_e = new COS_WEBSERVICE_EP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_e.EP_Delete(EP_Id, COSID).ToString()));
    }
Example #19
0
    public string HCCU_Get_Info(string HCCU_ID, string HCCU_MAC, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;
        p[0, 1]     = "HCCU_MAC";
        p[1, 1]     = HCCU_MAC;


        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID  = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);
        HCCU_MAC = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_MAC);

        COS_WEBSERVICE_HCCU cos_w_h = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_h.HCCU_Get_Info(HCCU_ID, HCCU_MAC)));
    }
Example #20
0
    public string HCCU_Login(string HCCU_UID, string HCCU_PSW, string HCCU_MAC_ID, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "HCCU_UID";
        p[1, 0]     = HCCU_UID;
        p[0, 1]     = "HCCU_PSW";
        p[1, 1]     = HCCU_PSW;
        p[0, 2]     = "HCCU_MAC_ID";
        p[1, 2]     = HCCU_MAC_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_UID    = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_UID);
        HCCU_MAC_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_MAC_ID);

        COS_WEBSERVICE_HCCU cos_w_h = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_h.HCCU_Login(HCCU_UID, HCCU_PSW, HCCU_MAC_ID)));
    }
Example #21
0
    public string HCCU_ChangePassword(string HCCU_ID, string Old_Password, string New_Password, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;
        p[0, 1]     = "Old_Password";
        p[1, 1]     = Old_Password;
        p[0, 2]     = "New_Password";
        p[1, 2]     = New_Password;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);


        COS_WEBSERVICE_HCCU cos_w_h = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_h.HCCU_ChangePassword(HCCU_ID, Old_Password, New_Password)));
    }
Example #22
0
    public string EXEC_ORDER_Add(string EP_ID, string PROP, string VALUE, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "EP_ID";
        p[1, 0]     = EP_ID;
        p[0, 1]     = "PROP";
        p[1, 1]     = PROP;
        p[0, 2]     = "VALUE";
        p[1, 2]     = VALUE;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_ID = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_ID);
        PROP  = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(PROP);
        VALUE = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(VALUE);

        COS_WEBSERVICE_EXEC_ORDER cos_w_exec = new COS_WEBSERVICE_EXEC_ORDER();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_exec.EXEC_ORDER_Add(EP_ID, PROP, VALUE).ToString()));
    }
Example #23
0
    public string EPTYPE_Add(string EP_Type_name, string EP_Type_Description, string HCCU_ID, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "EP_Type_name";
        p[1, 0]     = EP_Type_name;
        p[0, 1]     = "EP_Type_Description";
        p[1, 1]     = EP_Type_Description;
        p[0, 2]     = "HCCU_ID";
        p[1, 2]     = HCCU_ID;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        EP_Type_name        = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_Type_name);
        EP_Type_Description = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_Type_Description);
        HCCU_ID             = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);

        COS_WEBSERVICE_EPTYPE cos_w_ep = new COS_WEBSERVICE_EPTYPE();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_ep.EPTYPE_Add(EP_Type_name, EP_Type_Description, HCCU_ID).ToString()));
    }
Example #24
0
    public string UpdateHCCUNetworkInfo(string MAC, string IP, string Port, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "MAC";
        p[1, 0]     = MAC;
        p[0, 1]     = "IP";
        p[1, 1]     = IP;
        p[0, 2]     = "Port";
        p[1, 2]     = Port;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        MAC  = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(MAC);
        IP   = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(IP);
        Port = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(Port);

        COS_WEBSERVICE_HCCU cos_w_hccu = new COS_WEBSERVICE_HCCU();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_hccu.HCCU_NETWORKINFO_UPLOAD(MAC, IP, Port)));
    }
Example #25
0
    public string EP_PROPERTYDATA_Uplink(string HCCU_ID, string EP_ID, string PROPERTY_COLLECTION, string SK)
    {
        string[,] p = new string[2, 3];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;
        p[0, 1]     = "EP_ID";
        p[1, 1]     = EP_ID;
        p[0, 2]     = "PROPERTY_COLLECTION";
        p[1, 2]     = PROPERTY_COLLECTION;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        HCCU_ID             = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(HCCU_ID);
        EP_ID               = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(EP_ID);
        PROPERTY_COLLECTION = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(PROPERTY_COLLECTION);

        COS_WEBSERVICE_PROP cos_w_prop = new COS_WEBSERVICE_PROP();

        return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(cos_w_prop.EP_PROPERTYDATA_Uplink(HCCU_ID, EP_ID, PROPERTY_COLLECTION).ToString()));
    }
Example #26
0
    public string SendCommand(string commandtype, string commandbody, string SK)
    {
        string[,] p = new string[2, 2];
        p[0, 0]     = "commandtype";
        p[1, 0]     = commandtype;
        p[0, 1]     = "commandbody";
        p[1, 1]     = commandbody;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        commandtype = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(commandtype);
        commandbody = COS_SECURITY_TOOL.SECURITY_ContentDecrypt(commandbody);

        if (commandtype.ToLower().Trim() == "i")
        {
            string[] body = commandbody.Split('|');

            string hccu_id = body[1];
            string mac     = body[2];
            string ip      = body[3];
            string prop    = body[4];

            EP ep = new EP();

            string skraw = "EP_TypeId=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1")
                           + "&EP_UserDefined_Alias=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("Unknown")
                           + "&EP_ProductId=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1")
                           + "&HCCU_Id=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id)
                           + "&EP_MAC_Id=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(mac)
                           + "&PROPFORMAT=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(prop)
                           + "&IP=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ip);

            string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw);

            return(ep.EP_Add_20140320(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1"),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt("Unknown"),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt("1"),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt(mac),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt(prop),
                                      COS_SECURITY_TOOL.SECURITY_ContentEncrypt(ip),
                                      sk));
        }

        else if (commandtype.ToLower().Trim() == "d")
        {
            string[] body = commandbody.Split('|');

            if (body.Length < 5)
            {
                return("");
            }

            string hccu_id  = body[1];
            string mac      = body[2];
            string d_length = body[3];

            if (mac.Length != 16)
            {
                return("");
            }

            COS_WEBSERVICE_EP c    = new COS_WEBSERVICE_EP();
            string            epid = Get_EPID_From_MAC(mac);


            ParseDataCommand(commandbody, epid, d_length, hccu_id);


            string skraw = "EP_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(epid);
            string sk    = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw);

            EXEC_ORDER e = new EXEC_ORDER();
            return(e.EXEC_ORDER_Get_WithIP(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(epid), sk));
        }
        else
        {
            return("");
        }
    }
Example #27
0
    public string Sync(string HCCU_ID, string HCCU_MAC_ID, string EXECORDER_EP_ID_PAKG, string EVENT_ID_Collection, string TRANS_PAKG, string REQLOGS_PAKG, string SK)
    {
        string[,] p = new string[2, 6];
        p[0, 0]     = "HCCU_ID";
        p[1, 0]     = HCCU_ID;
        p[0, 1]     = "HCCU_MAC_ID";
        p[1, 1]     = HCCU_MAC_ID;
        p[0, 2]     = "EXECORDER_EP_ID_PAKG";
        p[1, 2]     = EXECORDER_EP_ID_PAKG;
        p[0, 3]     = "EVENT_ID_Collection";
        p[1, 3]     = EVENT_ID_Collection;
        p[0, 4]     = "TRANS_PAKG";
        p[1, 4]     = TRANS_PAKG;
        p[0, 5]     = "REQLOGS_PAKG";
        p[1, 5]     = REQLOGS_PAKG;

        if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK))
        {
            return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4"));
        }

        /*
         * SYNC_HCCU_EP_INFO
         *
         * */
        #region output:return_sync_hccu_ep_info
        HCCU _HCCU = new HCCU();

        string para = "HCCU_ID=" + HCCU_ID + "&HCCU_MAC=" + HCCU_MAC_ID;
        string sk   = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para);

        string return_sync_hccu_ep_info = _HCCU.HCCU_EP_Get_Info(HCCU_ID, HCCU_MAC_ID, sk);
        return_sync_hccu_ep_info = "<SYNC_HCCU_EP_INFO>" + return_sync_hccu_ep_info + "</SYNC_HCCU_EP_INFO>";
        #endregion

        /*
         * SYNC_EXECORDER
         *
         * */
        #region output:return_sync_exec_order
        EXEC_ORDER _EXEC_ORDER            = new EXEC_ORDER();
        string     return_sync_exec_order = "";
        if (EXECORDER_EP_ID_PAKG != "")
        {
            string[] EXECORDER_EP_ID_PAKG_ARRAY = EXECORDER_EP_ID_PAKG.Split('|');
            for (int x = 0; x < EXECORDER_EP_ID_PAKG_ARRAY.Length; x++)
            {
                if (EXECORDER_EP_ID_PAKG_ARRAY[x] != "")
                {
                    string[] EXECORDER_EP_ID_PAKG_SINGLE_ARRAY = EXECORDER_EP_ID_PAKG_ARRAY[x].Split(',');
                    return_sync_exec_order += _EXEC_ORDER.EXEC_ORDER_Get(EXECORDER_EP_ID_PAKG_SINGLE_ARRAY[0], EXECORDER_EP_ID_PAKG_SINGLE_ARRAY[1]) + "^";
                }
            }

            return_sync_exec_order = "<SYNC_EXECORDER>" + return_sync_exec_order + "</SYNC_EXECORDER>";
        }
        else
        {
            return_sync_exec_order = "<SYNC_EXECORDER></SYNC_EXECORDER>";
        }

        #endregion


        /*
         * SYNC_EP_EVENTS
         *
         * */
        #region output:return_sync_events
        EVENTS _EVENTS = new EVENTS();

        string para3 = "HCCU_ID=" + HCCU_ID;
        string sk3   = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para3);

        string return_sync_events = _EVENTS.EVENTS_Sync(HCCU_ID, sk3);
        return_sync_events = "<SYNC_EVENTS>" + return_sync_events + "</SYNC_EVENTS>";
        #endregion

        /*
         * UPLOAD: SYNC_NOTIFYEVENTUPDATE(1,-1,-2,-4)
         *
         *
         * */
        #region output:return_sync_notifyeventupdate
        string para35 = "EVENT_ID_Collection=" + EVENT_ID_Collection;
        string sk35   = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para35);

        string return_sync_notifyeventupdate = _EVENTS.NotifyEventUpdate(EVENT_ID_Collection, sk35);
        return_sync_notifyeventupdate = "<SYNC_NOTIFYEVENTUPDATE>" + return_sync_notifyeventupdate + "</SYNC_NOTIFYEVENTUPDATE>";
        #endregion

        /*
         * SYNC_PROP
         *
         * */
        #region output:return_sync_prop
        PROP _PROP = new PROP();

        string para4 = "HCCU_ID=" + HCCU_ID;
        string sk4   = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para4);

        string return_sync_prop = _PROP.EP_PROPERTYFACT_Sync(HCCU_ID, sk4);
        return_sync_prop = "<SYNC_PROP>" + return_sync_prop + "</SYNC_PROP>";
        #endregion

        /*
         * UPLOAD: SYNC_TRANS(1,-1,-2,-4)
         *
         * */
        #region output:return_sync_trans
        string return_sync_trans = "";
        TRANS  _TRANS            = new TRANS();

        if (TRANS_PAKG.Trim() != "")
        {
            string[] TRANS_PAKG_ARRAY = TRANS_PAKG.Split('|');
            for (int x = 0; x < TRANS_PAKG_ARRAY.Length; x++)
            {
                if (TRANS_PAKG_ARRAY[x] != "")
                {
                    string[] TRANS_PAKG_SINGLE_ARRAY = TRANS_PAKG_ARRAY[x].Split(',');
                    return_sync_trans += _TRANS.TRANS_Add(TRANS_PAKG_SINGLE_ARRAY[0], TRANS_PAKG_SINGLE_ARRAY[1], TRANS_PAKG_SINGLE_ARRAY[2], TRANS_PAKG_SINGLE_ARRAY[3], TRANS_PAKG_SINGLE_ARRAY[4]) + ",";
                }
            }
            return_sync_trans = "<SYNC_TRANS>" + return_sync_trans + "</SYNC_TRANS>";
        }
        else
        {
            return_sync_trans = "<SYNC_TRANS></SYNC_TRANS>";
        }
        #endregion


        /*
         * UPLOAD: SYNC_REQLOGS(1,-1,-2,-4)
         *
         * */
        #region output:return_sync_requestlogs
        string      return_sync_requestlogs = "";
        REQUESTLOGS _REQUESTLOGS            = new REQUESTLOGS();

        if (REQLOGS_PAKG.Trim() != "")
        {
            string[] REQLOGS_PAKG_ARRAY = REQLOGS_PAKG.Split('|');
            for (int x = 0; x < REQLOGS_PAKG_ARRAY.Length; x++)
            {
                if (REQLOGS_PAKG_ARRAY[x] != "")
                {
                    string[] REQLOGS_PAKG_SINGLE_ARRAY = REQLOGS_PAKG_ARRAY[x].Split(',');
                    return_sync_requestlogs += _REQUESTLOGS.REQUESTLOGS_Add(REQLOGS_PAKG_SINGLE_ARRAY[0],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[1],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[2],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[3],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[4],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[5],
                                                                            REQLOGS_PAKG_SINGLE_ARRAY[6]) + ",";
                }
            }

            return_sync_requestlogs = "<SYNC_REQLOGS>" + return_sync_requestlogs + "</SYNC_REQLOGS>";
        }
        else
        {
            return_sync_requestlogs = "<SYNC_REQLOGS></SYNC_REQLOGS>";
        }
        #endregion


        return(return_sync_hccu_ep_info + return_sync_exec_order + return_sync_events + return_sync_notifyeventupdate + return_sync_prop + return_sync_trans + return_sync_requestlogs);
    }