Beispiel #1
0
        /// <summary>
        /// Updated the beacon PID; The ID 1 (without dashes) + 5 digits ID 2
        /// (padded with zeros) + 5 digits ID 3 (padded with zeros).
        /// </summary>
        private void UpdatePid()
        {
            string template  = "00000";
            string beaconId2 = Id2.ToString();
            string beaconId3 = Id3.ToString();

            beaconId2 = template.Substring(beaconId2.Length) + beaconId2;
            beaconId3 = template.Substring(beaconId3.Length) + beaconId3;
            string pid = Id1.Replace(HexStringSeparator.ToString(), string.Empty) + beaconId2 + beaconId3;

            Pid = pid.ToLower();
        }
        public void ProcessRequest(HttpContext context)
        {
            long    Id;
            int     Id1, Id2;
            string  result = "";
            decimal Score  = 0;

            try
            {
                Id    = Convert.ToInt64(DESEncrypt.Decrypt(context.Request.Params["id"].ToString()));
                Id1   = Convert.ToInt32(DESEncrypt.Decrypt(context.Request.Params["id1"].ToString()));
                Id2   = Convert.ToInt32(DESEncrypt.Decrypt(context.Request.Params["id2"].ToString()));
                Score = Convert.ToDecimal(context.Request.Params["txtScore"].ToString());

                var model  = new Model.CCOM.Examination_subject_score();
                var _model = new Model.CCOM.Examination_subject_score();
                BLL.CCOM.Examination_subject_score Bess = new BLL.CCOM.Examination_subject_score();

                model                   = new BLL.CCOM.Examination_subject_score().GetModel(" Esn_id = " + Id1 + " AND User_id=" + Id + " AND Judge_id=" + Id2);
                _model.Esn_id           = Id1;
                _model.Ess_score        = Score;
                _model.Judge_id         = Id2;
                _model.User_id          = Id;
                _model.Ess_score_status = true;
                _model.Ess_order_status = true;
                if (model != null)
                {
                    _model.Ess_id = model.Ess_id;
                    Bess.Update(_model);
                }
                else
                {
                    Bess.Add(_model);
                }
                new Calculation().calculateSubjectXu(Id1.ToString(), Id2.ToString());
                result += "添加成功";
            }
            catch (Exception ex)
            {
                ILog LOGGER = LogManager.GetLogger("quanquan");
                LOGGER.Debug(ex.Message, ex);
                result += "添加失败,请重新尝试";
            }
            context.Response.ContentType = "text/plain";
            context.Response.Write(result);
        }