/// <summary> /// Ensures that an object with the specified name exists, while creating other properties are set to their default values /// </summary> /// <param name="i_sName">Name</param> /// <returns>cCareerDevelopmentPlan object</returns> public static cCareerDevelopmentPlan CreateIfRequiredAndGet(string i_sName) { cCareerDevelopmentPlan oObj = cCareerDevelopmentPlan.Get_Name(i_sName); if (oObj == null) { oObj = cCareerDevelopmentPlan.Create(); oObj.sName = i_sName; oObj.Save(); } return(oObj); }
public ActionResult DevelopmentPlan(List <HttpPostedFileBase> file) { try { int loginID = Convert.ToInt32(HttpContext.User.Identity.Name); //FIle Upload:- if (file.Count > 0) { foreach (var item in file) { if (item != null) { cFile objfile = cFile.Create(); string filename = Path.GetFileNameWithoutExtension(item.FileName) + DateTime.Now.ToString().Replace('/', '_').Replace(':', '_') + Path.GetExtension(item.FileName); item.SaveAs((FilePath + filename)); objfile.sFileName = filename; objfile.objEmpLogin.iObjectID = loginID; objfile.objCareerDevelopmentPlan.iObjectID = 0; objfile.Save(); } } } string DevopmentPlan = Request.QueryString["DevelopmentPlan"]; List <Data> list = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Data> >(DevopmentPlan); int LoginId = Convert.ToInt32(HttpContext.User.Identity.Name); for (var i = 0; i < list.Count; i++) { cCareerDevelopmentPlan objDevPlan = cCareerDevelopmentPlan.Create(); objDevPlan.sDevGoalName = list[i].GoalName; objDevPlan.sActionRequired = list[i].Action; objDevPlan.sTracking = list[i].Tracking; objDevPlan.sManagerComment = list[i].ManagerComment; objDevPlan.objStatus.iObjectID = list[i].StatusList; objDevPlan.objEmpLogin.iObjectID = LoginId; objDevPlan.Save(); } } catch (Exception ex) { throw ex; } return(RedirectToAction("DevelopmentGoals", "QuadrantMeasures")); //return View(objQuadrantMeasure); }
public ActionResult ReviewDevelopmentGoal(QuadrantMeasuresViewModel objQuadViewModel) { try { for (int i = 0; i < objQuadViewModel.DevelopmentPlanID.Length; i++) { int ID = objQuadViewModel.DevelopmentPlanID[i]; cCareerDevelopmentPlan objDevelopmentPlan = cCareerDevelopmentPlan.Get_ID(ID); objDevelopmentPlan.sManagerComment = objQuadViewModel.ManagerComments[i]; objDevelopmentPlan.Save(); } Session["ReviewDevGoal"] = "Manager Comment added successfully."; } catch (Exception ex) { throw ex; } return(RedirectToAction("ReviewDevelopmentGoal")); }