Exemplo n.º 1
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.º 2
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.º 3
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.º 4
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.º 5
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.º 6
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.º 7
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.º 8
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.º 9
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.º 10
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.º 11
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.º 12
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.º 13
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.º 14
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.º 15
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();
     }
 }
        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.º 17
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.º 18
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();
                }
            }
        }
        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.º 20
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();
                }
            }
        }
Exemplo n.º 21
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.º 22
0
        public Int32 CheckMailExist(string reportId)
        {
            ConnectionManager conManager = new ConnectionManager(ConName);

            Int32 ID = 0;
            try
            {
                String sql = "GetReportID " + reportId;
                Object id = conManager.ExecuteScalarWrapper(sql);
                ID = Convert.ToInt32(id);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager.IsNotNull())
                {
                    conManager.Dispose();
                }
            }
            return ID;
        }
Exemplo n.º 23
0
        public void LoadReportTreeInfo(ref DataSet dsRef)
        {
            ConnectionManager conManager = new ConnectionManager(ConName);
            IDataReader reader = null;
            try
            {
                const String spName = "spWebReportSuite";
                conManager.OpenDataReader(out reader, spName, 1, 0);
                dsRef = Util.DataReaderToDataSet(reader);
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }

                if (reader.IsNotNull() && reader.IsClosed.IsFalse())
                    reader.Close();
            }
        }
Exemplo n.º 24
0
 public void LoadReportSourceDataSet(ref DataSet dsRef, CommandType cmdType, String strCmdText, IDbDataParameter[] sqlParam)
 {
     ConnectionManager conManager = new ConnectionManager(ConName);
     IDataReader reader = null;
     try
     {
         if (sqlParam.IsNull() || sqlParam.Length.IsZero())
             conManager.OpenDataReader(strCmdText, out reader);
         else
             conManager.OpenDataReader(out reader, strCmdText, sqlParam);
         //
         dsRef = Util.DataReaderToDataSet(reader);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (conManager != null)
         {
             conManager.CloseConnection();
             conManager.Dispose();
         }
         if (reader.IsNotNull() && reader.IsClosed.IsFalse())
             reader.Close();
     }
 }
Exemplo n.º 25
0
        public static CustomList<ReportSuiteMenu> GetReportSuiteMenu()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<ReportSuiteMenu> ReportSuiteMenuCollection = new CustomList<ReportSuiteMenu>();
            IDataReader reader = null;
            String sql = "EXEC spGetUserWiseProfileReport";
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ReportSuiteMenu newReportSuiteMenu = new ReportSuiteMenu();
                    newReportSuiteMenu.SetData(reader);
                    ReportSuiteMenuCollection.Add(newReportSuiteMenu);
                }
                return ReportSuiteMenuCollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }

                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Exemplo n.º 26
0
        public static CustomList<ReportSuiteMenu> GetReportList()
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<ReportSuiteMenu> ReportSuiteMenuCollection = new CustomList<ReportSuiteMenu>();
            IDataReader reader = null;
            String sql = "EXEC spGetReportList";
            try
            {
                conManager.OpenDataReader(sql, out reader);
                while (reader.Read())
                {
                    ReportSuiteMenu newReportSuiteMenu = new ReportSuiteMenu();
                    newReportSuiteMenu.REPORTID = reader.GetInt32("REPORTID");
                    newReportSuiteMenu.NODE_TEXT = reader.GetString("NODE_TEXT");
                    ReportSuiteMenuCollection.Add(newReportSuiteMenu);
                }
                return ReportSuiteMenuCollection;
            }
            catch (Exception ex)
            {
                throw (ex);
            }
            finally
            {
                if (conManager != null)
                {
                    conManager.CloseConnection();
                    conManager.Dispose();
                }

                if (reader != null && !reader.IsClosed)
                    reader.Close();
            }
        }
Exemplo n.º 27
0
        public static CustomList<ParameterFilterValue> GetReportValueDesig(string orgKey)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
            IDataReader reader = null;
            String sql = "select DesigKey As ActualValues, DesigName As DisplayMember, DesigName As [Values]  from Gen_Desig Where OrgKey in(" + orgKey + ")";
            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.º 28
0
        public static CustomList<ParameterFilterValue> GetReportValueEmp(string search)
        {
            ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
            CustomList<ParameterFilterValue> ParameterFilterValueCollection = new CustomList<ParameterFilterValue>();
            IDataReader reader = null;
            String sql = "Exec spReportViewerEmpSearch " + search;
            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.º 29
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.º 30
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();
                }
            }
        }