Пример #1
0
        public void DeleteRoleMapping(int roleId)
        {
            IGenericDataRepository <tbl_Roles>             roleRepository = new GenericDataRepository <tbl_Roles>();
            IGenericDataRepository <tbl_RoleScreenMapping> roleScreenMappingRepository = new GenericDataRepository <tbl_RoleScreenMapping>();

            try
            {
                var rolesScreenMapping = roleRepository.GetAll(a => a.tbl_RoleScreenMapping).SingleOrDefault(a => a.RoleID == roleId);

                if (rolesScreenMapping != null)
                {
                    foreach (var roleScreen in rolesScreenMapping.tbl_RoleScreenMapping
                             .Where(at => at.RoleID == roleId).ToList())
                    {
                        roleScreen.EntityState = DA.DomainModel.EntityState.Deleted;
                        roleScreenMappingRepository.Remove(roleScreen);
                    }

                    rolesScreenMapping.EntityState = DA.DomainModel.EntityState.Deleted;
                    roleRepository.Remove(rolesScreenMapping);
                    //repository.SaveChanges();
                }
                //var roles = repository1.GetAll(b => b.tbl_Roles).SingleOrDefault(b => b.RoleID == roleId);
                //roles.EntityState = DA.DomainModel.EntityState.Deleted;
                //repository1.Remove(roles);
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #2
0
        public void DeleteReport(string postData, int id)
        {
            try
            {
                tbl_Reports tblReport = new tbl_Reports();

                IList <tbl_Reports> lstReports = GetReports(id);
                var isExisting = lstReports.Where(q => q.ReportName == postData && q.daId == id);

                tblReport.EntityState = EntityState.Deleted;

                if (isExisting != null)
                {
                    foreach (var item in isExisting)
                    {
                        IGenericDataRepository <tbl_Reports> repository = new GenericDataRepository <tbl_Reports>();
                        tblReport.daId           = item.daId;
                        tblReport.ReportDesc     = item.ReportDesc;
                        tblReport.ReportID       = item.ReportID;
                        tblReport.ReportName     = item.ReportName;
                        tblReport.ReqReference   = item.ReqReference;
                        tblReport.SourceID       = item.SourceID;
                        tblReport.IsLinked       = item.IsLinked;
                        tblReport.PeriodID       = item.PeriodID;
                        tblReport.TransactionSeq = item.TransactionSeq;
                        tblReport.EntityState    = EntityState.Deleted;
                        repository.Remove(tblReport);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #3
0
 public void DeleteTransaction(tbl_Transactions tblTransactions)
 {
     try
     {
         IGenericDataRepository <tbl_Transactions> repository = new GenericDataRepository <tbl_Transactions>();
         repository.Remove(tblTransactions);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #4
0
 public void DeleteDestination(tbl_Destination tblDestination)
 {
     try
     {
         IGenericDataRepository <tbl_Destination> repository = new GenericDataRepository <tbl_Destination>();
         repository.Remove(tblDestination);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #5
0
 public void DeleteDistributionType(tbl_DistributionType tblDistributionType)
 {
     try
     {
         IGenericDataRepository <tbl_DistributionType> repository = new GenericDataRepository <tbl_DistributionType>();
         repository.Remove(tblDistributionType);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #6
0
 public void DeleteLOB(tbl_LOB tblLOB)
 {
     try
     {
         IGenericDataRepository <tbl_LOB> repository = new GenericDataRepository <tbl_LOB>();
         repository.Remove(tblLOB);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #7
0
 public void DeleteFrequencyType(tbl_FrequencyType tblFrequencyTypes)
 {
     try
     {
         IGenericDataRepository <tbl_FrequencyType> repository = new GenericDataRepository <tbl_FrequencyType>();
         repository.Remove(tblFrequencyTypes);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #8
0
 public void DeleteDA(tbl_DesignAccelerator tblDesignAccelerator)
 {
     try
     {
         IGenericDataRepository <tbl_DesignAccelerator> repository = new GenericDataRepository <tbl_DesignAccelerator>();
         repository.Remove(tblDesignAccelerator);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #9
0
 public void DeleteBuzProd(tbl_BuzProd tblbuzprod)
 {
     try
     {
         IGenericDataRepository <tbl_BuzProd> repository = new GenericDataRepository <tbl_BuzProd>();
         repository.Remove(tblbuzprod);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #10
0
 public void DeleteAttribute(tbl_Attribute tblAttribute)
 {
     try
     {
         IGenericDataRepository <tbl_Attribute> repository = new GenericDataRepository <tbl_Attribute>();
         repository.Remove(tblAttribute);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #11
0
 public void DeleteSource(tbl_Source tblSource)
 {
     try
     {
         IGenericDataRepository <tbl_Source> repository = new GenericDataRepository <tbl_Source>();
         repository.Remove(tblSource);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #12
0
 public void DeleteAppVersion(tbl_AppVersion tblAppVersion)
 {
     try
     {
         IGenericDataRepository <tbl_AppVersion> repository = new GenericDataRepository <tbl_AppVersion>();
         repository.Remove(tblAppVersion);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #13
0
 public void DeleteLifeCycle(tbl_LifeCycle tblLifeCycles)
 {
     try
     {
         IGenericDataRepository <tbl_LifeCycle> repository = new GenericDataRepository <tbl_LifeCycle>();
         repository.Remove(tblLifeCycles);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #14
0
 public void DeleteProduct(tbl_Products tblProducts)
 {
     try
     {
         IGenericDataRepository <tbl_Products> repository = new GenericDataRepository <tbl_Products>();
         repository.Remove(tblProducts);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #15
0
 public void DeleteModule(tbl_Module tblModule)
 {
     try
     {
         IGenericDataRepository <tbl_Module> repository = new GenericDataRepository <tbl_Module>();
         repository.Remove(tblModule);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #16
0
 public void DeletePeriodType(tbl_PeriodType tblPeriodType)
 {
     try
     {
         IGenericDataRepository <tbl_PeriodType> repository = new GenericDataRepository <tbl_PeriodType>();
         repository.Remove(tblPeriodType);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #17
0
 public void DeleteClient(tbl_Clients tblClient)
 {
     try
     {
         IGenericDataRepository <tbl_Clients> repository = new GenericDataRepository <tbl_Clients>();
         repository.Remove(tblClient);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #18
0
 public void DeleteUserData(tbl_UserData tblUserData)
 {
     try
     {
         IGenericDataRepository <tbl_UserData> repository = new GenericDataRepository <tbl_UserData>();
         repository.Remove(tblUserData);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #19
0
 public void DeleteMappedScreenRole(tbl_RoleScreenMapping roleScreenMapping)
 {
     try
     {
         IGenericDataRepository <tbl_RoleScreenMapping> repository = new GenericDataRepository <tbl_RoleScreenMapping>();
         var a = repository.GetSingle(q => q.RoleScreenMappingID == roleScreenMapping.RoleScreenMappingID);
         repository.Remove(roleScreenMapping);
     }
     catch (Exception)
     {
         throw;
     }
 }
Пример #20
0
        /// <summary>
        /// Validate and Remove a record
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="M"></typeparam>
        /// <param name="checkForeingKeys"></param>
        /// <param name="excludedForeingKeys"></param>
        /// <param name="dataRepository"></param>
        /// <param name="item"></param>
        public static void Remove <T, M>(bool checkForeingKeys, string[] excludedForeingKeys, GenericDataRepository <T, M> dataRepository, object item)
            where T : class
            where M : class
        {
            //remove with validation
            string[] errors         = new string[] { };
            string   exceptionTrace = "";

            if (!dataRepository.Remove(checkForeingKeys, excludedForeingKeys, ref errors, ref exceptionTrace, (T)item))
            {
                if (errors.Length > 0)
                {
                    throw new ArgumentException(String.Join("\r\n", errors));
                }
                else if (!String.IsNullOrEmpty(exceptionTrace))
                {
                    throw new DataException(exceptionTrace);
                }
                else
                {
                    throw new ArgumentException("Unknown error happened.\n");
                }
            }
        }
Пример #21
0
 public void Remove(params T[] items)
 {
     _repository.Remove(items);
 }
Пример #22
0
        public void DeleteChangePassword(tbl_ChangePassword tblChangePassword)
        {
            IGenericDataRepository <tbl_ChangePassword> repository = new GenericDataRepository <tbl_ChangePassword>();

            repository.Remove(tblChangePassword);
        }
Пример #23
0
        //public int SaveDataInterface(IList<tbl_Interface> tblInterface)
        //{
        //    try
        //    {
        //        IGenericDataRepository<tbl_Interface> repository = new GenericDataRepository<tbl_Interface>();
        //        foreach (var item in tblInterface)
        //            repository.Add(item);
        //        return 1;
        //    }
        //    catch (Exception ex)
        //    {
        //        return 0;
        //    }

        //}


        public void DeleteInterfaceAttr(int id)
        {
            try
            {
                tbl_Interface            objtblinterface          = new tbl_Interface();
                tbl_InterfaceAttrMapping objinterfaceMapping      = new tbl_InterfaceAttrMapping();
                IGenericDataRepository <tbl_Interface> repository = new GenericDataRepository <tbl_Interface>();
                IList <tbl_Interface> lstInterfaceid = repository.GetList(q => q.InterfaceID.Equals(id));
                IGenericDataRepository <tbl_InterfaceAttrMapping> repository1 = new GenericDataRepository <tbl_InterfaceAttrMapping>();

                if (lstInterfaceid != null)
                {
                    foreach (var item in lstInterfaceid)
                    {
                        objtblinterface.daId = item.daId;
                        objtblinterface.InterfaceAttrMapID = item.InterfaceAttrMapID;
                        objtblinterface.InterfaceID        = item.InterfaceID;
                        objtblinterface.TransactionSeq     = item.TransactionSeq;
                        objtblinterface.EntityState        = EntityState.Deleted;

                        IList <tbl_InterfaceAttrMapping> lstInterfaceMapId = repository1.GetList(q => q.InterfaceAttrMapID.Equals(item.InterfaceAttrMapID));

                        if (lstInterfaceMapId != null)
                        {
                            foreach (var item1 in lstInterfaceMapId)
                            {
                                objinterfaceMapping.AttrID1            = item1.AttrID1;
                                objinterfaceMapping.AttrID2            = item1.AttrID2;
                                objinterfaceMapping.AttrID3            = item1.AttrID3;
                                objinterfaceMapping.AttrID4            = item1.AttrID4;
                                objinterfaceMapping.AttrID5            = item1.AttrID5;
                                objinterfaceMapping.AttrID6            = item1.AttrID6;
                                objinterfaceMapping.AttrID7            = item1.AttrID7;
                                objinterfaceMapping.AttrID8            = item1.AttrID8;
                                objinterfaceMapping.AttrID9            = item1.AttrID9;
                                objinterfaceMapping.AttrID10           = item1.AttrID10;
                                objinterfaceMapping.AttrValueID1       = item1.AttrValueID1;
                                objinterfaceMapping.AttrValueID2       = item1.AttrValueID2;
                                objinterfaceMapping.AttrValueID3       = item1.AttrValueID3;
                                objinterfaceMapping.AttrValueID4       = item1.AttrValueID4;
                                objinterfaceMapping.AttrValueID5       = item1.AttrValueID5;
                                objinterfaceMapping.AttrValueID6       = item1.AttrValueID6;
                                objinterfaceMapping.AttrValueID7       = item1.AttrValueID7;
                                objinterfaceMapping.AttrValueID8       = item1.AttrValueID8;
                                objinterfaceMapping.AttrValueID9       = item1.AttrValueID9;
                                objinterfaceMapping.AttrValueID10      = item1.AttrValueID10;
                                objinterfaceMapping.InterfaceAttrMapID = item1.InterfaceAttrMapID;
                                objinterfaceMapping.InterfaceDesc      = item1.InterfaceDesc;
                                objinterfaceMapping.ModeTypeId         = item1.ModeTypeId;
                                objinterfaceMapping.ReqReference       = item1.ReqReference;
                                objinterfaceMapping.SourceId           = item1.SourceId;
                                objinterfaceMapping.DestinationId      = item1.DestinationId;

                                objinterfaceMapping.EntityState = EntityState.Deleted;

                                repository1.Remove(objinterfaceMapping);
                            }
                        }

                        repository.Remove(objtblinterface);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #24
0
        public void DeleteBuzrulattrmap(int id)
        {
            try
            {
                tbl_BusinessRule        objBusinessRule      = new tbl_BusinessRule();
                tbl_BuzRulesAttrMapping objtblBuzRuleAttrMap = new tbl_BuzRulesAttrMapping();
                IGenericDataRepository <tbl_BusinessRule>        repository  = new GenericDataRepository <tbl_BusinessRule>();
                IGenericDataRepository <tbl_BuzRulesAttrMapping> repository1 = new GenericDataRepository <tbl_BuzRulesAttrMapping>();
                IList <tbl_BusinessRule> lstBusinessRule = repository.GetList(q => q.BuzRuleID == id);

                if (lstBusinessRule != null)
                {
                    foreach (var item in lstBusinessRule)
                    {
                        objBusinessRule.BuzRuleID        = item.BuzRuleID;
                        objBusinessRule.BuzRuleAttrMapID = item.BuzRuleAttrMapID;
                        objBusinessRule.daId             = item.daId;
                        objBusinessRule.TransactionSeq   = item.TransactionSeq;
                        objBusinessRule.EntityState      = EntityState.Deleted;
                        var buzruleId = item.BuzRuleAttrMapID;

                        IList <tbl_BuzRulesAttrMapping> lstBuzRuleMapId = repository1.GetList(q => q.BuzRulesAttrMapID.Equals(item.BuzRuleAttrMapID));

                        if (lstBuzRuleMapId != null)
                        {
                            foreach (var item1 in lstBuzRuleMapId)
                            {
                                objtblBuzRuleAttrMap.AttrID1           = item1.AttrID1;
                                objtblBuzRuleAttrMap.AttrID2           = item1.AttrID2;
                                objtblBuzRuleAttrMap.AttrID3           = item1.AttrID3;
                                objtblBuzRuleAttrMap.AttrID4           = item1.AttrID4;
                                objtblBuzRuleAttrMap.AttrID5           = item1.AttrID5;
                                objtblBuzRuleAttrMap.AttrID6           = item1.AttrID6;
                                objtblBuzRuleAttrMap.AttrID7           = item1.AttrID7;
                                objtblBuzRuleAttrMap.AttrID8           = item1.AttrID8;
                                objtblBuzRuleAttrMap.AttrID9           = item1.AttrID9;
                                objtblBuzRuleAttrMap.AttrID10          = item1.AttrID10;
                                objtblBuzRuleAttrMap.AttrValueID1      = item1.AttrValueID1;
                                objtblBuzRuleAttrMap.AttrValueID2      = item1.AttrValueID2;
                                objtblBuzRuleAttrMap.AttrValueID3      = item1.AttrValueID3;
                                objtblBuzRuleAttrMap.AttrValueID4      = item1.AttrValueID4;
                                objtblBuzRuleAttrMap.AttrValueID5      = item1.AttrValueID5;
                                objtblBuzRuleAttrMap.AttrValueID6      = item1.AttrValueID6;
                                objtblBuzRuleAttrMap.AttrValueID7      = item1.AttrValueID7;
                                objtblBuzRuleAttrMap.AttrValueID8      = item1.AttrValueID8;
                                objtblBuzRuleAttrMap.AttrValueID9      = item1.AttrValueID9;
                                objtblBuzRuleAttrMap.AttrValueID10     = item1.AttrValueID10;
                                objtblBuzRuleAttrMap.BuzRuleDesc       = item1.BuzRuleDesc;
                                objtblBuzRuleAttrMap.BuzRulesAttrMapID = item1.BuzRulesAttrMapID;
                                objtblBuzRuleAttrMap.Remarks           = item1.Remarks;
                                objtblBuzRuleAttrMap.ReqReference      = item1.ReqReference;
                                objtblBuzRuleAttrMap.EntityState       = EntityState.Deleted;

                                repository1.Remove(objtblBuzRuleAttrMap);
                            }
                        }

                        repository.Remove(objBusinessRule);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #25
0
        public void DeleteChannelAttrMapId(int id)
        {
            try
            {
                tbl_ChannelAlert tblchannelAlert = new tbl_ChannelAlert();
                IGenericDataRepository <tbl_ChannelAlert> repository             = new GenericDataRepository <tbl_ChannelAlert>();
                tbl_ChannelAlertAttrMapping objtblChannelAlertMapping            = new tbl_ChannelAlertAttrMapping();
                IGenericDataRepository <tbl_ChannelAlertAttrMapping> repository1 = new GenericDataRepository <tbl_ChannelAlertAttrMapping>();

                IList <tbl_ChannelAlert> lstChannelalert = repository.GetList(q => q.ChannelAlertID.Equals(id));

                if (lstChannelalert != null)
                {
                    foreach (var item in lstChannelalert)
                    {
                        tblchannelAlert.ChannelAlertID        = item.ChannelAlertID;
                        tblchannelAlert.ChannelAlertAttrMapID = item.ChannelAlertAttrMapID;
                        tblchannelAlert.daId           = item.daId;
                        tblchannelAlert.TransactionSeq = item.TransactionSeq;

                        tblchannelAlert.EntityState = EntityState.Deleted;

                        IList <tbl_ChannelAlertAttrMapping> lstChannelAlertMappingid = repository1.GetList(q => q.ChannelAlertAttrMapID.Equals(item.ChannelAlertAttrMapID));

                        if (lstChannelAlertMappingid != null)
                        {
                            foreach (var item1 in lstChannelAlertMappingid)
                            {
                                objtblChannelAlertMapping.AttrID1               = item1.AttrID1;
                                objtblChannelAlertMapping.AttrID2               = item1.AttrID2;
                                objtblChannelAlertMapping.AttrID3               = item1.AttrID3;
                                objtblChannelAlertMapping.AttrID4               = item1.AttrID4;
                                objtblChannelAlertMapping.AttrID5               = item1.AttrID5;
                                objtblChannelAlertMapping.AttrID6               = item1.AttrID6;
                                objtblChannelAlertMapping.AttrID7               = item1.AttrID7;
                                objtblChannelAlertMapping.AttrID8               = item1.AttrID8;
                                objtblChannelAlertMapping.AttrID9               = item1.AttrID9;
                                objtblChannelAlertMapping.AttrID10              = item1.AttrID10;
                                objtblChannelAlertMapping.AttrValueID1          = item1.AttrValueID1;
                                objtblChannelAlertMapping.AttrValueID2          = item1.AttrValueID2;
                                objtblChannelAlertMapping.AttrValueID3          = item1.AttrValueID3;
                                objtblChannelAlertMapping.AttrValueID4          = item1.AttrValueID4;
                                objtblChannelAlertMapping.AttrValueID5          = item1.AttrValueID5;
                                objtblChannelAlertMapping.AttrValueID6          = item1.AttrValueID6;
                                objtblChannelAlertMapping.AttrValueID7          = item1.AttrValueID7;
                                objtblChannelAlertMapping.AttrValueID8          = item1.AttrValueID8;
                                objtblChannelAlertMapping.AttrValueID9          = item1.AttrValueID9;
                                objtblChannelAlertMapping.AttrValueID10         = item1.AttrValueID10;
                                objtblChannelAlertMapping.ChannelAlertAttrMapID = item1.ChannelAlertAttrMapID;
                                objtblChannelAlertMapping.DestnID               = item1.DestnID;
                                objtblChannelAlertMapping.DistributionTypeID    = item1.DistributionTypeID;
                                objtblChannelAlertMapping.FreqID       = item1.FreqID;
                                objtblChannelAlertMapping.IsManual     = item1.IsManual;
                                objtblChannelAlertMapping.MessageDesc  = item1.MessageDesc;
                                objtblChannelAlertMapping.ModeTypeID   = item1.ModeTypeID;
                                objtblChannelAlertMapping.SourceID     = item1.SourceID;
                                objtblChannelAlertMapping.ReqReference = item1.ReqReference;
                                objtblChannelAlertMapping.EntityState  = EntityState.Deleted;

                                repository1.Remove(objtblChannelAlertMapping);
                            }
                        }
                        repository.Remove(tblchannelAlert);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }