コード例 #1
0
        public void UpdateRecord(HttpContext context)
        {
            string json      = context.Request["param"];
            string dealerIDs = context.Request["dealerIds"];

            Common.Entity.InfoList info = JsonConvert.DeserializeObject <Common.Entity.InfoList>(json);
            info.ModifyDate = DateTime.Now;
            int result = 0;

            try
            {
                BLL.InfoList   infoList   = new BLL.InfoList();
                BLL.InfoAttach attachList = new InfoAttach();
                // 删除附件
                if (context.Session["deleteAttachmentList"] != null)
                {
                    ArrayList deleteAttachmentList = context.Session["deleteAttachmentList"] as ArrayList;
                    attachList.DeleteByList(deleteAttachmentList);
                }
                if (context.Session["infoID"] != null && context.Session["deleteAttachmentList"] != null)
                {
                    // 保存信息
                    result = infoList.Update(info);
                    if (result > 0)
                    {
                        ArrayList addAttachmentList = (ArrayList)context.Session["addAttachmentList"];
                        attachList.AddAttachment(info.PKID, addAttachmentList);
                        context.Response.Write("{\"msg\":\"更新成功\",\"success\":true}");
                    }
                    else
                    {
                        context.Response.Write("{\"msg\":\"更新失败\",\"success\":false}");
                    }
                }
                else
                {
                    result = infoList.Update(info);
                    if (result > 0)
                    {
                        context.Response.Write("{\"msg\":\"更新成功\",\"success\":true}");
                    }
                    else
                    {
                        context.Response.Write("{\"msg\":\"更新失败\",\"success\":false}");
                    }
                }
                if (!string.IsNullOrEmpty(dealerIDs))
                {
                    infoList.InsertDealerInfo(info.PKID, dealerIDs.Remove(dealerIDs.Length - 2, 2).Remove(0, 2).Replace("\",\"", ","));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #2
0
    private void FixedUpdate()
    {
        if (pressed)
        {
            if (!triggered && !active)
            {
                RaycastHit hit;
                Transform  cameraTrans = Camera.main.transform;
                Ray        forwardRay  = new Ray(cameraTrans.position, cameraTrans.forward);

                if (Physics.Raycast(forwardRay, out hit, Camera.main.farClipPlane))
                {
                    if (hit.collider.tag == "Moveable" || hit.collider.tag == "Interactible")
                    {
                        InfoAttach info = hit.collider.GetComponent <InfoAttach>();
                        if (info)
                        {
                            text.text = info.info;
                        }
                        active = true;
                    }
                    else
                    {
                        text.text = "";
                        active    = false;
                    }
                }

                triggered = true;
            }
            else if (!triggered && active)
            {
                active = false;
            }
        }
        else
        {
            triggered = false;
        }
    }