Example #1
0
        public static List <SupplyCategory> ToList(BLL.SupplyCategory v)
        {
            List <SupplyCategory> list = new List <SupplyCategory>();

            while (!v.EOF)
            {
                SupplyCategory t = new SupplyCategory();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("Name"))
                {
                    t.Name = v.Name;
                }
                if (!v.IsColumnNull("ParentId"))
                {
                    t.ParentId = v.ParentId;
                }
                if (!v.IsColumnNull("Code"))
                {
                    t.Code = v.Code;
                }
                //if(!v.IsColumnNull("IsDeleted"))
                //      t.IsDeleted = v.IsDeleted;
                //if(!v.IsColumnNull("UpdateTime"))
                //      t.UpdateTime = v.UpdateTime;

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

            while (!v.EOF)
            {
                list.Add((int)v.GetColumn("ID"));
                v.MoveNext();
            }
            return(list);
        }
Example #3
0
 public static void DeleteList(List <int> list)
 {
     BLL.SupplyCategory bv = new BLL.SupplyCategory();
     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
     }
 }
Example #4
0
 public static List <SupplyCategory> GetUpdatesAfter(long?lastVersion, DateTime?lastUpdateTime)
 {
     BLL.SupplyCategory v = new BLL.SupplyCategory();
     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));
 }
Example #5
0
        public static void SaveList(List <HCMIS.Desktop.DirectoryServices.SupplyCategory> list)
        {
            BLL.SupplyCategory bv = new BLL.SupplyCategory();
            foreach (HCMIS.Desktop.DirectoryServices.SupplyCategory 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.Name != "" && v.Name != null)
                {
                    bv.Name = v.Name;
                }
                if (v.ParentId.HasValue)
                {
                    bv.ParentId = v.ParentId.Value;
                }
                if (v.Code != "" && v.Code != null)
                {
                    bv.Code = v.Code;
                }
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
Example #6
0
 public static List <SupplyCategory> GetAll()
 {
     BLL.SupplyCategory v = new BLL.SupplyCategory();
     v.LoadAll();
     return(ToList(v));
 }
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.SupplyCategory> list)
        {
            BLL.SupplyCategory bv = new BLL.SupplyCategory();
            foreach (HCMIS.Desktop.DirectoryServices.SupplyCategory 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.Name != "" && v.Name != null )
                   bv.Name = v.Name;
              if( v.ParentId.HasValue )
                   bv.ParentId = v.ParentId.Value;
              if( v.Code != "" && v.Code != null )
                   bv.Code = v.Code;
              //if( v.IsDeleted.HasValue )
              //     bv.IsDeleted = v.IsDeleted.Value;
              //if( v.UpdateTime.HasValue )
              //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
 public static List<SupplyCategory> GetUpdatesAfter(long? lastVersion,DateTime? lastUpdateTime)
 {
     BLL.SupplyCategory v = new BLL.SupplyCategory();
     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.SupplyCategory v = new BLL.SupplyCategory();
     //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<SupplyCategory> GetAll()
 {
     BLL.SupplyCategory v = new BLL.SupplyCategory();
     v.LoadAll();
     return ToList(v);
 }
        public static void DeleteList(List<int> list)
        {
            BLL.SupplyCategory bv = new BLL.SupplyCategory();
            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

            }
        }