Пример #1
0
        public int SaveAnswers(ManageFeedBack entity)
        {
            if (entity.feedbackAnswerId == 0)
            {
                var a = (from b in objAlpha.FeedbackAnswerMasters
                         join c in objAlpha.FeedbackQuestionMasters
                         on b.Feedback_Question_ID equals c.Feedback_Question_ID
                         where b.Feedback_Answer.ToLower() == entity.FeedbackAnswer.ToLower()
                         select b).SingleOrDefault();
                if (a == null)
                {
                    FeedbackAnswerMaster obj = new FeedbackAnswerMaster();
                    obj.Feedback_Question_ID = entity.FeedbackQuestionId;
                    obj.Feedback_Answer      = entity.FeedbackAnswer;
                    obj.Status = entity.Status;
                    objAlpha.FeedbackAnswerMasters.InsertOnSubmit(obj);
                    objAlpha.SubmitChanges();
                    return(1);
                }

                else
                {
                    return(0);
                }
            }

            else
            {
                return(0);
            }
        }
Пример #2
0
        public int SaveQuestion(ManageFeedBack objF)
        {
            if (objF.FeedbackQuestionId == 0)
            {
                var a = (from b in objAlpha.FeedbackQuestionMasters
                         where b.Feedback_Question.ToLower() == objF.FeedbackQuestion.ToLower()
                         select b).SingleOrDefault();
                if (a == null)
                {
                    FeedbackQuestionMaster obj = new FeedbackQuestionMaster();
                    obj.Feedback_Question = objF.FeedbackQuestion;
                    obj.Status            = objF.Status;
                    objAlpha.FeedbackQuestionMasters.InsertOnSubmit(obj);
                    objAlpha.SubmitChanges();
                    return(1);
                }


                else
                {
                    return(0);
                }
            }

            else
            {
                return(0);
            }
        }
Пример #3
0
        public int UpdateQuestion(ManageFeedBack entity)
        {
            var r = (from p in objAlpha.FeedbackQuestionMasters
                     where p.Feedback_Question_ID == entity.FeedbackQuestionId
                     select p).SingleOrDefault();

            if (r != null)
            {
                r.Feedback_Question_ID = entity.FeedbackQuestionId;
                r.Feedback_Question    = entity.FeedbackQuestion;
                objAlpha.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
Пример #4
0
        public int UpdateAnswers(ManageFeedBack entity)
        {
            var a = (from p in objAlpha.FeedbackAnswerMasters
                     where p.Feedback_Answer_ID == entity.feedbackAnswerId
                     select p).SingleOrDefault();

            if (a != null)
            {
                a.Feedback_Question_ID = entity.FeedbackQuestionId;
                a.Feedback_Answer_ID   = entity.feedbackAnswerId;
                a.Feedback_Answer      = entity.FeedbackAnswer;
                objAlpha.SubmitChanges();
                return(1);
            }
            else
            {
                return(0);
            }
        }
Пример #5
0
        public ManageFeedBack DispalyQues(ManageFeedBack entity)
        {
            var a = (from b in objAlpha.FeedbackQuestionMasters
                     where b.Feedback_Question_ID == entity.FeedbackQuestionId
                     select new
            {
                b.Feedback_Question,
            }).SingleOrDefault();

            if (a != null)
            {
                entity.FeedbackQuestion = a.Feedback_Question;
                return(entity);
            }
            else
            {
                return(entity);
            }
        }
Пример #6
0
        public ManageFeedBack ShowAnswerStatus(ManageFeedBack entity)
        {
            var a = (from b in objAlpha.FeedbackAnswerMasters
                     where b.Feedback_Answer_ID == entity.feedbackAnswerId
                     select new
            {
                b.Feedback_Answer,
                b.Status
            }).SingleOrDefault();

            if (a != null)
            {
                entity.FeedbackAnswer = a.Feedback_Answer;
                entity.Status         = Convert.ToBoolean(a.Status);
                return(entity);
            }
            else
            {
                return(entity);
            }
        }
Пример #7
0
        public ManageFeedBack ShowQuestionStatus(ManageFeedBack entity)
        {
            var a = (from b in objAlpha.FeedbackQuestionMasters
                     where b.Feedback_Question_ID == entity.FeedbackQuestionId
                     select new
            {
                b.Feedback_Question,
                b.Status
            }).SingleOrDefault();

            if (a != null)
            {
                entity.FeedbackQuestion = a.Feedback_Question;
                entity.Status           = Convert.ToBoolean(a.Status);
                return(entity);
            }
            else
            {
                return(entity);
            }
        }