public static void SaveList(List <HCMIS.Desktop.DirectoryServices.SubSubAccount> list)
        {
            BLL.Activity bv = new BLL.Activity();
            foreach (HCMIS.Desktop.DirectoryServices.SubSubAccount 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.StoreName = v.Name;
                }
                if (v.SubAccountID.HasValue)
                {
                    bv.StoreGroupDivisionID = v.SubAccountID.Value;
                }

                bv.Save();
            }
        }
 private void CostAnalysis_Load(object sender, EventArgs e)
 {
     gridJournal.DataSource = dvJournal;
     var store = new BLL.Activity();
     store.LoadByPrimaryKey(storeID);
     textEdit1.EditValue = store.Name;
     var supplier = new BLL.Supplier();
     supplier.LoadByPrimaryKey(supplierID);
     textEdit2.EditValue = supplier.CompanyName;
 }
Exemplo n.º 3
0
        private void CostAnalysis_Load(object sender, EventArgs e)
        {
            gridJournal.DataSource = dvJournal;
            var store = new BLL.Activity();

            store.LoadByPrimaryKey(storeID);
            textEdit1.EditValue = store.Name;
            var supplier = new BLL.Supplier();

            supplier.LoadByPrimaryKey(supplierID);
            textEdit2.EditValue = supplier.CompanyName;
        }
 public static void DeleteList(List <int> list)
 {
     BLL.Activity bv = new BLL.Activity();
     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 DeleteList(List<int> list)
        {
            BLL.Activity bv = new BLL.Activity();
            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.SubSubAccount> list)
        {
            BLL.Activity bv = new BLL.Activity();
            foreach (HCMIS.Desktop.DirectoryServices.SubSubAccount 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.StoreName = v.Name;
                if (v.SubAccountID.HasValue)
                    bv.StoreGroupDivisionID = v.SubAccountID.Value;

                bv.Save();
            }
        }