Beispiel #1
0
        public bool InsertResult(QuestionsModel Res)
        {
            try
            {
                if (_VoitingBaseDataContext.QuestAnswers.Where(a => a.EmpId == Res.Empl.Id && a.AnketaId == AnketaId).Count() > 0)
                {
                    return(true);
                }

                foreach (CQuestion Q in Res.Questions)
                {
                    QuestAnswers Qa = new QuestAnswers()
                    {
                        //AnketaId = Res.AnketaId,
                        AnketaId   = AnketaId,
                        EmpDepNum  = Res.Empl.DepId,
                        AnswerDate = DateTime.Now,
                        EmpDepPos  = Res.Empl.PosId,
                        EmpId      = Res.Empl.Id,
                        QuestionId = Q.QId,
                        Result     = Q.Result,
                        Ip         = Res.IpAddress,
                        CompName   = Res.CompName,
                        Agent      = Res.UserAgent
                    };
                    _VoitingBaseDataContext.QuestAnswers.InsertOnSubmit(Qa);
                }
                _VoitingBaseDataContext.SubmitChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #2
0
 partial void DeleteQuestAnswers(QuestAnswers instance);
Beispiel #3
0
 partial void UpdateQuestAnswers(QuestAnswers instance);
Beispiel #4
0
 partial void InsertQuestAnswers(QuestAnswers instance);
Beispiel #5
0
 private void detach_QuestAnswers(QuestAnswers entity)
 {
     this.SendPropertyChanging();
     entity.QuestQuestions = null;
 }
Beispiel #6
0
 private void attach_QuestAnswers(QuestAnswers entity)
 {
     this.SendPropertyChanging();
     entity.QuestAnketa = this;
 }