Exemplo n.º 1
0
        public void SaveBankAccount(ref CustomList<CmnBankAccount> BankAccountList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
               Boolean blnTranStarted = false;

               try
               {
               conManager.BeginTransaction();

               ReSetSPName(BankAccountList);
               Int32 accountID = BankAccountList[0].AccountID;
               blnTranStarted = true;
               if (BankAccountList[0].IsAdded)
                   accountID = Convert.ToInt32(conManager.InsertData(blnTranStarted, BankAccountList));
               else
                   conManager.SaveDataCollectionThroughCollection(blnTranStarted, BankAccountList);

               BankAccountList.AcceptChanges();

               conManager.CommitTransaction();
               blnTranStarted = false;
               }
               catch (Exception Ex)
               {
               conManager.RollBack();
               throw Ex;
               }
               finally
               {
               if (conManager.IsNotNull())
               {
                   conManager.Dispose();
               }
               }
        }
Exemplo n.º 2
0
        public void DeleteHKEntry(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;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstChild, HKList);

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

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 3
0
        public void SaveUserProfile(ref CustomList<UserProfile> UserProfileList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(UserProfileList);

                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, UserProfileList);

                UserProfileList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
        public void SaveCmnDocListTableMapping(ref CustomList<CmnDocListTableMapping> CmnDocListTableMappingList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(CmnDocListTableMappingList);
                Int64 TransactionTypeKey = CmnDocListTableMappingList[0].DocListTableMappingID;
                blnTranStarted = true;
                if (CmnDocListTableMappingList[0].IsAdded)
                    TransactionTypeKey = Convert.ToInt64(conManager.InsertData(blnTranStarted, CmnDocListTableMappingList));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, CmnDocListTableMappingList);

                CmnDocListTableMappingList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 5
