Esempio n. 1
0
        public static void SaveList(List <HCMIS.Desktop.DirectoryServices.ItemSupplyCategory> list)
        {
            BLL.ItemSupplyCategory bv = new BLL.ItemSupplyCategory();
            foreach (HCMIS.Desktop.DirectoryServices.ItemSupplyCategory 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.ItemID.HasValue)
                {
                    bv.ItemID = v.ItemID.Value;
                }
                if (v.CategoryID.HasValue)
                {
                    bv.CategoryID = v.CategoryID.Value;
                }

                bv.Save();
            }
        }
Esempio n. 2
0
        public static List <ItemSupplyCategory> ToList(BLL.ItemSupplyCategory v)
        {
            List <ItemSupplyCategory> list = new List <ItemSupplyCategory>();

            while (!v.EOF)
            {
                ItemSupplyCategory t = new ItemSupplyCategory();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("ItemID"))
                {
                    t.ItemID = v.ItemID;
                }
                if (!v.IsColumnNull("CategoryID"))
                {
                    t.CategoryID = v.CategoryID;
                }


                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
Esempio n. 3
0
 public static void DeleteList(List <int> list)
 {
     BLL.ItemSupplyCategory bv = new BLL.ItemSupplyCategory();
     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
     }
 }
Esempio n. 4
0
 public static List <ItemSupplyCategory> GetAll()
 {
     BLL.ItemSupplyCategory v = new BLL.ItemSupplyCategory();
     v.LoadAll();
     return(ToList(v));
 }
        public static void DeleteList(List<int> list)
        {
            BLL.ItemSupplyCategory bv = new BLL.ItemSupplyCategory();
            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

            }
        }
        public static void SaveList(List<HCMIS.Desktop.DirectoryServices.ItemSupplyCategory> list)
        {
            BLL.ItemSupplyCategory bv = new BLL.ItemSupplyCategory();
            foreach (HCMIS.Desktop.DirectoryServices.ItemSupplyCategory 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.ItemID.HasValue )
                   bv.ItemID = v.ItemID.Value;
              if( v.CategoryID.HasValue )
                   bv.CategoryID = v.CategoryID.Value;

                bv.Save();
            }
        }
 public static List<ItemSupplyCategory> GetAll()
 {
     BLL.ItemSupplyCategory v = new BLL.ItemSupplyCategory();
     v.LoadAll();
     return ToList(v);
 }