Exemple #1
0
        public ResultMsg ExampleData1(string param = "")
        {
            String code         = carfs.CARFSecurer.Program.GetEncrytedMessage(encrytionName: Enum.GetName(typeof(carfs.RF.GlobalClass.Securer.Names), 0), originMessage: ("debug"));
            String supposedData = String.Empty;
            string result       = @"[{""RetMsg"": """ + "" + @""", ""obj"": ""[" + "" + @"]""}]";
            string retCode      = "";
            string retMsg       = "";

            try
            {
                #region request data
                if (code == carfs.CARFSecurer.Program.GetEncrytedMessage(encrytionName: Enum.GetName(typeof(carfs.RF.GlobalClass.Securer.Names), 0), originMessage: (param)) || code == carfs.CARFSecurer.Program.GetEncrytedMessage(encrytionName: Enum.GetName(typeof(carfs.RF.GlobalClass.Securer.Names), 0), originMessage: ("debug")))
                {
                    using (RF.GlobalClass.DB.ConnLocalDB cldb = new RF.GlobalClass.DB.ConnLocalDB())
                    {
                        try
                        {
                            retMsg = String.Empty;
                            String value = String.Empty;
                            retCode = "OK" == retMsg ? "00" : "unknown";
                            result  = @"[{""RetCode"":""" + retCode + @""",""RetMsg"": """ + retMsg + @""",""obj"":" + value + @"}]";
                        }
                        catch (Exception ex)
                        {
                        }
                    }
                    //string value = "";
                    //string status = "";
                    //value = gpi.getmdlids("0017", "system", "47", out status);
                }
                else
                {
                }
                #endregion
            }
            catch (Exception ex)
            {
            }
            supposedData = String.IsNullOrEmpty(supposedData) ? result : supposedData;
            ResultMsg rm = new ResultMsg();
            rm.Obj     = supposedData;
            rm.RetCode = retCode;
            rm.RetMsg  = retMsg;
            return(rm);
        }
Exemple #2
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);
        }