0
        public void DeleteVoucher(ref CustomList<Acc_VoucherDet> VoucherDetList, ref CustomList<Acc_Voucher> VoucherList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                ReSetSPName(ref VoucherList, ref VoucherDetList);

                conManager.BeginTransaction();
                blnTranStarted = true;
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, VoucherDetList, VoucherList);
                conManager.CommitTransaction();
                VoucherDetList.AcceptChanges();
                VoucherList.AcceptChanges();
            }
            catch (Exception ex)
            {
                conManager.RollBack();
                throw (ex);
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    blnTranStarted = false;
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 6
0
        public void DeleteSecurityRule(ref CustomList<RuleDetails> objSecurityRuleDetailList, ref CustomList<SecurityRule> securityRuleList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            Boolean blnTranStarted = false;

            try
            {
                ReSetSPNameForDelete(securityRuleList, objSecurityRuleDetailList);

                conManager.BeginTransaction();
                blnTranStarted = true;
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, objSecurityRuleDetailList, securityRuleList);
                objSecurityRuleDetailList.AcceptChanges();
                securityRuleList.AcceptChanges();
                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception ex)
            {
                conManager.RollBack();
                throw (ex);
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 7
0
        public void deleteWrokFlow(ref CustomList<CmnWorkFlowMaster> lstCmnWorkFlowMaster, ref CustomList<CmnWorkFlowDetail> lstCmnWorkFlowDetail)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;
            try
            {
                conManager.BeginTransaction();
                lstCmnWorkFlowDetail.DeleteSpName = "spDeleteCmnWorkFlowDetail";
                lstCmnWorkFlowMaster.DeleteSpName = "spDeleteCmnWorkFlowMaster";
                blnTranStarted = true;
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstCmnWorkFlowDetail, lstCmnWorkFlowMaster);

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 8
0
        public void SaveFiscalYear(ref CustomList<Gen_FY> Gen_FYList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(Gen_FYList);

                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, Gen_FYList);
                //object scope_Identity = conManager.InsertData(blnTranStarted, BankKist);

                Gen_FYList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 9
0
        public void SaveMailSetup(CustomList<MailSetup> MailSetupList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
               Boolean blnTranStarted = false;

               try
               {
               conManager.BeginTransaction();
               blnTranStarted = true;
               ReSetSPName(ref MailSetupList);

               conManager.SaveDataCollectionThroughCollection(blnTranStarted, MailSetupList);

               MailSetupList.AcceptChanges();

               conManager.CommitTransaction();
               blnTranStarted = false;
               conManager.Dispose();
               }
               catch (Exception Ex)
               {
               conManager.RollBack();
               throw Ex;
               }
               finally
               {
               if (conManager.IsNotNull())
               {
                   conManager.Dispose();
               }
               }
        }
Exemplo n.º 10
0
        public void SaveUnitSetup(ref CustomList<ItemSubGroup> lstItemSubGroup)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(lstItemSubGroup);

                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstItemSubGroup);

                lstItemSubGroup.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 11
0
        public void DeleteTempData(ref CustomList<GroupRule> lstGroupSecurityRule)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            Boolean blnTranStarted = false;

            try
            {
                ReSetTempTransactionDeleteSPName(ref lstGroupSecurityRule);
                conManager.BeginTransaction();
                blnTranStarted = true;
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstGroupSecurityRule);

                lstGroupSecurityRule.AcceptChanges();
                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception ex)
            {
                conManager.RollBack();
                throw (ex);
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 12
0
        public void SaveReportPermission(ref CustomList<ReportPermission> rPList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
               Boolean blnTranStarted = false;

               try
               {
               conManager.BeginTransaction();

               ReSetSPName(rPList);

               blnTranStarted = true;

               conManager.SaveDataCollectionThroughCollection(blnTranStarted, rPList);

               rPList.AcceptChanges();

               conManager.CommitTransaction();
               blnTranStarted = false;
               conManager.Dispose();
               }
               catch (Exception Ex)
               {
               throw Ex;
               }
               finally
               {
               if (conManager.IsNotNull())
               {
                   conManager.Dispose();
               }
               }
        }
Exemplo n.º 13
0
        public void DeleteGroup(ref CustomList<UserGroup> userGroupList, ref CustomList<GroupRule> groupSecurityRuleList, ref CustomList<Group> groupList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
            Boolean blnTranStarted = false;

            try
            {
                ReSetDeleteSPName(groupList, groupSecurityRuleList, userGroupList);

                conManager.BeginTransaction();
                blnTranStarted = true;
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, userGroupList, groupSecurityRuleList, groupList);
                userGroupList.AcceptChanges();
                groupSecurityRuleList.AcceptChanges();
                groupList.AcceptChanges();
                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception ex)
            {
                conManager.RollBack();
                throw (ex);
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 14
0
        public DataSet GetAllTransactionDataSources(String StockTransID)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
               Boolean blnTranStarted = false;
               String spName = String.Empty;
               try
               {

               DataSet dsLoad = new DataSet();
               DataSet dsReturn = new DataSet();

               conManager.BeginTransaction();
               blnTranStarted = true;

               spName = String.Format("Exec sprptStorckTransactionAll  @StockTransID = '{0}'", StockTransID);
               conManager.OpenDataSetThroughAdapter(spName, ref dsLoad, true);
               dsLoad.Tables[0].TableName = "sprptStorckTransactionAll";
               dsReturn.Tables.Add(dsLoad.Tables[0].Copy());

               conManager.CommitTransaction();
               blnTranStarted = false;
               return dsReturn;
               }
               catch (Exception ex)
               {
               if (blnTranStarted)
               {
                   conManager.RollBack();
               }
               throw (ex);
               }
        }
Exemplo n.º 15
0
        public void SaveBankReconciliation(ref CustomList<Acc_Voucher> VoucherList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();
                VoucherList.UpdateSpName = "spUpdateAcc_VoucherBankReconciliation";
                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, VoucherList);

                VoucherList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 16
0
        public void SaveEntity(ref CustomList<EntityList> EntityList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
               Boolean blnTranStarted = false;

               try
               {
               conManager.BeginTransaction();

               ReSetSPName(EntityList);

               blnTranStarted = true;

               conManager.SaveDataCollectionThroughCollection(blnTranStarted, EntityList);

               conManager.CommitTransaction();
               blnTranStarted = false;
               conManager.Dispose();
               }
               catch (Exception Ex)
               {
               conManager.RollBack();
               throw Ex;
               }
               finally
               {
               if (conManager.IsNotNull())
               {
                   conManager.Dispose();
               }
               }
        }
Exemplo n.º 17
0
        public void SaveItemSegment(ref CustomList<SegmentNames> lstSegmentNames, ref CustomList<SegmentValues> lstSegmentValues)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(lstSegmentNames, lstSegmentValues);
                Int32 SegNameID = lstSegmentNames[0].SegNameID;
                blnTranStarted = true;
                if (lstSegmentNames[0].IsAdded)
                    SegNameID = Convert.ToInt32(conManager.InsertData(blnTranStarted, lstSegmentNames));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstSegmentNames);
                var SegmentValues = (CustomList<SegmentValues>)lstSegmentValues;
                SegmentValues.ForEach(x => x.SegNameID = SegNameID);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, SegmentValues);

                lstSegmentNames.AcceptChanges();
                lstSegmentValues.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
        public void SaveDocListFormat(ref CustomList<CmnDocListFormat> DocListFormatList, ref CustomList<CmnDocListFormatDetail> DocListFormatDetailList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(DocListFormatList, DocListFormatDetailList);
                Int32 docListFormatKey = DocListFormatList[0].DocListFormatID;
                blnTranStarted = true;
                if (DocListFormatList[0].IsAdded)
                    docListFormatKey = Convert.ToInt32(conManager.InsertData(blnTranStarted, DocListFormatList));
                 else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, DocListFormatList);
                var docListFormatDetail = (CustomList<CmnDocListFormatDetail>)DocListFormatDetailList;
                docListFormatDetail.ForEach(x => x.DocListFormatID = docListFormatKey);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, docListFormatDetail);

                DocListFormatList.AcceptChanges();
                DocListFormatDetailList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 19
