Beispiel #1
0
        public MsLocation[] GetLocation()
        {
            List <MsLocation> mLocation = new List <MsLocation>();

            dc = new DCAssetDataContext();
            try
            {
                var query = dc.MsLocation_View("", "G");
                foreach (var res in query)
                {
                    MsLocation location = new MsLocation();
                    location.LocationCode = res.LocationCode;
                    location.LocationName = res.LocationName;
                    mLocation.Add(location);
                }
            }
            catch (Exception ex)
            {
                ViewBag.Error = ex.Message;
            }
            return(mLocation.ToArray());
        }
Beispiel #2
0
        private MsLocation[] GridLokasi()
        {
            dc = new DCAssetDataContext();
            List <MsLocation> mslocation = new List <MsLocation>();

            try
            {
                var query = dc.MsLocation_View("", "G");
                foreach (var res in query)
                {
                    string     Aktif  = "";
                    MsLocation lokasi = new MsLocation();
                    if (res.bActive.ToString() == "True")
                    {
                        Aktif = "Y";
                    }
                    else
                    {
                        Aktif = "T";
                    }
                    lokasi.Id           = res.Id;
                    lokasi.LocationCode = res.LocationCode;
                    lokasi.LocationName = res.LocationName;
                    lokasi.SiteCode     = res.SiteCode;
                    lokasi.SiteName     = res.SiteName;
                    lokasi.bActive      = res.bActive;
                    lokasi.Aktif        = Aktif;

                    mslocation.Add(lokasi);
                }
            }
            catch
            {
                mslocation = null;
            }
            return(mslocation.ToArray());
        }