示例#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;
 }