0
        public void SaveBank(ref CustomList<Gen_Bank> BankMasterList, ref CustomList<Bank_Branch> BankBranchList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(BankMasterList, BankBranchList);
                Int32 bankKey = BankMasterList[0].BankKey;
                blnTranStarted = true;
                if (BankMasterList[0].IsAdded)
                    bankKey = Convert.ToInt32(conManager.InsertData(blnTranStarted, BankMasterList));
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, BankMasterList);
                var bankBranch = (CustomList<Bank_Branch>)BankBranchList;
                bankBranch.ForEach(x => x.BankKey = bankKey);
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, bankBranch);

                BankMasterList.AcceptChanges();
                BankBranchList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 20
0
        public void SaveItemMaster(ref CustomList<ItemMaster> ItemMasterList)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(ItemMasterList);

                GetNewItemCode(ref conManager, ref ItemMasterList);

                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, ItemMasterList);

                ItemMasterList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 21
0
        public void Save(ref CustomList<Acc_COA> list)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                list.InsertSpName = "spInsertAcc_COA";
                list.UpdateSpName = "spUpdateAcc_COA";
                list.DeleteSpName = "spDeleteAcc_COA";

                blnTranStarted = true;

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, list);

                conManager.CommitTransaction();
                list.AcceptChanges();

                blnTranStarted = false;
                conManager.Dispose();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 22
0
        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();
                }
            }
        }
Exemplo n.º 23
0
        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();
                }
            }
        }
