Exemplo n.º 1
0
 public static CustomList<UserProfile> GetAllUserProfile(String userCode)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<UserProfile> UserProfileCollection = new CustomList<UserProfile>();
     IDataReader reader = null;
     String sql = "select  *from UserProfile Where UserCode='" + userCode + "'";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             UserProfile newUserProfile = new UserProfile();
             newUserProfile.SetData(reader);
             UserProfileCollection.Add(newUserProfile);
         }
         return UserProfileCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 2
0
 public DataSet LoadMailInfo(Int32 ReportID)
 {
     ConnectionManager conManager = new ConnectionManager(ConName);
     IDataReader reader = null;
     try
     {
         DataSet dsRef = new DataSet();
         const String spName = "spGetMailInfo";
         conManager.OpenDataReader(out reader, spName, ReportID);
         dsRef = Util.DataReaderToDataSet(reader);
         return dsRef;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (conManager != null)
         {
             conManager.CloseConnection();
             conManager.Dispose();
         }
         if (reader.IsNotNull() && reader.IsClosed.IsFalse())
             reader.Close();
     }
 }
Exemplo n.º 3
0
 public static CustomList<LatestNews> GetAllLatestNews()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<LatestNews> LatestNewsCollection = new CustomList<LatestNews>();
     IDataReader reader = null;
     const String sql = "select *from LatestNews";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             LatestNews newLatestNews = new LatestNews();
             newLatestNews.SetData(reader);
             LatestNewsCollection.Add(newLatestNews);
         }
         LatestNewsCollection.InsertSpName = "spInsertLatestNews";
         LatestNewsCollection.UpdateSpName = "spUpdateLatestNews";
         LatestNewsCollection.DeleteSpName = "spDeleteLatestNews";
         return LatestNewsCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 4
0
 public static CustomList<GroupRule> GetAllGroupSecurityRule(string groupCode)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<GroupRule> GroupSecurityRuleCollection = new CustomList<GroupRule>();
     String sql = "Select  *from GroupRule where GroupCode='" + groupCode + "'";
     IDataReader reader = null;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             GroupRule newGroupSecurityRule = new GroupRule();
             newGroupSecurityRule.SetData(reader);
             GroupSecurityRuleCollection.Add(newGroupSecurityRule);
         }
         reader.Close();
         GroupSecurityRuleCollection.InsertSpName = "spInsertGroupRule";
         GroupSecurityRuleCollection.SelectSpName = "spDeleteGroupRule";
         return GroupSecurityRuleCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 5
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.º 6
0
 public static CustomList<Configuration> GetAllConfiguration()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<Configuration> ConfigurationCollection = new CustomList<Configuration>();
     const String sql = "Select *from tblConfiguration";
     IDataReader reader = null; ;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             Configuration newConfiguration = new Configuration();
             newConfiguration.SetData(reader);
             ConfigurationCollection.Add(newConfiguration);
         }
         reader.Close();
         ConfigurationCollection.SelectSpName = "spSelectConfiguration";
         ConfigurationCollection.InsertSpName = "spInsertConfiguration";
         ConfigurationCollection.UpdateSpName = "spUpdateConfiguration";
         ConfigurationCollection.SelectSpName = "spDeleteConfiguration";
         return ConfigurationCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 7
0
        public static CustomList<ParameterFilterValue> GetReportValue(string parent)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
            IDataReader reader = null;
            String sql = "select OrgKey As ActualValues, OrgName As DisplayMember, OrgName As [Values]  from Gen_Org Where OrgParentKey in(" + parent + ")";//'" + userCode + "'";
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ParameterFilterValue newParameterFilterValue = new ParameterFilterValue();
                    newParameterFilterValue.SetData(reader);
                    ParameterFilterValueCollection.Add(newParameterFilterValue);
                }
                return ParameterFilterValueCollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }

                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Exemplo n.º 8
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.º 9
0
 public static CustomList<ItemSubGroup> GetAllItemSubGroup()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<ItemSubGroup> ItemSubGroupCollection = new CustomList<ItemSubGroup>();
     IDataReader reader = null;
     const String sql = "select S.ItemGroupID, S.ItemSubGroupID, S.SubGroupName from ItemGroup I inner join ItemSubGroup S on S.ItemGroupID=I.ItemGroupID order by I.GroupName desc";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             ItemSubGroup newItemSubGroup = new ItemSubGroup();
             newItemSubGroup.SetData(reader);
             ItemSubGroupCollection.Add(newItemSubGroup);
         }
         ItemSubGroupCollection.InsertSpName = "spInsertItemSubGroup";
         ItemSubGroupCollection.UpdateSpName = "spUpdateItemSubGroup";
         ItemSubGroupCollection.DeleteSpName = "spDeleteItemSubGroup";
         return ItemSubGroupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 10
