예제 #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;
 }