/// <summary> /// 载入道具返回 /// </summary> /// <param name="dbi"></param> private void loadBack(DbAccessItem dbi) { if (dbi.Result.ErrCode != 0) { SvLogger.Error("DB Access Fail : Op=Load Item, ErrMsg={0}, Data={1}.", dbi.Result.ErrMsg, dbi.SpName); } else { DataTable dt = dbi.OutDs.Tables[0]; foreach (DataRow dr in dt.Rows) { TItem t = new TItem(); t.id = HTBaseFunc.NullToLong(dr["ID"]); t.name = HTBaseFunc.NullToStr(dr["Name"]); t.desc = HTBaseFunc.NullToStr(dr["Desc"]); string marksStr = HTBaseFunc.NullToStr(dr["Marks"]); List <string> marksList = MarksStringToList(marksStr); t.marks = new TStrList(); t.marks.GetElements().AddRange(marksList); Item i = new Item(t); m_itemDic[t.id] = i; } DataLoadManager.Instance.AddLoadSuccTableCount(); } OnLoadDataFromDBFinish(dbi.Result.ErrCode == 0); }
/// <summary> /// 载入道具返回 /// </summary> /// <param name="dbi"></param> private void loadBack(DbAccessItem dbi) { if (dbi.Result.ErrCode != 0) { SvLogger.Error("DB Access Fail : Op=Load Shipping, ErrMsg={0}, Data={1}.", dbi.Result.ErrMsg, dbi.SpName); } else { DataTable dt = dbi.OutDs.Tables[0]; foreach (DataRow dr in dt.Rows) { TShipping t = new TShipping(); t.id = HTBaseFunc.NullToLong(dr["ID"]); t.name = HTBaseFunc.NullToStr(dr["Name"]); t.desc = HTBaseFunc.NullToStr(dr["Desc"]); t.country = HTBaseFunc.NullToStr(dr["Country"]); t.address = HTBaseFunc.NullToStr(dr["Addres"]); t.tel = HTBaseFunc.NullToStr(dr["Tel"]); t.linkMans = LinkmanStringToList(HTBaseFunc.NullToStr(dr["linkman"])); Shipping s = new Shipping(t); m_shippingDic[s.m_Data.id] = s; } DataLoadManager.Instance.AddLoadSuccTableCount(); } OnLoadDataFromDBFinish(dbi.Result.ErrCode == 0); }
/// <summary> /// 载入道具返回 /// </summary> /// <param name="dbi"></param> private void loadBack(DbAccessItem dbi) { if (dbi.Result.ErrCode != 0) { SvLogger.Error("DB Access Fail : Op=Load Account, ErrMsg={0}, Data={1}.", dbi.Result.ErrMsg, dbi.SpName); } else { DataTable dt = dbi.OutDs.Tables[0]; foreach (DataRow dr in dt.Rows) { TAccount t = new TAccount(); t.account = HTBaseFunc.NullToStr(dr["LoginName"]); t.token = HTBaseFunc.NullToStr(dr["Token"]); t.showName = HTBaseFunc.NullToStr(dr["ShowName"]); t.power = HTBaseFunc.NullToInt(dr["Power"]); t.createTime = HTBaseFunc.NullToDateTime(dr["CreateTime"]).ToString("yyyy-MM-dd HH:mm:ss"); Account acc = new Account(t); m_dataDic[acc.m_Data.account] = acc; } DataLoadManager.Instance.AddLoadSuccTableCount(); } OnLoadDataFromDBFinish(dbi.Result.ErrCode == 0); }