0
 public static CustomList<Signature> GetSignatureForUniqueCode(String sql)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<Signature> signatureCollection = new CustomList<Signature>();
     IDataReader reader = null;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         if (reader.NextResult())
         {
             while (reader.Read())
             {
                 Signature newSignature = new Signature();
                 newSignature.SetData(reader);
                 signatureCollection.Add(newSignature);
             }
         }
         return signatureCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 11
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.º 12
0
 public static CustomList<UserGroupList> GetAllUserGroupWithUserCode(string userCode)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.SysMan);
     CustomList<UserGroupList> UserGroupListCollection = new CustomList<UserGroupList>();
     String sql = "Exec spUserGroupList'" + userCode + "'";
     IDataReader reader = null;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             UserGroupList newUserGroup = new UserGroupList();
             newUserGroup.SetData(reader);
             UserGroupListCollection.Add(newUserGroup);
         }
         reader.Close();
         return UserGroupListCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 13
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.º 14
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.º 15
0
        public static Int32 GetUniqueCodeWithoutSignature(ref  ConnectionManager objCon, Boolean requiredTransaction, String strTableName, String strFieldName,
            String strPrefix)
        {
            String sql = "";
            Int32 strMaxId = 0;

            try
            {
                sql = "Exec spGetIDWithoutSignature '" +
                    strTableName + "','" + strFieldName + "','" +
                    strPrefix + "'";

                IDataReader reader;
                objCon.OpenDataReader(sql, out reader, CommandBehavior.Default, requiredTransaction);
                while (reader.Read())
                {
                    strMaxId = Convert.ToInt32(reader["MaxId"]);
                }

                reader.Close();
                return strMaxId;

            }
            catch (Exception ex)
            {
                throw (ex);
            }
        }
Exemplo n.º 16
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.º 17
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.º 18
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.º 19
0
 public static CustomList<EmployeeHKInfo> GetAllEmployeeHKInfo(Int64 empKey)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<EmployeeHKInfo> EmployeeHKInfoCollection = new CustomList<EmployeeHKInfo>();
     IDataReader reader = null;
     String sql = "select *from EmployeeHKInfo where EmpKey=" + empKey;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             EmployeeHKInfo newEmployeeHKInfo = new EmployeeHKInfo();
             newEmployeeHKInfo.SetData(reader);
             EmployeeHKInfoCollection.Add(newEmployeeHKInfo);
         }
         EmployeeHKInfoCollection.InsertSpName = "spInsertEmployeeHKInfo";
         EmployeeHKInfoCollection.UpdateSpName = "spUpdateEmployeeHKInfo";
         EmployeeHKInfoCollection.DeleteSpName = "spDeleteEmployeeHKInfo";
         return EmployeeHKInfoCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 20
0
 public static CustomList<UnitSetup> GetAllUnitSetup()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<UnitSetup> UnitSetupCollection = new CustomList<UnitSetup>();
     IDataReader reader = null;
     const String sql = "select *from UnitSetup";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             UnitSetup newUnitSetup = new UnitSetup();
             newUnitSetup.SetData(reader);
             UnitSetupCollection.Add(newUnitSetup);
         }
         UnitSetupCollection.InsertSpName = "spInsertUnitSetup";
         UnitSetupCollection.UpdateSpName = "spUpdateUnitSetup";
         UnitSetupCollection.DeleteSpName = "spDeleteUnitSetup";
         return UnitSetupCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
        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.º 22
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.º 23
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();
                }
            }
        }
Exemplo n.º 24
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.º 25
0
 public static CustomList<ContactTypeChild> GetAllContactTypeChild()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<ContactTypeChild> ContactTypeChildCollection = new CustomList<ContactTypeChild>();
     IDataReader reader = null;
     const String sql = "select *from ContactTypeChild";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             ContactTypeChild newContactTypeChild = new ContactTypeChild();
             newContactTypeChild.SetData(reader);
             ContactTypeChildCollection.Add(newContactTypeChild);
         }
         ContactTypeChildCollection.InsertSpName = "spInsertContactTypeChild";
         ContactTypeChildCollection.UpdateSpName = "spUpdateContactTypeChild";
         ContactTypeChildCollection.DeleteSpName = "spDeleteContactTypeChild";
         return ContactTypeChildCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 26
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.º 27
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.º 28
0
 public static CustomList<SegmentValues> GetAllSegmentValues(Int32 segmentNameID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<SegmentValues> SegmentValuesCollection = new CustomList<SegmentValues>();
     IDataReader reader = null;
     String sql = "select *from SegmentValues Where SegNameID=" + segmentNameID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             SegmentValues newSegmentValues = new SegmentValues();
             newSegmentValues.SetData(reader);
             SegmentValuesCollection.Add(newSegmentValues);
         }
         return SegmentValuesCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 29
0
 public static CustomList<CmnBankAccountType> GetAllCmnBankAccountType()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnBankAccountType> CmnBankAccountTypeCollection = new CustomList<CmnBankAccountType>();
     IDataReader reader = null;
     const String sql = "select * from CmnBankAccountType";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnBankAccountType newCmnBankAccountType = new CmnBankAccountType();
             newCmnBankAccountType.SetData(reader);
             CmnBankAccountTypeCollection.Add(newCmnBankAccountType);
         }
         return CmnBankAccountTypeCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
Exemplo n.º 30
0
 public static CustomList<HousekeepingHierarchy> GetAllHousekeepingHierarchy(Int32 hKID)
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<HousekeepingHierarchy> HousekeepingHierarchyCollection = new CustomList<HousekeepingHierarchy>();
     IDataReader reader = null;
     String sql = "select *from HousekeepingHierarchy where HKID=" + hKID;
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             HousekeepingHierarchy newHousekeepingHierarchy = new HousekeepingHierarchy();
             newHousekeepingHierarchy.SetData(reader);
             HousekeepingHierarchyCollection.Add(newHousekeepingHierarchy);
         }
         return HousekeepingHierarchyCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }