示例#1
0
        public bool CheckQuota(string string_0, string string_1, janswer janswer_0, out string string_2)
        {
            bool flag = false;

            string_2 = "";
            if (this.oSurveyQuotaDal.ExistsByQName(janswer_0.questionname, janswer_0.code))
            {
                string      string_3 = string.Format(GClass0.smethod_0("0ħȭ̥ќՊ؝ܖࠛड़ੋୗౚഖ๦ཁ၁ᅄቔፉᑾᕛᙂ᝘ᡊᤊᩞᭀ᱂ᵔṀἄ⁲ⅷ≤⍳⑋╗♒❒⡄⥔⩘⭕ⱒⴶ⸨⼳とㄢ㉬㌷㐯㕯㙣㝨㠫㥉㩆㭌㱂㴻㸢㽿䀲䅿䈦"), janswer_0.questionname, janswer_0.code);
                SurveyQuota bySql    = this.oSurveyQuotaDal.GetBySql(string_3);
                string_2 = bySql.QUESTION_TITLE;
                int num  = bySql.SAMPLE_TARGET + bySql.SAMPLE_BACKUP - bySql.SAMPLE_FINISH;
                int num2 = bySql.SAMPLE_TARGET + bySql.SAMPLE_BACKUP - (bySql.SAMPLE_FINISH + bySql.SAMPLE_RUNNING);
                if (bySql.SAMPLE_OVER == 1 && num <= 0)
                {
                    flag = true;
                }
                if (bySql.SAMPLE_OVER == 2 && num2 <= 0)
                {
                    flag = true;
                }
                if (!flag)
                {
                    SurveyQuotaAnswer surveyQuotaAnswer = new SurveyQuotaAnswer();
                    surveyQuotaAnswer.SURVEY_ID     = string_0;
                    surveyQuotaAnswer.SURVEY_GUID   = string_1;
                    surveyQuotaAnswer.QUESTION_NAME = bySql.QUESTION_NAME;
                    surveyQuotaAnswer.CODE          = bySql.CODE;
                    surveyQuotaAnswer.IS_FINISH     = 0;
                    int num3 = this.oSurveyQuotaAnswerDal.AddOne(surveyQuotaAnswer);
                    if (num3 == 0)
                    {
                        bySql.SAMPLE_RUNNING++;
                    }
                    if (bySql.SAMPLE_OVER == 1)
                    {
                        bySql.SAMPLE_REAL = bySql.SAMPLE_FINISH;
                    }
                    if (bySql.SAMPLE_OVER == 2)
                    {
                        bySql.SAMPLE_REAL = bySql.SAMPLE_FINISH + bySql.SAMPLE_RUNNING;
                    }
                    bySql.SAMPLE_BALANCE = bySql.SAMPLE_TOTAL - bySql.SAMPLE_REAL;
                    if (bySql.SAMPLE_BALANCE > 0)
                    {
                        bySql.IS_FULL = GClass0.smethod_0("吧");
                    }
                    else
                    {
                        bySql.IS_FULL = GClass0.smethod_0("昮");
                    }
                    this.oSurveyQuotaDal.Update(bySql);
                }
            }
            return(flag);
        }
示例#2
0
        public List <jquotaanswer> BuildQuotaJson(string string_0, string string_1, QSingle qsingle_0, string string_2, string string_3, string string_4)
        {
            List <jquotaanswer> list         = new List <jquotaanswer>();
            jquotaanswer        jquotaanswer = new jquotaanswer();

            jquotaanswer.surveyid   = string_0;
            jquotaanswer.surveyguid = string_3;
            jquotaanswer.pageid     = string_1;
            jquotaanswer.projectid  = string_2;
            jquotaanswer.isfinish   = string_4;
            janswer janswer = new janswer();

            janswer.questionname = qsingle_0.QuestionName;
            janswer.code         = qsingle_0.SelectedCode;
            jquotaanswer.qanswers.Add(janswer);
            list.Add(jquotaanswer);
            return(list);
        }