Ejemplo n.º 1
0
        public override bool Update(We7.Model.Core.PanelContext data)
        {
            IAdviceHelper helper = AdviceFactory.Create();
            string        id     = GetValue <string>(data, "ID");
            AdviceInfo    advice = helper.GetAdvice(id);

            if (advice == null)
            {
                Insert(data);
            }
            else
            {
                advice.Title   = GetValue <string>(data, "Title");
                advice.UserID  = GetValue <string>(data, "UserID");
                advice.Content = GetValue <string>(data, "Content");
                advice.Name    = GetValue <string>(data, "Name");
                advice.Email   = GetValue <string>(data, "Email");
                advice.Address = GetValue <string>(data, "Address");
                advice.Phone   = GetValue <string>(data, "Phone");
                advice.Fax     = GetValue <string>(data, "Fax");
                advice.Public  = GetValue <int>(data, "Public");

                int isshow;
                Int32.TryParse(GetValue <string>(data, "IsShow"), out isshow);
                advice.IsShow = isshow;


                advice.Display1 = GetValue <string>(data, "Display1");
                advice.Display2 = GetValue <string>(data, "Display2");
                advice.Display3 = GetValue <string>(data, "Display3");

                //下面是添加模型信息
                string config, schema;
                advice.ModelXml    = GetModelDataXml(data, advice.ModelXml, out schema, out config);//获取模型数据
                advice.ModelConfig = config;
                advice.ModelName   = data.ModelName;
                advice.ModelSchema = schema;
                advice.TypeID      = data.Objects["AdviceTypeID"] as string;
                helper.UpdateAdvice(advice);
                SetValue(data, "ID", advice.ID);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Clear();
            context.Response.Expires = -1;

            string        pwd    = context.Request["pwd"];
            string        id     = context.Request["id"];
            IAdviceHelper helper = AdviceFactory.Create();
            AdviceInfo    advice = helper.GetAdvice(id);

            if (advice != null && advice.MyQueryPwd == pwd)
            {
                context.Response.Write("true");
            }
            else
            {
                context.Response.Write("false");
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string id   = Request["id"];
         string type = Request["type"];
         if (!String.IsNullOrEmpty(id))
         {
             try
             {
                 IAdviceHelper helper = AdviceFactory.Create();
                 AdviceInfo    advice = helper.GetAdvice(id);
                 if (advice != null)
                 {
                     helper.UpdateAdviceState(id, 2);
                     ProccessMsg.Redirect(1, advice.TypeID, "受理成功!");
                 }
                 else
                 {
                     ProccessMsg.Redirect(0, advice.TypeID, "当前记录不存在!");
                 }
             }
             catch (System.Threading.ThreadAbortException ex)
             {
             }
             catch (Exception ex)
             {
                 ProccessMsg.Redirect(0, String.Empty, "应用程序错误!错误原因:" + ex.Message);
             }
         }
         else
         {
             ProccessMsg.Redirect(2, String.Empty, "当前记录不存在!");
         }
     }
 }