示例#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()));
    }
示例#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()));
    }
示例#3
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()));
    }
示例#4
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)));
    }
示例#5
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)));
    }
示例#6
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)));
    }
示例#7
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()));
    }
示例#8
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)));
    }
示例#9
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()));
    }
示例#10
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()));
    }
示例#11
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));
    }
示例#12
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));
            }
        }
    }
示例#13
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"));
    }
示例#14
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)));
    }
示例#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)));
    }
示例#16
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()));
    }
示例#17
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()));
    }
示例#18
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)));
    }
示例#19
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)));
    }
示例#20
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)));
    }
示例#21
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()));
    }
示例#22
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()));
    }
示例#23
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)));
    }
示例#24
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()));
    }
示例#25
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("");
        }
    }