Exemplo n.º 24
0
        //End
        //Search Voucher
        //public CustomList<Acc_Voucher> GetAllAcc_VoucherSearch(string searchStr, string blank)
        //{
        //    return Acc_Voucher.GetAllAcc_VoucherSearch(searchStr, blank);
        //}
        //end
        public void SavePFVoucher(ref CustomList<Acc_Voucher> AccVoucherList, ref CustomList<Acc_VoucherDet> AccVoucherDetList, string prifix)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                blnTranStarted = true;
                conManager.BeginTransaction();

                ReSetSPName(ref AccVoucherList, ref AccVoucherDetList);
                if (AccVoucherList[0].VoucherNo.IsNullOrEmpty())
                {
                    GetNewVoucherID(ref conManager, blnTranStarted, ref AccVoucherList, prifix);
                }
                else
                {
                    string[] items = AccVoucherList[0].VoucherNo.Split('-');
                    if (prifix != items[0])
                    {
                        string prifix1 = prifix + "-" + items[1];
                        voucherID = prifix1;
                        AccVoucherList[0].VoucherNo = prifix1;
                    }
                    else
                        voucherID = AccVoucherList[0].VoucherNo;
                }
                blnTranStarted = true;

                if (AccVoucherList[0].IsAdded)
                {
                    object scope_Identity = conManager.InsertData(blnTranStarted, AccVoucherList);
                    AccVoucherList[0].VoucherKey = Convert.ToInt64(scope_Identity);
                }
                else
                {
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, AccVoucherList);
                }
                CustomList<Acc_VoucherDet> AddedVoucherDetList = AccVoucherDetList.FindAll(f => f.IsAdded);
                foreach (Acc_VoucherDet aVD in AddedVoucherDetList)
                {
                    aVD.VoucherKey = AccVoucherList[0].VoucherKey;
                }
                conManager.SaveDataCollectionThroughCollection(blnTranStarted, AccVoucherDetList);

                conManager.CommitTransaction();
                AccVoucherList.AcceptChanges();
                AccVoucherDetList.AcceptChanges();
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    blnTranStarted = false;
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 25
0
        public void SaveContactInfo(ref CustomList<ContactInfo> ContactInfoList, ref CustomList<ContactDetail> lstContactDetail)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                blnTranStarted = true;

                ReSetSPName(ContactInfoList, lstContactDetail);

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, lstContactDetail, ContactInfoList);

                lstContactDetail.AcceptChanges();
                ContactInfoList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 26
0
        public void SaveContactInfo(ref CustomList<ContactInfo> ContactInfoList, ref CustomList<ContactType> ContactTypeList, ref CustomList<ContactTypeChild> ContactTypeChildList, ref CustomList<ContactDetail> lstContactDetail)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            Boolean blnTranStarted = false;

            try
            {
                conManager.BeginTransaction();

                ReSetSPName(ContactInfoList, ContactTypeList, ContactTypeChildList);
                Int32 contactID = ContactInfoList[0].ContactID;
                blnTranStarted = true;
                if (ContactInfoList[0].IsAdded)
                {
                    contactID = Convert.ToInt32(conManager.InsertData(blnTranStarted, ContactInfoList));
                    ContactInfoList[0].ContactID = contactID;
                }
                else
                    conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactInfoList);

                foreach (ContactType cT in ContactTypeList)
                {
                    CustomList<ContactType> ContactType_List = new CustomList<ContactType>();
                    if (cT.IsAdded)
                    {
                        Int32 contactTypeID = 0;
                        ContactType_List.Add(cT);
                        ContactType_List.InsertSpName = "spInsertContactType";
                        contactTypeID = Convert.ToInt32(conManager.InsertData(blnTranStarted, ContactType_List));
                        cT.ContactTypeID = contactTypeID;
                    }
                    if (cT.IsModified)
                    {
                        cT.SetModified();
                        ContactType_List.Add(cT);
                        ContactType_List.UpdateSpName = "spUpdateContactType";
                        conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactType_List);
                    }
                }
                CustomList<ContactDetail> ContactDetailList = new CustomList<ContactDetail>();
                foreach (ContactType cT in ContactTypeList)
                {
                    if (cT.IsChecked)
                    {
                        ContactDetail contactDetail = new ContactDetail();
                        contactDetail.ContactTypeID = cT.ContactTypeID;
                        contactDetail.ContactID = contactID;
                        ContactDetailList.Add(contactDetail);
                    }
                }
                foreach (ContactDetail cD in lstContactDetail)
                {
                    ContactDetail obj = ContactDetailList.Find(f => f.ContactTypeID == cD.ContactTypeID);
                    if (obj.IsNotNull())
                        obj.SetModified();
                    else
                    {
                        cD.Delete();
                        ContactDetailList.Add(cD);
                    }

                }

                ReSetSPName(ContactDetailList);

                conManager.SaveDataCollectionThroughCollection(blnTranStarted, ContactDetailList);

                ContactInfoList.AcceptChanges();
                ContactTypeList.AcceptChanges();
                ContactTypeChildList.AcceptChanges();
                ContactDetailList.AcceptChanges();

                conManager.CommitTransaction();
                blnTranStarted = false;
            }
            catch (Exception Ex)
            {
                conManager.RollBack();
                throw Ex;
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
        }
Exemplo n.º 27
0
        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();
                }
            }
        }