Esempio n. 1
0
        public Int64 Insert(OEQuestionBank item, out ErrorEntity ErrInfo)
        {
            //Error Judge Define
            if (item.FContentClassId == 0)
            {
                ErrInfo = new ErrorEntity("QB010001", "内容类别不能为空!");
                return -1;
            }
            if (string.IsNullOrEmpty(item.FQBankCode))
            {
                ErrInfo = new ErrorEntity("QB010002", "题库编号不能为空!");
                return -1;
            }
            if (string.IsNullOrEmpty(item.FQBankName))
            {
                ErrInfo = new ErrorEntity("QB010003", "题库名称不能为空!");
                return -1;
            }

            if (!ChkCodeDuplicate(item.FQBankId.ToString(), item.FQBankCode))
            {
                ErrInfo = new ErrorEntity("QB010004", "题库编号重复,不能保存!");
                return -1;
            }
            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("FContentClassId", item.FContentClassId.ToString());
            parameters.Add("FQBankCode", item.FQBankCode);
            parameters.Add("FQBankName", item.FQBankName);
            parameters.Add("FQBankContent", item.FQBankContent);
            return Insert(parameters, out ErrInfo);
        }
Esempio n. 2
0
 public void SaveItem()
 {
     string _FQBankId = Parameters["pFQBankId"];
     // other paramters fill here
     string _FContentClassId = Parameters["pFContentClassId"];
     string _FQBankCode = Parameters["FQBankCode"];
     string _FQBankName = Parameters["pFQBankName"];
     string _FQBankContent = Parameters["pFQBankContent"];
     OEQuestionBank item = new OEQuestionBank();
     item.FQBankId = string.IsNullOrEmpty(_FQBankId) ? 0 : Convert.ToInt64(_FQBankId);
     item.FContentClassId = string.IsNullOrEmpty(_FContentClassId) ? 0 : Convert.ToInt64(_FContentClassId);
     item.FQBankCode = _FQBankCode;
     item.FQBankName = _FQBankName;
     item.FQBankContent = _FQBankContent;
     OEQuestionBankBiz biz = new OEQuestionBankBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     if (item.FQBankId == 0)
     {
         biz.Insert(item, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }
Esempio n. 3
0
 public void GetItem()
 {
     string _id = Parameters["pid"];
     OEQuestionBank item = new OEQuestionBank();
     OEQuestionBankBiz biz = new OEQuestionBankBiz();
     item = biz.Select(_id);
     if (item == null)
     {
         Response.Write("");
     }
     else
     {
         Response.Write(item.ToJson());
     }
 }