/// <summary> /// 数据库录入 /// </summary> /// <param name="list">缓存列表</param> static void DataToBase(List <baidutb> list) { MysqlFactory.Instance.DefaultConnStr = MysqlFactory.GetConnStr("localhost", "root", "456123", "fortest"); ORMHelper.DefaultDataFactory = MysqlFactory.Instance; DataControl dc = ORMHelper.DefaultDataFactory.Create(); dc.BeginTransaction(); foreach (var item in list) { ORMHelper.InsertOrUpdate(item, dc); } dc.Commit(); dc.Close(); }
static void Main(string[] args) { #region Mysql string ip = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "ip"); string user = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "user"); string psw = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "psw"); string dataBase = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "dataBase"); MysqlFactory.Instance.DefaultConnStr = MysqlFactory.GetConnStr(ip, user, psw, dataBase); ORMHelper.DefaultDataFactory = MysqlFactory.Instance; #endregion TaskView t = new TaskView(); t.SetDlgTitle("Tmall_Skechers"); t.AddTask(GetLiningTmallData.Instance); //t.AddTask(GetLiningResult.Instance); t.ShowDialog(); }
static void Main(string[] args) { #region Mysql string ip = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "ip"); string user = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "user"); string psw = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "psw"); string dataBase = CC.Utility.iniHelper.ReadValue(FilePath, "Mysql", "dataBase"); MysqlFactory.Instance.DefaultConnStr = MysqlFactory.GetConnStr(ip, user, psw, dataBase); ORMHelper.DefaultDataFactory = MysqlFactory.Instance; #endregion //GetData_CSV.GotResultCsv("Skechers_Tmall_20170328.xlsx", "20170328分析", "Skechers_Tmall_20170328"); TaskView t = new TaskView(); t.SetDlgTitle("Tmall_Skechers"); //t.AddTask(Get_SkechersResult.Instance); t.AddTask(Tmall_Skechers_Task.Instance); t.ShowDialog(); }