Esempio n. 1
0
 /// <summary>
 /// Get All Countries List
 /// </summary>
 /// <returns></returns>
 public IEnumerable <Countries> GetCountryList()
 {
     TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
     foreach (var x in ent.Countries)
     {
         yield return(x);
     }
 }
 public List <AirlineFlightTaxesMappings> GetExistingAirlineName()
 {
     using (TravelPortalEntity.EntityModel entities = new TravelPortalEntity.EntityModel())
     {
         var results = from o in entities.AirlineFlightTaxesMappings
                       where o.AirlineId != o.AirlineId //&& o.AirlineId == o.MappingId
                       select o;
         return(results.ToList <AirlineFlightTaxesMappings>());
     }
 }
        public List <AirlineFlightTaxesMappings> GetByFlightMapping(int id)
        {
            using (TravelPortalEntity.EntityModel entities = new TravelPortalEntity.EntityModel())
            {
                var results = from o in entities.AirlineFlightTaxesMappings
                              where o.AirlineId == id
                              select o;

                return(results.ToList <AirlineFlightTaxesMappings>());
            }
        }
Esempio n. 4
0
        public int GetAllSequenceNoFromControllerList(string ControllerName)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.ControllerLists.Where(b => b.ControllerName == ControllerName)
                      select new RolePrivilageModel
            {
                SeqNumber = aa.SeqNumber
            }).Count();

            return(cc);
        }
Esempio n. 5
0
        public int GetAllControllerName()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.ControllerGroups
                      select new RolePrivilageModel
            {
                SeqNumber = aa.SeqNumber
            }).Count();

            return(cc);
        }
Esempio n. 6
0
        public List <AgentSettingsModel> GetAllAdminSettingList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.Settings.Where(ii => (ii.isActive == true && ii.SettingFor == "AGENT"))
                      select new AgentSettingsModel
            {
                SettingName = aa.SettingName,
                SettingId = aa.SettingId,
            }).ToList();

            return(cc);
        }
        public List <LedgerMasterModel> GetAllAgentNameBasedonAccTypeName(int AgentId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.Agents

                      select new LedgerMasterModel
            {
                AgentId = aa.AgentId,
                AgentName = aa.AgentName
            }).ToList();

            return(cc);
        }
        public List <LedgerMasterModel> GetAllLedgerAccountBasedonAccTypeName(int LedgerAccountId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.GL_LedgerAccTypes

                      select new LedgerMasterModel
            {
                LedgerAccTypeId = aa.LedgerAccTypeId,
                LedgerAccTypeName = aa.LedgerAccTypeName
            }).ToList();

            return(cc);
        }
Esempio n. 9
0
        public List <RolePrivilageModel> GetAllControllerNameBasedonProductandSubProduct(int ProductId, int SubProductId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.ControllerLists
                      where aa.ProductId == ProductId && aa.SubProductId == SubProductId
                      select new RolePrivilageModel
            {
                ControllerId = aa.ControllerId,
                ControllerName = aa.ControllerName
            }).ToList();

            return(cc);
        }
Esempio n. 10
0
 public void SaveAgentSetting(List <int> abinfo, int AgentId)
 {
     TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
     foreach (var item in abinfo)
     {
         ent.AgentSettings.AddObject(new AgentSettings()
         {
             AgentId   = AgentId,
             SettingId = item,
         });
     }
     ent.SaveChanges();
 }
Esempio n. 11
0
 public void SaveRolePrivilageMapping(List <RolePrivilegeMappings> roleinfo)
 {
     TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
     foreach (var item in roleinfo)
     {
         ent.RolePrivilegeMappings.AddObject(new RolePrivilegeMappings()
         {
             RoleId      = item.RoleId,
             PrivilegeId = item.PrivilegeId,
         });
     }
     ent.SaveChanges();
 }
Esempio n. 12
0
 public void DeleteAgentSetting(int agentid)
 {
     TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
     try
     {
         ent.DeleteAgentSetting(agentid);
         ent.SaveChanges();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Esempio n. 13
0
 public void SaveAgentProduct(List <Core_AgentProducts> abinfo)
 {
     TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
     foreach (var item in abinfo)
     {
         ent.Core_AgentProducts.AddObject(new Core_AgentProducts()
         {
             AgentId   = item.AgentId,
             ProductId = item.ProductId,
         });
     }
     ent.SaveChanges();
 }
Esempio n. 14
0
        public LedgerMasterModel GetGLAccTypesBasedOnTypeName(int AccTypeId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.GL_AccTypes.Where(x => x.AccTypeId == AccTypeId)

                      select new LedgerMasterModel
            {
                MapTable = aa.MapTable,
                DisplayMember = aa.DisplayMember,
                ValueMember = aa.ValueMember,
            }).SingleOrDefault();

            return(cc);
        }
Esempio n. 15
0
        public List <UserManagementModel.LockApprovedUserModel> GetUnppprovedUserAdminUserList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ListAllAdminUser().Where(aa => aa.IsApproved == false)
                      select new UserManagementModel.LockApprovedUserModel
            {
                UserName = aa.UserName,
                Email = aa.Email,
                IsApproved = aa.IsApproved,
                UserId = aa.UserId,
                IsLockedOut = aa.IsLockedOut
            }).ToList();

            return(cc.ToList());
        }
