Example #1
0
        public bool DeleteSkillToolsData(List <int> ToolId)
        {
            WSEMDBEntities dbContext = new WSEMDBEntities();

            try
            {
                bool status = false;
                foreach (var InDId in ToolId)
                {
                    if (InDId != 0)
                    {
                        ObjectParameter Result = new ObjectParameter("Result", typeof(int));
                        int             Tool   = Convert.ToInt32(InDId);
                        dbContext.DeleteBySkill_SP(Tool, Result);
                        status = Convert.ToBoolean(Result.Value);
                    }
                }

                return(status);
            }
            catch (Exception)
            {
                throw;
            }
            //return true;
        }
Example #2
0
        public List <ConfigureResourcePoolGridModel> GetResourceSkilldetails(int page, int rows, out int totalCount)
        {
            WSEMDBEntities dbContext = new WSEMDBEntities();
            List <ConfigureResourcePoolGridModel> ResourceskillDetails = new List <ConfigureResourcePoolGridModel>();

            try
            {
                var skill = dbContext.GetSkillResourcePoolDetails_SP();
                ResourceskillDetails = (from type in skill
                                        select new ConfigureResourcePoolGridModel
                {
                    ToolId = type.ToolID,

                    ResourcePoolId = type.ResourcePoolID,
                    ResourcePoolName = type.ResourcePoolName,
                    Description = type.Description,
                    CreatedDate = type.CreatedDate
                }).ToList();
                totalCount = ResourceskillDetails.Count();
                //  return ResourceskillDetails.Skip((page - 1) * rows).Take(rows).ToList(); //------change
                return(ResourceskillDetails.ToList());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #3
0
        public bool SaveSkillResourceDetail(ConfigurationSkillMatrix model)
        {
            WSEMDBEntities dbContext      = new WSEMDBEntities();
            SkillMatrixDal sd             = new SkillMatrixDal();
            int            ResourcePoolID = model.ResourcePoolId;
            string         description    = model.Description;

            ObjectParameter ToolSkillID = new ObjectParameter("ToolSkillID", typeof(int));
            ObjectParameter Output      = new ObjectParameter("Result", typeof(int));
            bool            status      = false;

            if (model.ToolId != null)
            {
                var Temp = dbContext.AddUpdateSkillToolDetails_SP(model.ToolId, ResourcePoolID, sd.GetCurrentUserLoggedOn(), description.ToLower().Trim(), "EDIT", Output, ToolSkillID);
                foreach (var Te in Temp)
                {
                    status = Convert.ToBoolean(Te.Column1);
                    break;
                }
            }
            else
            {
                var Temp = dbContext.AddUpdateSkillToolDetails_SP(model.ToolId, ResourcePoolID, sd.GetCurrentUserLoggedOn(), description.ToLower().Trim(), "INSERT", Output, ToolSkillID);
                foreach (var Te in Temp)
                {
                    status = Convert.ToBoolean(Te.Column1);
                    break;
                }
            }

            //status = Convert.ToBoolean(Output.Value);
            return(status);
        }
Example #4
0
 public static string GetExpenseIds(string param)
 {
     try
     {
         ReportDAL      dal       = new ReportDAL();
         WSEMDBEntities dbContext = new WSEMDBEntities();
         return(JsonConvert.SerializeObject(dal.GetDropDownDataIfAvailable(dbContext, "ExpenseList", int.Parse(param), null, null, null)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #5
0
        public bool SaveRating(DetailsModel model, string skillID, string rating, int?loggedInUserEmployeeCode, string UpdatedBy)
        {
            var             dbcontext = new WSEMDBEntities();
            ObjectParameter Output    = new ObjectParameter("Output", typeof(int));
            int?            SkillID   = Convert.ToInt32(skillID);
            string          Rating    = rating;

            dbcontext.AddUpdateSearchEmployeeByName_SP(0, loggedInUserEmployeeCode, "INSERT", 0, SkillID, Rating, model.Remark, UpdatedBy, DateTime.Now, Output);
            //dbcontext.AddUpdateSearchEmployeeByName_SP(0, loggedInUserEmployeeCode, "INSERT", 0, SkillID, Rating, UpdatedBy, DateTime.Now, Output);
            bool status = Convert.ToBoolean(Output.Value);

            return(status);
        }
Example #6
0
 public static string GetEmployeeIds(string param)
 {
     try
     {
         ReportDAL      dal       = new ReportDAL();
         WSEMDBEntities dbContext = new WSEMDBEntities();
         return(JsonConvert.SerializeObject(dal.GetDropDownDataIfAvailable(dbContext, "EmployeeListByProjectID", null, param, null, null)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #7
0
        //kalindi
        public List <ConfigureResourcePoolGridModel> GetResourcePoolNameDetailsConfiguration()
        {
            WSEMDBEntities dbContext = new WSEMDBEntities();
            List <ConfigureResourcePoolGridModel> resourcePoolName = new List <ConfigureResourcePoolGridModel>();
            var resourcePools = dbContext.GetResoucePoolType_SP();

            resourcePoolName = (from r in resourcePools
                                select new ConfigureResourcePoolGridModel
            {
                ResourcePoolId = r.ResourcePoolID,
                ResourcePoolName = r.ResourcePoolName
            }).ToList();
            return(resourcePoolName);
        }
Example #8
0
        public List <ConfigurationSkillMatrix> GetSkillName(string id)
        {
            //int? id = ResorcePoolID;
            WSEMDBEntities dbContext = new WSEMDBEntities();
            List <ConfigurationSkillMatrix> skillname = new List <ConfigurationSkillMatrix>();
            var resourcePools = dbContext.FillSkill_SP(int.Parse(id));

            skillname = (from r in resourcePools
                         select new ConfigurationSkillMatrix
            {
                ToolId = r.toolid,
                Description = r.description,
            }).ToList();
            return(skillname);
        }
Example #9
0
        public List <DetailsModel> getRatings()
        {
            var dbcontext = new WSEMDBEntities();
            List <DetailsModel> ratings = new List <DetailsModel>();
            var rating = dbcontext.GetEmployeeRatings_SP();

            ratings = (from r in rating
                       orderby r.ProficiencyId
                       select new DetailsModel
            {
                Rating = r.Description,
                RatingId = r.ProficiencyId
            }).ToList();
            return(ratings);
        }
Example #10
0
        public List <DetailsModel> getResourcePoolNamesList()
        {
            var dbContextt = new WSEMDBEntities();
            List <DetailsModel> resourcePoolName = new List <DetailsModel>();
            var resourcePools = dbContextt.GetResoucePoolType_SP();

            resourcePoolName = (from r in resourcePools
                                orderby r.ResourcePoolName
                                select new DetailsModel
            {
                ResourcePoolID = r.ResourcePoolID,
                ResourcePoolName = r.ResourcePoolName
            }).ToList();
            return(resourcePoolName);
        }
Example #11
0
        public List <DetailsModel> getSkillNames(int id)
        {
            var dbcontext = new WSEMDBEntities();
            List <DetailsModel> skillName = new List <DetailsModel>();
            var skill = dbcontext.getSkillname_sp(id);

            skillName = (from s in skill
                         orderby s.description
                         select new DetailsModel

            {
                ToolId = s.ToolId,
                SkillName = s.description
            }).ToList();
            return(skillName);
        }
Example #12
0
 public static string GetEmployeeIdsForPlannedTask(string param, string ControlName, int?Reportid)
 {
     try
     {
         ReportDAL        dal          = new ReportDAL();
         WSEMDBEntities   dbContext    = new WSEMDBEntities();
         string           Employeecode = Membership.GetUser().UserName;
         TaskTimesheetDAL Timesheetdal = new TaskTimesheetDAL();
         int?employeid = Convert.ToInt32(Timesheetdal.GetEmployeeIdFromEmployeeCodeSEM(Convert.ToInt32(Employeecode)));
         return(JsonConvert.SerializeObject(dal.GetDropDownDataIfAvailable(dbContext, "EmployeeListByProjectIDForPlannedTask", employeid, param, Reportid, ControlName)));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #13
0
        public bool SubmitSkillDetails(string ProjectEmployeeRoleID)
        {
            try
            {
                WSEMDBEntities  dbContext = new WSEMDBEntities();
                bool            status    = false;
                ObjectParameter Result    = new ObjectParameter("Result", typeof(int));

                dbContext.SubmitSkillMatrixRatingDetails_SP(ProjectEmployeeRoleID, Result);

                status = Convert.ToBoolean(Result.Value);
                return(status);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #14
0
        public bool DeleteSkill(int id)
        {
            try
            {
                WSEMDBEntities  dbContext = new WSEMDBEntities();
                bool            status    = false;
                ObjectParameter Result    = new ObjectParameter("Result", typeof(int));
                SkillMatrixDal  dal       = new SkillMatrixDal();
                dbContext.DeleteSearchByEmployeeName(id, dal.GetCurrentUserLoggedOn(), Result);
                status = Convert.ToBoolean(Result.Value);

                return(status);
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #15
0
        //Rahul
        //Rahul
        //public List<DetailsModel> SearchEmployeeForEmp(int? id, int page, int rows, out int totalCount, string Todo)
        //{
        //    try
        //    {
        //        var dbContextt = new WSEMDBEntities();
        //        List<DetailsModel> employeeDetails = new List<DetailsModel>();

        //        if (Todo == "OtherSkill")
        //        {
        //           // var Details = dbContextt.SkillData_SP(id, "OtherSkill");
        //            var Details = dbContextt.SkillData_SP(id);
        //            employeeDetails = (from d in Details
        //                               select new DetailsModel
        //                               {
        //                                   Id = d.ID,
        //                                   ResourcePoolName = d.resourcepoolname,
        //                                   SkillName = d.description,
        //                                   Rating = d.ratings,
        //                                   Remark = d.Remark

        //                               }).ToList();
        //        }
        //        else if (Todo == "Particular")
        //        {
        //            //var Details = dbContextt.SkillData_SP(id, "Particular");
        //            var Details = dbContextt.SkillData_SP(id);
        //            employeeDetails = (from d in Details
        //                               select new DetailsModel
        //                               {
        //                                   Id = d.ID,
        //                                   ResourcePoolName = d.resourcepoolname,
        //                                   SkillName = d.description,
        //                                   Rating = d.ratings,
        //                                   Remark = d.Remark

        //                               }).ToList();
        //        }

        //        totalCount = employeeDetails.Count();
        //        return employeeDetails.Skip((page - 1) * rows).Take(rows).ToList();

        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //}
        public List <DetailsModel> SearchEmployeeForEmp(int?id, int page, int rows, out int totalCount, string Todo)
        {
            try
            {
                var dbContextt = new WSEMDBEntities();
                List <DetailsModel> employeeDetails = new List <DetailsModel>();

                if (Todo == "OtherSkill")
                {
                    var Details = dbContextt.SkillData_SP(id, "OtherSkill");
                    employeeDetails = (from d in Details
                                       select new DetailsModel
                    {
                        Id = d.ID,
                        ResourcePoolName = d.resourcepoolname,
                        SkillName = d.description,
                        Rating = d.ratings,
                        Remark = d.Remark
                    }).ToList();
                }
                else if (Todo == "Particular")
                {
                    var Details = dbContextt.SkillData_SP(id, "Particular");
                    employeeDetails = (from d in Details
                                       select new DetailsModel
                    {
                        Id = d.ID,
                        ResourcePoolName = d.resourcepoolname,
                        SkillName = d.description,
                        Rating = d.ratings,
                        Remark = d.Remark
                    }).ToList();
                }

                totalCount = employeeDetails.Count();
                return(employeeDetails.Skip((page - 1) * rows).Take(rows).ToList());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #16
0
        public List <DropDownValues> GetDropDownDataIfAvailable(WSEMDBEntities context, string procName, int?employeeID, string optParm1, int?ReportID, string reportParamName)
        {
            List <DropDownValues> values    = new List <DropDownValues>();
            var           reportDetailsTeam = dbContext.v2_getReportParamMaster(ReportID, employeeID);
            var           reportDetailsAll  = dbContext.v2_getReportParamMaster(ReportID, employeeID);
            List <string> strTeam           = reportDetailsTeam.Where(t => t.Team != null && t.reportParamName == reportParamName).Select(t => t.Team).ToList();
            List <string> strAll            = reportDetailsAll.Where(t => t.All != null && t.reportParamName == reportParamName).Select(t => t.All).ToList();

            string[] team = { };
            string[] all  = { };
            foreach (var item in strTeam)
            {
                if (item != null)
                {
                    team = item.Split(',');
                }
            }
            foreach (var item in strAll)
            {
                if (item != null)
                {
                    all = item.Split(',');
                }
            }
            string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName);
            if (procName != null)
            {
                var DropDownValues = dbContext.GetDropDownFillValues(procName, employeeID, optParm1, null, null, null, null);
                List <DropDownValues> DropDownList = new List <DropDownValues>();
                DropDownList = (from m in DropDownValues
                                select new DropDownValues
                {
                    Key = Convert.ToString(m.Key),
                    Value = m.Value
                }).ToList();

                DropDownValues selfValue = new DropDownValues()
                {
                    Key   = "-1",
                    Value = "Self"
                };

                DropDownValues allValue = new DropDownValues()
                {
                    Key   = "-3",
                    Value = "All"
                };

                DropDownValues teamValue = new DropDownValues()
                {
                    Key   = "-2",
                    Value = "Team"
                };

                if (strTeam.Count != 0 || strAll.Count != 0)
                {
                    DropDownList.Insert(0, selfValue);
                }

                DropDownList.RemoveAll(x => x.Key == Membership.GetUser().UserName);

                if (CheckIfValueExist(all, role))
                {
                    if (DropDownList.Contains(selfValue))
                    {
                        DropDownList.Insert(1, allValue);
                    }
                    else
                    {
                        DropDownList.Insert(0, allValue);
                    }
                }

                if (CheckIfValueExist(team, role))
                {
                    if (DropDownList.Contains(selfValue) && DropDownList.Contains(allValue))
                    {
                        DropDownList.Insert(2, teamValue);
                    }
                    else if (DropDownList.Contains(selfValue) && !DropDownList.Contains(allValue))
                    {
                        DropDownList.Insert(1, teamValue);
                    }
                    else if (!DropDownList.Contains(selfValue) && DropDownList.Contains(allValue))
                    {
                        DropDownList.Insert(1, teamValue);
                    }
                    else if (!DropDownList.Contains(selfValue) && !DropDownList.Contains(allValue))
                    {
                        DropDownList.Insert(0, teamValue);
                    }
                }

                values = DropDownList.ToList();
            }
            return(values);
        }