Example #1
0
File: Client.cs Project: uvbs/mmp
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="websiteOwner">站点所有者</param>
        public Client(string websiteOwner)
        {
            ZentCloud.BLLJIMP.BLL bll         = new ZentCloud.BLLJIMP.BLL();
            WebsiteInfo           websiteInfo = bll.Get <WebsiteInfo>(string.Format("WebsiteOwner='{0}'", websiteOwner));

            WebsiteOwner = websiteOwner;
            APIBaseUrl   = "http://" + ZentCloud.Common.ConfigHelper.GetConfigString("HongWareApiDomain");
            //Nick = websiteInfo.ApiNick;
            //Name = websiteInfo.ApiName;
            AppId    = websiteInfo.AuthorizerAppId;
            ShopName = websiteInfo.ShopName;
            OrgCode  = websiteInfo.OrgCode;
            if (websiteInfo.IsUnionHongware == 1)
            {
                if (string.IsNullOrEmpty(OrgCode))
                {
                    var orgModel = GetOrgCode();
                    if (orgModel != null)
                    {
                        if (orgModel.orgCode != null)
                        {
                            OrgCode = orgModel.orgCode.orgCode;
                            if (!string.IsNullOrEmpty(OrgCode))
                            {
                                websiteInfo.OrgCode = OrgCode;
                                bll.Update(websiteInfo);
                            }
                        }
                    }
                }
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            type     = string.IsNullOrWhiteSpace(Request["type"]) ? "0" : Request["type"];
            typeName = type == "0" ? "题库" : "问卷";
            model    = bll.Get <ZentCloud.BLLJIMP.Model.Questionnaire>(string.Format("QuestionnaireID={0}", Request["id"]));
            ZentCloud.BLLJIMP.Model.QuestionnaireRecord oldRecord = bll.GetByKey <ZentCloud.BLLJIMP.Model.QuestionnaireRecord>("QuestionnaireID", Request["id"]);
            if (oldRecord != null)
            {
                model.Questions = new List <BLLJIMP.Model.Question>();
                haseRecord      = true;
                return;
            }
            model.Questions = bll.GetList <ZentCloud.BLLJIMP.Model.Question>(int.MaxValue, string.Format("QuestionnaireID={0}", Request["id"]), "Sort Asc");
            List <ZentCloud.BLLJIMP.Model.Answer> modelAnswerList = bll.GetList <ZentCloud.BLLJIMP.Model.Answer>(string.Format("QuestionnaireID={0}", Request["id"]));

            for (int i = 0; i < model.Questions.Count; i++)
            {
                model.Questions[i].Answers = modelAnswerList.Where(p => p.QuestionID == model.Questions[i].QuestionID).ToList();
            }
        }