Esempio n. 16
0
        public List <AgentSettingsModel> GetAllActiveSettingForAgent(int agentid)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.Settings
                      join bb in ent.AgentSettings
                      on aa.SettingId equals bb.SettingId
                      where bb.AgentId == agentid
                      select new AgentSettingsModel
            {
                SettingName = aa.SettingName,
                SettingId = aa.SettingId,
            }).ToList();

            return(cc);
        }
Esempio n. 17
0
        public List <UserManagementModel.LockApprovedUserModel> GetUnapprovedAgentUserList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.GetUserByApproveStatus(false)
                      select new UserManagementModel.LockApprovedUserModel
            {
                UserName = aa.UserName,
                AgentName = aa.AgentName,
                Email = aa.Email,
                IsApproved = aa.IsApproved,
                UserId = aa.UserId,
            }).ToList();

            return(cc.ToList());
        }
Esempio n. 18
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        ///

        public List <RoleBasedRoleModel> GetAllRolesListForAdmin()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.aspnet_Roles
                      // join bb in ent.asp
                      //on aa.RoleId equals bb.RoleId
                      // where bb.CreatedBy == 0
                      select new RoleBasedRoleModel
            {
                RoleId = aa.RoleId,
                RoleName = aa.RoleName,
            }).ToList();

            return(cc);
        }
Esempio n. 19
0
        public List <RoleBasedRoleModel> GetAllAdminRolesBasedonProductAndSubProduct(int ProductId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.aspnet_Roles
                      join bb in ent.Core_ProductRoles
                      on aa.RoleId equals bb.RoleId
                      where (bb.ProductId == ProductId && bb.Core_SubProduct.SubProductName == "Administrator")
                      select new RoleBasedRoleModel
            {
                RoleId = aa.RoleId,
                RoleName = aa.RoleName,
            }).ToList();

            return(cc);
        }
Esempio n. 20
0
        public List <RoleBasedRoleModel> GetAllRolesListForAgent(int agentid)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.aspnet_Roles
                      join bb in ent.RoleUserTypeMappings
                      on aa.RoleId equals bb.RoleId
                      where (bb.CreatedBy == agentid || (bb.UserTypeId == 2 && bb.CreatedBy == 0))
                      select new RoleBasedRoleModel
            {
                RoleId = aa.RoleId,
                RoleName = aa.RoleName,
            }).ToList();

            return(cc);
        }
        ////////////////////////////  Associated User Product List  ////////////////////////////////////////////////////
        public List <RoleBasedRoleModel> GetAllAssociatedProductofAdminUser(Guid userid)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.Core_Products
                      join bb in ent.Core_UserProducts
                      on aa.ProductId equals bb.ProductId
                      where bb.UsersDetails.UserId == userid
                      select new RoleBasedRoleModel
            {
                ProductName = aa.ProductName,
                ProductId = aa.ProductId,
            }).ToList();

            return(cc);
        }
Esempio n. 22
0
        public List <RoleBasedRoleModel> GetAllRolesListonProductWise(int ProductId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ent.aspnet_Roles
                      join bb in ent.Core_ProductRoles
                      on aa.RoleId equals bb.RoleId
                      where bb.ProductId == ProductId && bb.Core_SubProduct.SubProductName == "Agent"
                      select new RoleBasedRoleModel
            {
                RoleId = aa.RoleId,
                RoleName = aa.RoleName,
                ProductId = bb.ProductId,
            }).ToList();

            return(cc);
        }
