Ejemplo n.º 1
0
        public static List <Zone> ToList(BLL.Zone v)
        {
            List <Zone> list = new List <Zone>();

            while (!v.EOF)
            {
                Zone t = new Zone();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("ZoneName"))
                {
                    t.ZoneName = v.ZoneName;
                }
                if (!v.IsColumnNull("RegionId"))
                {
                    t.RegionId = v.RegionId;
                }
                if (!v.IsColumnNull("ZoneCode"))
                {
                    t.ZoneCode = v.ZoneCode;
                }
                //if(!v.IsColumnNull("IsDeleted"))
                //      t.IsDeleted = v.IsDeleted;
                //if(!v.IsColumnNull("UpdateTime"))
                //      t.UpdateTime = v.UpdateTime;

                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
Ejemplo n.º 2
0
        public static List <int> GetDeletedIDsAfter(long LastVersion)
        {
            BLL.Zone v = new BLL.Zone();
            //v.LoadDeletedIDs(LastVersion);
            List <int> list = new List <int>();

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
Ejemplo n.º 3
0
 public static void DeleteList(List <int> list)
 {
     BLL.Zone bv = new BLL.Zone();
     foreach (int v in list)
     {
         // try to load by primary key
         bv.LoadByPrimaryKey(v);
         // if the entry doesn't exist, create it
         if (bv.RowCount > 0)
         {
             bv.MarkAsDeleted();
             bv.Save();
         }
         // populate the contents of v on the to the database list
     }
 }
Ejemplo n.º 4
0
 public static List <Zone> GetUpdatesAfter(long?lastVersion, DateTime?lastUpdateTime)
 {
     BLL.Zone v = new BLL.Zone();
     if (lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32(lastVersion.Value));
     }
     else if (lastUpdateTime.HasValue)
     {
         //v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }
     else
     {
         v.LoadAll();
     }
     return(ToList(v));
 }
Ejemplo n.º 5
0
        public static void SaveList(List <HCMIS.Desktop.GeneralLookups.zone> list)
        {
            BLL.Zone bv = new BLL.Zone();
            foreach (HCMIS.Desktop.GeneralLookups.zone v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
                if (v.ID.HasValue)
                {
                    bv.ID = v.ID.Value;
                }
                if (v.ZoneName != "" && v.ZoneName != null)
                {
                    bv.ZoneName = v.ZoneName;
                }
                if (v.RegionId.HasValue)
                {
                    bv.RegionId = v.RegionId.Value;
                }
                if (v.ZoneCode != "" && v.ZoneCode != null)
                {
                    bv.ZoneCode = v.ZoneCode;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
        public static void SaveList(List<HCMIS.Desktop.GeneralLookups.zone> list)
        {
            BLL.Zone bv = new BLL.Zone();
            foreach (HCMIS.Desktop.GeneralLookups.zone v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v.ID.Value);

                // if the entry doesn't exist, create it
                if (bv.RowCount == 0)
                {
                    bv.AddNew();
                }
                // populate the contents of v on the to the database list
                if (v.ID.HasValue)
                    bv.ID = v.ID.Value;
                if (v.ZoneName != "" && v.ZoneName != null)
                    bv.ZoneName = v.ZoneName;
                if (v.RegionId.HasValue)
                    bv.RegionId = v.RegionId.Value;
                if (v.ZoneCode != "" && v.ZoneCode != null)
                    bv.ZoneCode = v.ZoneCode;
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
 public static List<Zone> GetUpdatesAfter(long? lastVersion, DateTime? lastUpdateTime)
 {
     BLL.Zone v = new BLL.Zone();
     if (lastVersion.HasValue && lastVersion.Value != 0)
     {
         v.LoadUpdatesAfter(Convert.ToInt32(lastVersion.Value));
     }
     else if (lastUpdateTime.HasValue)
     {
         //v.LoadUpdatesAfterByTime(lastUpdateTime.Value);
     }
     else
     {
         v.LoadAll();
     }
     return ToList(v);
 }
 public static List<int> GetDeletedIDsAfter(long LastVersion)
 {
     BLL.Zone v = new BLL.Zone();
     //v.LoadDeletedIDs(LastVersion);
     List<int> list = new List<int>();
     while (!v.EOF)
     {
         list.Add((int)v.GetColumn("ID"));
         v.MoveNext();
     }
     return list;
 }
 public static List<Zone> GetAll()
 {
     BLL.Zone v = new BLL.Zone();
     v.LoadAll();
     return ToList(v);
 }
        public static void DeleteList(List<int> list)
        {
            BLL.Zone bv = new BLL.Zone();
            foreach (int v in list)
            {
                // try to load by primary key
                bv.LoadByPrimaryKey(v);
                // if the entry doesn't exist, create it
                if (bv.RowCount > 0)
                {
                    bv.MarkAsDeleted();
                    bv.Save();
                }
                // populate the contents of v on the to the database list

            }
        }
Ejemplo n.º 11
0
 public static List <Zone> GetAll()
 {
     BLL.Zone v = new BLL.Zone();
     v.LoadAll();
     return(ToList(v));
 }