Exemple #1
0
        public static void SaveList(List <DisposalReasons> list)
        {
            BLL.DisposalReasons bv = new BLL.DisposalReasons();
            foreach (DisposalReasons 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.Reason != "" && v.Reason != null)
                {
                    bv.Reason = v.Reason;
                }

                bv.Save();
            }
        }
Exemple #2
0
 public static void DeleteList(List <int> list)
 {
     BLL.DisposalReasons bv = new BLL.DisposalReasons();
     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
     }
 }
Exemple #3
0
        public static List <DisposalReasons> ToList(BLL.DisposalReasons v)
        {
            List <DisposalReasons> list = new List <DisposalReasons>();

            while (!v.EOF)
            {
                DisposalReasons t = new DisposalReasons();
                if (!v.IsColumnNull("ID"))
                {
                    t.ID = v.ID;
                }
                if (!v.IsColumnNull("Reason"))
                {
                    t.Reason = v.Reason;
                }

                list.Add(t);
                v.MoveNext();
            }
            return(list);
        }
Exemple #4
0
 public static List <DisposalReasons> GetAll()
 {
     BLL.DisposalReasons v = new BLL.DisposalReasons();
     v.LoadAll();
     return(ToList(v));
 }
        public static void DeleteList(List<int> list)
        {
            BLL.DisposalReasons bv = new BLL.DisposalReasons();
            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<DisposalReasons> list)
        {
            BLL.DisposalReasons bv = new BLL.DisposalReasons();
            foreach (DisposalReasons 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.Reason != "" && v.Reason != null )
                   bv.Reason = v.Reason;

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