Beispiel #1
0
        internal void GetRemoteConfig()
        {
            if (configs == null)
            {
                configs = new List <ConfigEntity>();
            }
            SQLDBHelper sqlHelper = new SQLDBHelper();
            DataTable   dt        = sqlHelper.Query("select * from TF_Config");

            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    ConfigEntity config = new ConfigEntity();
                    config.id          = Convert.ToInt32(dt.Rows[i]["ID"]);
                    config.configname  = dt.Rows[i]["ConfigName"].ToString();
                    config.configvalue = dt.Rows[i]["ConfigValue"].ToString();
                    config.configtype  = Convert.ToInt32(dt.Rows[i]["ConfigType"]);
                    config.remark      = dt.Rows[i]["Remark"].ToString();
                    config.extension   = Convert.ToInt32(dt.Rows[i]["Extension"]);
                    config.flag        = Convert.ToInt32(dt.Rows[i]["Flag"]);
                    configs.Add(config);
                }
            }
        }
Beispiel #2
0
 private static bool SaveConfigToRemote(List <ConfigEntity> configs, out Exception ex)
 {
     ex = null;
     if (configs != null)
     {
         try
         {
             SQLDBHelper sqlHelper = new SQLDBHelper();
             foreach (ConfigEntity config in configs)
             {
                 string sql = "if exists (select 1 from TF_Config where ID=" + config.id + ") update TF_Config set ConfigName='" + config.configname + "',ConfigValue='" + config.configvalue + "',ConfigType=" + config.configtype + ",Remark='" + config.remark + "',Extension=" + config.extension + ",Flag=" + config.flag + " where ID=" + config.id + " else insert into TF_Config(ConfigName,ConfigValue,ConfigType,Remark,Extension,Flag) values ('" + config.configname + "','" + config.configvalue + "'," + config.configtype + ",'" + config.remark + "'," + config.extension + "," + config.flag + ")";
                 sqlHelper.ExecuteSql(sql);
             }
             return(true);
         }
         catch (Exception e)
         {
             ex = e;
         }
     }
     else
     {
         ex = new Exception("configs参数不能为空!");
     }
     return(false);
 }
Beispiel #3
0
 public static ConfigLogic GetInstance()
 {
     sqlHelper = new SQLDBHelper(); if (Config == null)
     {
         lock (lockObj)
         {
             if (Config == null)
             {
                 Config = new ConfigLogic();
             }
         }
     }
     return(Config);
 }
Beispiel #4
0
 private static bool SaveConfigToRemote(List <ConfigEntity> configs)
 {
     if (configs != null)
     {
         try
         {
             SQLDBHelper sqlHelper = new SQLDBHelper();
             foreach (ConfigEntity config in configs)
             {
                 string sql = "if exists (select 1 from TF_Config where ID=" + config.id + ") update TF_Config set ConfigName='',ConfigValue='',Remark='',Extension=,Flag= where ID=" + config.id + " else insert into TF_Config(ConfigName,ConfigValue,Remark,Extension,Flag) values ('" + config.configname + "','" + config.configvalue + "','" + config.remark + "'," + config.extension + "," + config.flag + ")";
                 sqlHelper.ExecuteSql(sql);
             }
             return(true);
         }
         catch (Exception e)
         {
             MessageBox.Show(e.Message);
         }
     }
     return(false);
 }
Beispiel #5
0
 private FollowupLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #6
0
 private InventoryLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #7
0
 private FormItemLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #8
0
 private PersonalTrainLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #9
0
 private ModuleLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #10
0
 private FinanceDetailLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #11
0
 private PropertyLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
 private MoneyRecordLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #13
0
 private MemberLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #14
0
 private DepartmentLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #15
0
 private TaskStageLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #16
0
 private WorklogLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #17
0
 private StaffLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #18
0
 private UserLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #19
0
 private FormObjectLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #20
0
 private RenewLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #21
0
 private AttachmentLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #22
0
 private ConfigLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #23
0
 private ActionLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #24
0
 private CardTypeLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #25
0
 private IncomeLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #26
0
 private StaffConditionLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #27
0
 private TaskInfoLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #28
0
 private PermissionLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #29
0
 private FormTypeLogic()
 {
     sqlHelper = new SQLDBHelper();
 }
Beispiel #30
0
 private RoleLogic()
 {
     sqlHelper = new SQLDBHelper();
 }