Exemple #1
0
        public ResultMsg GetExampleID(string code = null, string param1 = "", string supposedData = null)
        {
            String retMsg = String.Empty;

            retMsg = "OK";
            String value   = String.Empty;
            String retCode = "OK" == retMsg ? "00" : "unknown";
            string result  = @"{""RetCode"": """ + retCode + "" + @""",""RetMsg"": """ + retMsg + @""", ""obj"": ""[" + "" + @"]""}";

            try
            {
                if (code == carfs.CARFSecurer.Program.GetEncrytedMessage(encrytionName: Enum.GetName(typeof(carfs.RF.GlobalClass.Securer.Names), 0), originMessage: (param1)) || code == carfs.CARFSecurer.Program.GetEncrytedMessage(encrytionName: Enum.GetName(typeof(carfs.RF.GlobalClass.Securer.Names), 0), originMessage: ("debug")))
                {
                    try
                    {
                        RF.GlobalClass.DB.ConnLocalDB cldb = new RF.GlobalClass.DB.ConnLocalDB(@"Data Source=C:\Users\Will_2\Documents\GitHub\mainCSharp\DBExample.sdf;Password=Red.Force0;Persist Security Info=True");
                        DataSet ds = cldb.ReturnDataSet("SELECT * FROM example_info");
                        value  = "[{powerID:\"00\"}, {powerID:\"01\"}]";
                        result = @"{""RetCode"":""" + retCode + @""",""RetMsg"": """ + retMsg + @""",""Obj"":""" + value.Replace("\"", "\\\"") + @""", ""ExtensionData"":""" + @"""}";
                    }
                    catch (Exception ex)
                    {
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
            supposedData = String.IsNullOrEmpty(supposedData) ? result : supposedData;
            ResultMsg rm = new ResultMsg();

            rm.Obj     = supposedData;
            rm.RetCode = retCode;
            rm.RetMsg  = retMsg;
            return(rm);
        }