Пример #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);
            }
        }
Пример #2
0
 partial void DeleteQuestAnswers(QuestAnswers instance);
Пример #3
0
 partial void UpdateQuestAnswers(QuestAnswers instance);
Пример #4
0
 partial void InsertQuestAnswers(QuestAnswers instance);
Пример #5
0
 private void detach_QuestAnswers(QuestAnswers entity)
 {
     this.SendPropertyChanging();
     entity.QuestQuestions = null;
 }
Пример #6
0
 private void attach_QuestAnswers(QuestAnswers entity)
 {
     this.SendPropertyChanging();
     entity.QuestAnketa = this;
 }