/// <summary>
        /// This method will return the system list on Employee selection
        /// </summary>
        /// <param name="objSoftware">Object holding EmployeeId</param>
        /// <returns>Returns a list of System</returns>
        public List <BusinessEntities.SystemAllocation> PopulateSystem(SoftwareAllocationVm objSoftware)
        {
            using (Data.Model.LicenseManagementMVCEntities DbContext = new LicenseManagementMVCEntities())
            {
                SoftwareBusinessLayer software = new SoftwareBusinessLayer();
                List <BusinessEntities.SystemAllocation> systemList     = new List <BusinessEntities.SystemAllocation>();
                List <Data.Model.SystemAllocation>       systemDataList = new List <Data.Model.SystemAllocation>();

                systemDataList = (from s in DbContext.SystemAllocations
                                  where s.EmployeeId == objSoftware.EmployeeId
                                  select s).ToList();

                BusinessEntities.SystemAllocation objSystem = new BusinessEntities.SystemAllocation();
                foreach (var s in systemDataList)
                {
                    objSystem = new BusinessEntities.SystemAllocation()
                    {
                        SystemAllocationId = s.SystemAllocationId
                    };
                    if (!software.checkSoftwareAlreadyAllocated(objSystem.SystemAllocationId, objSoftware.SoftwareId))
                    {
                        systemList.Add(objSystem);
                    }
                }
                return(systemList);
            }
        }
 /// <summary>
 /// Make entries in SystemAllocation table and reduce count by 1 in SystemDetails table
 /// </summary>
 /// <param name="detail">Acept parameter of type SystemAllocation</param>
 /// <returns>ResultStaus(enum with status value)</returns>
 public ResultStatus SaveSystemAllocationDetail(BusinessEntities.SystemAllocation detail)
 {
     try
     {
         using (LicenseManagementMVCEntities obj = new LicenseManagementMVCEntities())
         {
             Data.Model.SystemAllocation allocate = new Data.Model.SystemAllocation()
             {
                 SystemDetailsId = detail.SystemDetailsId,
                 EmployeeId      = detail.EmployeeId,
                 AllotedDate     = detail.AllotedDate ?? DateTime.Now,
                 ReleaseDate     = detail.ReleaseDate,
                 Remarks         = detail.Remarks,
                 IsReleased      = detail.IsReleased,
             };
             obj.SystemAllocations.Add(allocate);
             //decrease count value by 1 according to SystemdetailId.
             var systemDetail = obj.SystemDetails.FirstOrDefault(x => x.SystemDetailsId == detail.SystemDetailsId);
             if (systemDetail != null)
             {
                 --systemDetail.Count;
             }
             obj.SaveChanges();
             return(ResultStatus.Success);
         }
     }
     catch (Exception exp)
     {
         log.Error(exp);
         return(ResultStatus.QueryNotExecuted);
     }
 }