Ejemplo n.º 1
0
 static string Init(out int sec, out bool trc, out string filepath) {
     IOptionConfig cfg = new OptionConfig(EnOptionConfigType.App);
     var conn = cfg.Get<string>("conn");
     sec = cfg.Get<int>("sec");
     trc = cfg.Get<bool>("Trace");
     filepath = cfg.Get<string>("filepath");
     if (sec <= 0) {
         cfg.Set<int>("sec", 180000);
         sec = cfg.Get<int>("sec");
     }
     if (string.IsNullOrEmpty(conn)) {
         cfg.Set<string>("conn", "conn1804c7s7.sqlserver.rds.aliyuncs.com,3433;uid=usr0804c7s7;pwd=ABcd6634539;database=erp_power");
         conn = cfg.Get<string>("conn");
     }
     return conn;
 }
Ejemplo n.º 2
0
        static long Clear() {
            IOptionConfig cfg = new OptionConfig(EnOptionConfigType.App);
            appkey = cfg.Get<string>("appkey");
            if (string.IsNullOrEmpty(appkey)) {
                cfg.Set<string>("appkey", "12517536");
                appkey = cfg.Get<string>("appkey");
            }
            appsecret = cfg.Get<string>("appsecret");
            if (string.IsNullOrEmpty(appsecret)) {
                cfg.Set<string>("appsecret", "d86d510e5a9dfab841e00ff7e7f63e4f");
                appsecret = cfg.Get<string>("appsecret");
            }
            //sessionkey = cfg.Get<string>("sessionkey");
            //if (string.IsNullOrEmpty(sessionkey))
            //{
            //    cfg.Set<string>("sessionkey", "610081760d1be039e230a41061de2a3bae98a9a4112df92143584903");
            //    sessionkey = cfg.Get<string>("sessionkey");
            //}

            ITopClient client = new DefaultTopClient(url, appkey, appsecret);
            TopatsJushitaJdpDatadeleteRequest req = new TopatsJushitaJdpDatadeleteRequest();
            req.SyncType = "tb_trade;tb_item;tb_refund;fx_trade;tm_refund";
            req.StartModified = DateTime.Now.AddDays(-10);
            DateTime end = DateTime.Now.AddDays(-5);
            req.EndModified = end;
            try {
                TopatsJushitaJdpDatadeleteResponse response = client.Execute(req);
                if (response.IsError) {
                    AppLog.DebugException(new Exception(string.Format("ErrCode:{0} ErrMsg:{1} SubErrCode:{2} SubErrMsg:{3}", response.ErrCode,
                        response.ErrMsg, response.SubErrCode, response.SubErrMsg)));
                    return -1L;
                } else
                    return response.Task.TaskId;
            } catch (Exception ex) {
                AppLog.DebugException(ex);
                return -1L;
            }
        }