예제 #1
0
        /// <summary>
        /// 检查是否存在该模板
        /// </summary>
        private void CkHaveTpl()
        {
            string Id    = RequestData.Get("SurveyId") + "";
            var    SqEnt = SurveyQuestion.FindAllByProperties(SurveyQuestion.Prop_IsFixed, "1", SurveyQuestion.Prop_TurnSurveyId, Id);

            if (SqEnt.Length > 0)
            {
                this.PageState.Add("HaveTpl", "1"); // 1 Exist
            }
            else
            {
                this.PageState.Add("HaveTpl", "0");
            }
        }
        /// <summary>
        /// 与OA单据关联
        /// </summary>
        private void SetOARef()
        {
            string SurveyId = RequestData.Get("SurveyId") + "";
            string Value    = RequestData.Get("Value") + "";

            // SearchCriterion.AddSearch("CompanyId", CompanyId);  //公司后续使用
            SurveyQuestion[] Ents  = SurveyQuestion.FindAllByProperties("IsFixed", "2");
            string           state = string.Empty;

            foreach (var v in Ents)
            {
                if (v.Id == SurveyId)
                {
                    v.OARef = Value;
                    state   = "1";
                }
                else
                {
                    v.OARef = "";
                }
                v.DoUpdate();
            }
            this.PageState.Add("State", state);
        }