public ActionResult DeleteSkills(int id) { try { UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); int userID = sessId.User_ID; EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities(); UserSkill skills = evolutyzData.UserSkills.SingleOrDefault(u => u.Usr_UserId == id); if (userID == id) { evolutyzData.UserSkills.Remove(skills); evolutyzData.SaveChanges(); return(Json("Removed Successfully", JsonRequestBehavior.AllowGet)); } else { return(Json("Deletion Failed and Please Try Again", JsonRequestBehavior.AllowGet)); } } catch (Exception) { throw; } }
public ActionResult WeeklyUserTimeSheetData(int userid, string timesheetstartdate, string timesheetenddate, string Bymonthlyid, int projid, int mode) { UserSessionInfo objUserSession = Session["UserSessionInfo"] as UserSessionInfo; string _userID = objUserSession.LoginId; string _paswd = objUserSession.Password; UserProjectdetailsEntity objuser = new UserProjectdetailsEntity(); int UserName = objuser.User_ID; string Password = objuser.Usr_Password; ViewBag.StartDate = timesheetstartdate; ViewBag.EndDate = timesheetenddate; ViewBag.Bymonthlyid = Bymonthlyid; ViewBag.ClientProjectid = projid; var ClientProjectName = db.ClientProjects.Where(a => a.CL_ProjectID == projid).Select(a => a.ClientProjTitle).FirstOrDefault(); var AccountClientName = (from p in db.Projects join cp in db.ClientProjects on p.Proj_ProjectID equals cp.Proj_ProjectID where cp.CL_ProjectID == projid select new { p.Proj_ProjectName }).Distinct().FirstOrDefault(); ViewBag.AccClientName = AccountClientName.Proj_ProjectName; var clientProj_Projectid = db.ClientProjects.Where(a => a.CL_ProjectID == projid).Select(a => a.Proj_ProjectID).FirstOrDefault(); ViewBag.clientprojname = ClientProjectName; ViewBag.clientProj_Projectid = clientProj_Projectid; ViewBag.Mode = mode; LoginComponent loginComponent = new LoginComponent(); var usersprojects = loginComponent.GetUserProjectsDetailsInfo(objUserSession); if (usersprojects != null) { objuser.User_ID = usersprojects.User_ID; objuser.AccountName = usersprojects.AccountName; objuser.Usr_Username = usersprojects.Usr_Username; objuser.projectName = usersprojects.projectName; objuser.ProjectClientName = usersprojects.ProjectClientName; objuser.tsktaskID = usersprojects.tsktaskID; objuser.Proj_ProjectID = usersprojects.Proj_ProjectID; objuser.RoleCode = usersprojects.RoleCode; ViewBag.accountid = usersprojects.Account_ID; ViewBag.tsktaskID = objuser.tsktaskID; ViewBag.User_ID = objuser.User_ID; ViewBag.Projectid = objuser.Proj_ProjectID; ViewBag.ProjectName = objuser.projectName; ViewBag.ClientProjectName = objuser.ProjectClientName; this.Session["TaskId"] = objuser; return(View(objuser)); } else { return(View()); } }
public ActionResult updateSkills(int userID, string SkillsTitle, string yearExp, string monthExp) { try { UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); // int userID = sessId.User_ID; string yearMonth = yearExp + "." + monthExp; EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities(); UserSkill skills = evolutyzData.UserSkills.SingleOrDefault(u => u.Usr_UserId == userID); skills.SkillId = Convert.ToInt32(SkillsTitle); skills.Experience = yearMonth; int response = evolutyzData.SaveChanges(); if (response > 0) { return(Json("Data Updated Successfully", JsonRequestBehavior.AllowGet)); } else { return(Json("Updation Failed and Please Try Again!!", JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { throw ex; } }
public string updateSkills(string SkillsTitle, string yearExp, string monthExp, int userskillid) { try { UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); int userID = sessId.User_ID; int skillid = Convert.ToInt32(SkillsTitle); string yearMonth = yearExp + "." + monthExp; EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities(); UserSkill skillcheck = evolutyzData.Set <UserSkill>().Where(s => (s.SkillId == skillid && s.Usr_UserId == userID && s.Is_Deleted == false && s.Usr_SkillId != userskillid)).FirstOrDefault <UserSkill>(); if (skillcheck != null) { return("Skill Already Exist"); } UserSkill skills = evolutyzData.UserSkills.SingleOrDefault(u => u.Usr_SkillId == userskillid); skills.SkillId = Convert.ToInt32(SkillsTitle); skills.Experience = yearMonth; int response = evolutyzData.SaveChanges(); if (response > 0) { return("Data Updated Successfully"); } else { return("Try Again!!"); } } catch (Exception) { throw; } }
public ActionResult MonthlyUserDataTimeSheet(int userid, string timesheetyear, string timesheetmonth, string Bymonthlyid, int projid) { UserSessionInfo objUserSession = Session["UserSessionInfo"] as UserSessionInfo; string _userID = objUserSession.LoginId; string _paswd = objUserSession.Password; UserProjectdetailsEntity objuser = new UserProjectdetailsEntity(); int UserName = objuser.User_ID; string Password = objuser.Usr_Password; ViewBag.year = timesheetyear; ViewBag.month = timesheetmonth; ViewBag.Bymonthlyid = Bymonthlyid; ViewBag.ClientProjectid = projid; var ClientProjectName = db.ClientProjects.Where(a => a.CL_ProjectID == projid).Select(a => a.ClientProjTitle).FirstOrDefault(); var myprojId = db.ClientProjects.Where(a => a.CL_ProjectID == projid).Select(a => a.Proj_ProjectID).FirstOrDefault(); ViewBag.prjid = myprojId; var clientProj_Projectid = db.ClientProjects.Where(a => a.CL_ProjectID == projid).Select(a => a.Proj_ProjectID).FirstOrDefault(); ViewBag.clientprojname = ClientProjectName; ViewBag.clientProj_Projectid = clientProj_Projectid; LoginComponent loginComponent = new LoginComponent(); var usersprojects = loginComponent.GetUserProjectsDetailsInfo(objUserSession); if (usersprojects != null) { objuser.User_ID = usersprojects.User_ID; objuser.AccountName = usersprojects.AccountName; objuser.Usr_Username = usersprojects.Usr_Username; objuser.projectName = usersprojects.projectName; objuser.ProjectClientName = usersprojects.ProjectClientName; objuser.tsktaskID = usersprojects.tsktaskID; objuser.Proj_ProjectID = usersprojects.Proj_ProjectID; objuser.RoleCode = usersprojects.RoleCode; ViewBag.accountid = usersprojects.Account_ID; ViewBag.tsktaskID = objuser.tsktaskID; ViewBag.User_ID = objuser.User_ID; ViewBag.Projectid = objuser.Proj_ProjectID; ViewBag.ProjectName = objuser.projectName; ViewBag.ClientProjectName = objuser.ProjectClientName; this.Session["TaskId"] = objuser; return(View(objuser)); } else { return(View()); } }
public string AddSkills(string skill, string yearExp, string monthExp) { try { int response = 0; UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); int userID = sessId.User_ID; int skillid = Convert.ToInt32(skill); EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities(); if (entities.UserSkills.Count((a) => a.Usr_UserId == userID) >= 0) { string yearMonth = yearExp + "." + monthExp; UserSkill skillcheck = evolutyzData.Set <UserSkill>().Where(s => (s.SkillId == skillid && s.Usr_UserId == userID && s.Is_Deleted == false)).FirstOrDefault <UserSkill>(); if (skillcheck != null) { return("Skill Already Exist"); } UserSkill skills = new UserSkill(); skills.SkillId = Convert.ToInt32(skill); skills.Usr_UserId = userID; //skills.Usr_SkillId = skill; skills.Experience = yearMonth; skills.Usk_CreatedDate = System.DateTime.Now; // skills.Usk_ModifiedDate = System.DateTime.Now; skills.Is_Deleted = false; evolutyzData.UserSkills.Add(skills); response = evolutyzData.SaveChanges(); } if (response > 0) { return("Data Inserted Successfully"); } else { return("Try Again!!"); } } catch (Exception) { throw; } }
public ActionResult AddSkills(string skill, string yearExp, string monthExp) { try { int response = 0; UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); int userID = sessId.User_ID; string username = sessId.Usr_Username; if (entities.UserSkills.Count((a) => a.Usr_UserId == userID) == 0) { string yearMonth = yearExp + "." + monthExp; EvolutyzCornerDataEntities evolutyzData = new EvolutyzCornerDataEntities(); UserSkill skills = new UserSkill(); skills.SkillId = Convert.ToInt32(skill); skills.Usr_UserId = userID; //skills.Usr_SkillId = skill; skills.Experience = yearMonth; skills.Usk_CreatedDate = System.DateTime.Now; skills.Usk_ModifiedDate = System.DateTime.Now; evolutyzData.UserSkills.Add(skills); response = evolutyzData.SaveChanges(); } if (response > 0) { return(Json("Data Inserted Successfully", JsonRequestBehavior.AllowGet)); } else { return(Json("Data already Exits!!Update Skill for Existing Data", JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { throw ex; } }
public ActionResult getAllUsersDetails() { UserProjectdetailsEntity sessId = new UserProjectdetailsEntity(); string userName = sessId.Usr_Username; var details = (from p in entities.UserSkills join c in entities.Skills on p.SkillId equals c.SkillId orderby p.SkillId select new { Usr_UserId = p.Usr_UserId, Usk_CreatedDate = p.Usk_CreatedDate, Usk_ModifiedDate = p.Usk_ModifiedDate, Experience = p.Experience, SkillId = p.SkillId, SkillTitle = c.SkillTitle, //Description = c.exp }).ToList(); return(Json(details, JsonRequestBehavior.AllowGet)); }