Esempio n. 23
0
        public List <UserManagementModel.LockApprovedUserModel> GetAllLockedUserList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var cc = (from aa in ListAllRegisteredUser()
                      select new UserManagementModel.LockApprovedUserModel
            {
                AgentName = aa.AgentName,
                UserName = aa.UserName,
                Email = aa.Email,
                IsApproved = aa.IsApproved,
                UserId = aa.UserId,
                IsLockedOut = aa.IsLockedOut
            }).ToList();

            return(cc.ToList());
        }
        public void CheckExistanceofUserProduct(int UserId, int productid)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var product = ent.Core_UserProducts.Where(xx => xx.UserId == UserId && xx.ProductId == productid).ToList();

            if (product.Count() == 0)
            {
                Core_UserProducts obj = new Core_UserProducts
                {
                    ProductId = productid,
                    UserId    = UserId,
                };
                ent.AddToCore_UserProducts(obj);
                ent.SaveChanges();
            }
        }
        public IEnumerable <SelectListItem> ddlCityList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var result = ent.Bus_Cities.OrderBy(o => o.BusCityName);
            List <SelectListItem> ddlList = new List <SelectListItem>();

            ddlList.Add(new SelectListItem {
                Text = "--Select--", Value = ""
            });
            foreach (var item in result)
            {
                ddlList.Add(new SelectListItem {
                    Value = item.BusCityId.ToString(), Text = item.BusCityName.ToString() + "(" + item.BusCityCode + ")"
                });
            }
            return(ddlList);
        }
Esempio n. 26
0
        public IEnumerable <SelectListItem> OptionList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var result = ent.MRC_CardValue.Where(x => x.IsActive == true);
            List <SelectListItem> ddlList = new List <SelectListItem>();

            ddlList.Add(new SelectListItem {
                Text = "--Select--", Value = ""
            });
            foreach (var item in result)
            {
                ddlList.Add(new SelectListItem {
                    Text = item.CardValue.ToString(), Value = item.CardValueId.ToString()
                });
            }
            return(ddlList);
        }
Esempio n. 27
0
        //public List<LedgerMasterModel> GetAllAccTypesName(int id)
        //{

        //    TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
        //    var cc = (from aa in ent.GL_AccTypes

        //              select new LedgerMasterModel
        //              {


        //              }).ToList();
        //    return cc;

        //}


        /*-----------------------------------------------------------------------------------------------------------------------------------------*/

        /// <summary>
        /// /
        /// </summary>
        /// <param name="MapTable"></param>
        /// <param name="DisplayMember"></param>
        /// <param name="ValueMember"></param>
        /// <returns></returns>
        public List <LedgerMasterModel> GetAllAirlineNameBasedonAccTypeName(string MapTable, string DisplayMember, string ValueMember)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var result = ent.Air_GetAccMappedValues(MapTable, DisplayMember, ValueMember);
            List <LedgerMasterModel> Search = new List <LedgerMasterModel>();

            foreach (var item in result)
            {
                LedgerMasterModel obj = new LedgerMasterModel
                {
                    ValueMember   = item.ValueMember.ToString(),
                    DisplayMember = item.DisplayMember,
                };
                Search.Add(obj);
            }
            return(Search.ToList());
        }
        public IEnumerable <SelectListItem> ddlTypeList()
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            var result = ent.Bus_Master.OrderBy(o => o.BusMasterName);
            List <SelectListItem> ddlList = new List <SelectListItem>();

            ddlList.Add(new SelectListItem {
                Text = "--Select--", Value = ""
            });
            ddlList.Add(new SelectListItem {
                Text = "Day(दिवा)", Value = "Day(दिवा)"
            });
            ddlList.Add(new SelectListItem {
                Text = "Night(रात्री)", Value = "Night(रात्री)"
            });

            return(ddlList);
        }
Esempio n. 29
0
        public void DeleteDistributorAgentSetting(int agentid)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();
            try
            {
                var filteredSettings = ent.AgentSettings.Where(x => x.AgentId == agentid && (x.AgentSettingId == 5 || x.AgentSettingId == 6));

                foreach (AgentSettings agentSetting in filteredSettings)
                {
                    ent.DeleteObject(agentSetting);
                }

                ent.SaveChanges();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        public List <RoleBasedRoleModel> GetUserAssociatedRolewithProduct(Guid UserId)
        {
            TravelPortalEntity.EntityModel ent = new TravelPortalEntity.EntityModel();


            var result = (from a in ent.vw_aspnet_UsersInRoles
                          join b in ent.aspnet_Roles on a.RoleId equals b.RoleId
                          join c in ent.Core_ProductRoles on a.RoleId equals c.RoleId
                          where a.UserId == UserId
                          select new RoleBasedRoleModel
            {
                RoleId = b.RoleId,
                RoleName = b.RoleName,
                ProductId = c.ProductId,
                ProductName = c.Core_Products.ProductName
            }).ToList();

            return(result);
        }