当前位置: 首页>>代码示例>>C#>>正文


C# CustomList.ForEach方法代码示例

本文整理汇总了C#中CustomList.ForEach方法的典型用法代码示例。如果您正苦于以下问题:C# CustomList.ForEach方法的具体用法?C# CustomList.ForEach怎么用?C# CustomList.ForEach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomList的用法示例。


在下文中一共展示了CustomList.ForEach方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SaveHKEntry

        public void SaveHKEntry(ref CustomList<HouseKeepingValue> HKList, ref CustomList<HousekeepingHierarchy> lstChild)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(HKList, lstChild);

                blnTranStarted = true;

                Int32 HKID = HKList[0].HKID;
                blnTranStarted = true;
                if (HKList[0].IsAdded)
                    HKID = Convert.ToInt32(conManager.InsertData(blnTranStarted, HKList));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, HKList);
                lstChild.ForEach(x => x.HKID = HKID);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstChild);

                HKList.AcceptChanges();
                lstChild.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:42,代码来源:HKEntryManager.cs

示例2: SaveWorkFlow

        public void SaveWorkFlow(ref CustomList<CmnWorkFlowMaster> CmnWorkFlowMasterList, ref CustomList<CmnWorkFlowDetail> CmnWorkFlowDetailList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(CmnWorkFlowMasterList, CmnWorkFlowDetailList);
                  workFlowID = CmnWorkFlowMasterList[0].WorkFlowID;
                blnTranStarted = true;
                if (CmnWorkFlowMasterList[0].IsAdded)
                    workFlowID = Convert.ToInt32(conManager.InsertData(blnTranStarted, CmnWorkFlowMasterList));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, CmnWorkFlowMasterList);

                CmnWorkFlowDetailList.ForEach(x => x.WorkFlowID = workFlowID);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, CmnWorkFlowDetailList);

                CmnWorkFlowMasterList.AcceptChanges();
                CmnWorkFlowDetailList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:39,代码来源:WorkFlowManager.cs

示例3: SaveStockTransaction

        public void SaveStockTransaction(ref CustomList<StockTransactionMaster> lstStockTransactionMaster, ref CustomList<StockTransactionDetail> lstStockTransactionDetail)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(lstStockTransactionMaster, lstStockTransactionDetail);
                GetNewStockTransaction(ref conManager, ref lstStockTransactionMaster);
                Int64 StockTransID = lstStockTransactionMaster[0].StockTransID;
                blnTranStarted = true;
                if (lstStockTransactionMaster[0].IsAdded)
                    StockTransID = Convert.ToInt32(conManager.InsertData(blnTranStarted, lstStockTransactionMaster));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstStockTransactionMaster);
                lstStockTransactionDetail.ForEach(x => x.StockTransID = StockTransID);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstStockTransactionDetail);

                lstStockTransactionMaster.AcceptChanges();
                lstStockTransactionDetail.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
开发者ID:samnuriu13,项目名称:APIXERP,代码行数:39,代码来源:StockTransactionManager.cs


注:本文中的CustomList.ForEach方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。