/// <summary> /// 更新分组信息到数据库 先删除数据库该记录再增加 /// </summary> /// <param name="groupInfomatioin"></param> /// <returns></returns> private bool WriteDbUpdateGrpPara(GroupItemsInfo.GroupItem groupInfomatioin) { string strLstTml = ""; string strLstGrp = ""; foreach (int i in groupInfomatioin.LstTml) { strLstTml += i + "#"; } //foreach (int i in groupInfomatioin.LstGrp) //{ // strLstGrp += i + "#"; //} if (strLstTml.Length > 1) strLstTml = strLstTml.Substring(0, strLstTml.Length - 1); if (strLstGrp.Length > 1) strLstGrp = strLstGrp.Substring(0, strLstGrp.Length - 1); var strSql = new string[2]; strSql[0] = "delete from grp_para where grp_id= " + groupInfomatioin.GroupId; strSql[1] = "insert into grp_para(grp_id,grp_name,status,tml_list,grp_list)"; strSql[1] += " values(" + groupInfomatioin.GroupId + ",'" + groupInfomatioin.GroupName + "',"; strSql[1] += 0 + ",'" + strLstTml + "','"; strSql[1] += strLstGrp + "')"; SqlLiteHelper.ExecuteTransactionInThread(strSql); return true; //return SQLiteHelper.ExecuteTransaction(strSql); }
//#endregion #region Write DB /// <summary> /// 写入本表格的更新时间 /// </summary> /// <returns></returns> private bool WriteDbTableTime(long timeNew) { var strSql = new string[2]; strSql[0] = "delete from tab_time where tab_name= 'grp_para'"; strSql[1] = "insert into tab_time(tab_name,tab_update_time)"; strSql[1] += " values('grp_para'," + timeNew + ")"; SqlLiteHelper.ExecuteTransactionInThread(strSql); return true; //return SQLiteHelper.ExecuteTransaction(strSql); }