Пример #1
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);
        }
Пример #2
0
        /// <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);
        }