public static tblQuestions MapData(Questions k) { tblQuestions tk = new tblQuestions() { QuestionID = k.QuestionID, QuestionImage = k.QuestionImage, QuestionText = k.QuestionText, QuestionTitle = k.QuestionTitle, SubjectID = k.SubjectID, UserID = k.UserID }; return(tk); }
public static Questions MapData(tblQuestions k) { Questions kul = new Questions() { QuestionID = k.QuestionID, QuestionImage = k.QuestionImage, QuestionText = k.QuestionText, QuestionTitle = k.QuestionTitle, SubjectID = k.SubjectID, UserID = k.UserID //tablodakileri sınıflara attık }; return(kul); }
public string insertQuestion(tblQuestions ques) { Entities db = new Entities(); tblQuestions ques1 = new tblQuestions(); ques1.SectionID = ques.SectionID; ques1.QuesDescription = ques.QuesDescription; ques1.DifficultyLevel = ques.DifficultyLevel; ques1.AnsOption1 = ques.AnsOption1; ques1.AnsOption2 = ques.AnsOption2; ques1.AnsOption3 = ques.AnsOption3; ques1.AnsOption4 = ques.AnsOption4; ques1.CorrectAns = ques.CorrectAns; db.tblQuestions.Add(ques1); db.SaveChanges(); int newQuesID = ques1.QuestionID; //insert into QuesAns Table return("Congrats! Data Added.." + newQuesID + "th record added!"); }
public string InsertQuestion(tblQuestions ques) { return(Questest.insertQuestion(ques)); }