/// <summary> /// Create a new SkillsInfo object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="userId">Initial value of the UserId property.</param> /// <param name="overView">Initial value of the OverView property.</param> /// <param name="yourSkills">Initial value of the YourSkills property.</param> public static SkillsInfo CreateSkillsInfo(global::System.String id, global::System.String userId, global::System.String overView, global::System.String yourSkills) { SkillsInfo skillsInfo = new SkillsInfo(); skillsInfo.ID = id; skillsInfo.UserId = userId; skillsInfo.OverView = overView; skillsInfo.YourSkills = yourSkills; return skillsInfo; }
/// <summary> /// Deprecated Method for adding a new object to the SkillsInfo EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSkillsInfo(SkillsInfo skillsInfo) { base.AddObject("SkillsInfo", skillsInfo); }
public ActionResult AddSkills(UI.ViewModels.SkillsModel SkillsInfo, FormCollection FormPost) { if (ModelState.IsValid) { var UserInfo = (DAL.UserInfo)Session["UserLogin"]; var SkillsResult = DbEntities.SkillsInfo.SingleOrDefault(p => p.UserId == UserInfo.UserID); SkillsInfo.PhotoPath = FormPost["PhotoPathHidden"]; if (SkillsResult == null) { DAL.SkillsInfo NewSkills = new SkillsInfo(); NewSkills.ID = BLL.BaseUtility.GenerateGUID(); NewSkills.UserId = UserInfo.UserID; NewSkills.PhotoPath = SkillsInfo.PhotoPath; NewSkills.TagLine = SkillsInfo.TagLine; NewSkills.MyRate = SkillsInfo.MyRate; NewSkills.SystemRate = SkillsInfo.SystemRate; NewSkills.OverView = SkillsInfo.OverView; NewSkills.YourSkills = SkillsInfo.YourSkills; DbEntities.SkillsInfo.AddObject(NewSkills); DbEntities.SaveChanges(); } else { SkillsResult.UserId = UserInfo.UserID; SkillsResult.PhotoPath = SkillsInfo.PhotoPath; SkillsResult.TagLine = SkillsInfo.TagLine; SkillsResult.MyRate = SkillsInfo.MyRate; SkillsResult.SystemRate = SkillsInfo.SystemRate; SkillsResult.OverView = SkillsInfo.OverView; SkillsResult.YourSkills = SkillsInfo.YourSkills; DbEntities.SaveChanges(); } } return View(SkillsInfo); }