Пример #1
0
 public static void DeleteList(List <int> list)
 {
     BLL.Woreda bv = new BLL.Woreda();
     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
     }
 }
Пример #2
0
        public static void SaveList(List <HCMIS.Desktop.GeneralLookups.Woreda> list)
        {
            BLL.Woreda bv = new BLL.Woreda();
            foreach (HCMIS.Desktop.GeneralLookups.Woreda 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.WoredaName != "" && v.WoredaName != null)
                {
                    bv.WoredaName = v.WoredaName;
                }
                if (v.ZoneID.HasValue)
                {
                    bv.ZoneID = v.ZoneID.Value;
                }
                if (v.WoredaCode != "" && v.WoredaCode != null)
                {
                    bv.WoredaCode = v.WoredaCode;
                }
                //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.Woreda> list)
        {
            BLL.Woreda bv = new BLL.Woreda();
            foreach (HCMIS.Desktop.GeneralLookups.Woreda 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.WoredaName != "" && v.WoredaName != null)
                    bv.WoredaName = v.WoredaName;
                if (v.ZoneID.HasValue)
                    bv.ZoneID = v.ZoneID.Value;
                if (v.WoredaCode != "" && v.WoredaCode != null)
                    bv.WoredaCode = v.WoredaCode;
                //if( v.IsDeleted.HasValue )
                //     bv.IsDeleted = v.IsDeleted.Value;
                //if( v.UpdateTime.HasValue )
                //     bv.UpdateTime = v.UpdateTime.Value;

                bv.Save();
            }
        }
        public static void DeleteList(List<int> list)
        {
            BLL.Woreda bv = new BLL.Woreda();
            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

            }
        }