コード例 #1
0
ファイル: Service.cs プロジェクト: ravikiranjuluru/synergyrms
        /// <summary>
        /// Gets the user external id.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public static string GetUserExternalId(Guid name)
        {
            aspnet_Users user = null;
              SynergyModelContainer db = new SynergyModelContainer();
              var userQuery = from p in db.LM_ExternalId
                          where p.aspnet_Users.UserId == name
                          select p;

              return userQuery.First().externalId;
        }
コード例 #2
0
ファイル: Service.cs プロジェクト: ravikiranjuluru/synergyrms
        /// <summary>
        /// Gets the employee.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public static EM_Employee GetEmployee(Guid name)
        {
            aspnet_Users user = null;
              SynergyModelContainer db = new SynergyModelContainer();
              var userQuery = from p in db.EM_Employee
                          where p.aspnet_Users.UserId == name
                          select p;

              return userQuery.First();
        }
コード例 #3
0
ファイル: Service.cs プロジェクト: ravikiranjuluru/synergyrms
        /// <summary>
        /// Gets the name of the user by.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public static aspnet_Users GetUserByName(string name)
        {
            aspnet_Users user = null;
              SynergyModelContainer db = new SynergyModelContainer();
              var userQuery = from p in db.aspnet_Users
                          where p.UserName == name
                          select p;

              user = userQuery.First();
              return user;
        }
コード例 #4
0
        /// <summary>
        /// Getleaves the allocation by user.
        /// </summary>
        /// <param name="User">The user.</param>
        /// <param name="startDate">The start date.</param>
        /// <param name="endDate">The end date.</param>
        /// <returns></returns>
        public List<EmployeeLeaveEntity> GetleaveAllocationByUser(string User,DateTime startDate,DateTime endDate)
        {
            Guid UserId = Service.GetUserByName(User).UserId;
              SynergyModelContainer db = new SynergyModelContainer();
              var employeeLeaveQuery = from l in db.LM_EmployeeLeave
                                   where ((l.Date >= startDate) && (l.Date <= endDate) && (l.aspnet_Users.UserId==UserId))
                                   select l;

              List<LM_EmployeeLeave> leaves = employeeLeaveQuery.ToList();
              return AssembleEntityList(leaves);
        }