Пример #1
0
 public static void LogLocationCriteria(IGTGeometry _locCritera, AssetHistory _obj, GTDiagnostics _odiag)
 {
     try
     {
     }
     catch (Exception ex)
     {
         LogException(_odiag, "LogLocationCrietria", ex);
         throw ex;
     }
 }
Пример #2
0
        private static List <AssetHistory> ProcessAssetHistoryRS(ADODB.Recordset _ors, GTDiagnostics _odiag)
        {
            List <AssetHistory> histList = null;
            int g3eFid;

            try
            {
                AssetHistory obj = null;
                histList = new List <AssetHistory>();

                while ((!_ors.EOF) && (!_ors.BOF))
                {
                    obj         = new AssetHistory();
                    obj.G3E_FID = Convert.ToInt32(_ors.Fields["G3E_FID"].Value.ToString().Trim());
                    g3eFid      = obj.G3E_FID;
                    obj.G3E_FNO = Convert.ToInt16(_ors.Fields["G3E_FNO"].Value.ToString().Trim());

                    string sCNO = _ors.Fields["G3E_CNO"].Value.ToString().Trim();
                    if (!string.IsNullOrEmpty(sCNO))
                    {
                        obj.G3E_CNO = Convert.ToInt16(sCNO);
                    }
                    else
                    {
                        obj.G3E_CNO = 0;
                    }

                    string sANO = _ors.Fields["G3E_ANO"].Value.ToString().Trim();
                    if (!string.IsNullOrEmpty(sANO))
                    {
                        obj.G3E_ANO = Convert.ToInt32(sANO);
                    }
                    else
                    {
                        obj.G3E_ANO = 0;
                    }


                    string sCID = _ors.Fields["G3E_CID"].Value.ToString().Trim();
                    if (!string.IsNullOrEmpty(sCID))
                    {
                        obj.G3E_CID = Convert.ToInt32(sCID);
                    }
                    else
                    {
                        obj.G3E_CID = 0;
                    }

                    obj.StructureID_1 = _ors.Fields["STRUCTURE_ID_1"].Value.ToString().Trim();

                    string sx = _ors.Fields["OGG_X_1"].Value.ToString().Trim();
                    if (string.IsNullOrEmpty(sx))
                    {
                        LogMessage(_odiag, "ProcessAssetHistoryRS", "LocationXYZ", "No location for x value for fid = " + obj.G3E_FID.ToString());
                        obj = null;
                    }
                    string sy = _ors.Fields["OGG_Y_1"].Value.ToString().Trim();
                    if (string.IsNullOrEmpty(sy))
                    {
                        LogMessage(_odiag, "ProcessAssetHistoryRS", "LocationXYZ", "No location for y value for fid = " + g3eFid);
                        obj = null;
                    }
                    if (obj != null)
                    {
                        obj.OGG_X1 = Convert.ToDouble(sx);
                        obj.OGG_Y1 = Convert.ToDouble(sy);


                        string sz = _ors.Fields["OGG_Z_1"].Value.ToString().Trim();
                        if (!string.IsNullOrEmpty(sz))
                        {
                            obj.OGG_Z1 = Convert.ToDouble(sz);
                        }
                        else
                        {
                            obj.OGG_Z1 = 0;
                        }

                        string oldValue = _ors.Fields["VALUE_OLD"].Value.ToString().Trim();
                        if (!string.IsNullOrEmpty(oldValue))
                        {
                            obj.OLD_VALUE = oldValue;
                        }

                        string newValue = _ors.Fields["VALUE_NEW"].Value.ToString().Trim();
                        if (!string.IsNullOrEmpty(newValue))
                        {
                            obj.NEW_VALUE = newValue;
                        }

                        obj.ChangeOperation = _ors.Fields["CHANGE_OPERATION"].Value.ToString().Trim();
                        string   sChangeDate = _ors.Fields["CHANGE_DATE"].Value.ToString().Trim();
                        DateTime changedate;
                        DateTime.TryParse(sChangeDate, out changedate);
                        obj.ChangeDate = changedate;

                        histList.Add(obj);
                    }
                    _ors.MoveNext();
                }

                if (histList.Count == 0)
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                LogException(_odiag, "ProcessAssetHistoryRS", ex);
                throw ex;
            }

            return(histList);
        }