Beispiel #1
0
        /// <summary>
        /// 向B库中保存A库的原油信息
        /// </summary>
        /// <returns></returns>
        public int SaveInfoB(ref OilInfoBEntity oilInfoB)
        {
            ReadDataFromUI();

            OilBll.InfoToInfoB(this._oilInfo, oilInfoB);

            oilInfoB.ID = OilBll.saveInfo(oilInfoB);

            if (oilInfoB.ID == -1)
            {
                OilInfoBAccess        access       = new OilInfoBAccess();
                string                sqlWhere     = "crudeIndex='" + oilInfoB.crudeIndex + "'";
                List <OilInfoBEntity> oilInfoBList = access.Get(sqlWhere).ToList();
                oilInfoB.ID = oilInfoBList[0].ID;
                access.Update(oilInfoB, oilInfoB.ID.ToString());
                OilDataBAccess oilDataAccess = new OilDataBAccess();
                oilDataAccess.Delete("labData='' and calData='' and oilInfoID=" + oilInfoB.ID); //删除空的数据
                return(oilInfoB.ID);
            }
            return(oilInfoB.ID);
        }