コード例 #1
0
        public static void SaveList(List <HCMIS.Desktop.DirectoryServices.VEN> list)
        {
            BLL.VEN bv = new BLL.VEN();
            foreach (HCMIS.Desktop.DirectoryServices.VEN 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.Value != "" && v.Value != null)
                {
                    bv.Value = v.Value;
                }
                if (v.Description != "" && v.Description != null)
                {
                    bv.Description = v.Description;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
コード例 #2
0
        public static List <VEN> ToList(BLL.VEN v)
        {
            List <VEN> list = new List <VEN>();

            while (!v.EOF)
            {
                VEN t = new VEN();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("Value"))
                {
                    t.Value = v.Value;
                }
                if (!v.IsColumnNull("Description"))
                {
                    t.Description = v.Description;
                }
                //if(!v.IsColumnNull("IsDeleted"))
                //      t.IsDeleted = v.IsDeleted;
                //if(!v.IsColumnNull("UpdateTime"))
                //      t.UpdateTime = v.UpdateTime;

                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
コード例 #3
0
        public static List <int> GetDeletedIDsAfter(long LastVersion)
        {
            BLL.VEN v = new BLL.VEN();
            //v.LoadDeletedIDs(LastVersion);
            List <int> list = new List <int>();

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
コード例 #4
0
 public static void DeleteList(List <int> list)
 {
     BLL.VEN bv = new BLL.VEN();
     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
     }
 }
コード例 #5
0
 public static List <VEN> GetUpdatesAfter(long?lastVersion, DateTime?lastUpdateTime)
 {
     BLL.VEN v = new BLL.VEN();
     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));
 }
コード例 #6
0
 public static List <VEN> GetAll()
 {
     BLL.VEN v = new BLL.VEN();
     v.LoadAll();
     return(ToList(v));
 }
コード例 #7
0
        public static void DeleteList(List<int> list)
        {
            BLL.VEN bv = new BLL.VEN();
            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

            }
        }
コード例 #8
0
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.VEN> list)
        {
            BLL.VEN bv = new BLL.VEN();
            foreach (HCMIS.Desktop.DirectoryServices.VEN 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.Value != "" && v.Value != null )
                   bv.Value = v.Value;
              if( v.Description != "" && v.Description != null )
                   bv.Description = v.Description;
              //if( v.IsDeleted.HasValue )
              //     bv.IsDeleted = v.IsDeleted.Value;
              //if( v.UpdateTime.HasValue )
              //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
コード例 #9
0
 public static List<VEN> GetUpdatesAfter(long? lastVersion,DateTime? lastUpdateTime)
 {
     BLL.VEN v = new BLL.VEN();
     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);
 }
コード例 #10
0
 public static List<int> GetDeletedIDsAfter(long LastVersion)
 {
     BLL.VEN v = new BLL.VEN();
     //v.LoadDeletedIDs(LastVersion);
     List<int> list = new List<int>();
     while (!v.EOF)
     {
         list.Add((int)v.GetColumn("ID"));
         v.MoveNext();
     }
     return list;
 }
コード例 #11
0
 public static List<VEN> GetAll()
 {
     BLL.VEN v = new BLL.VEN();
     v.LoadAll();
     return ToList(v);
 }