Exemplo n.º 1
0
        public override void InitControl()
        {
            hfValue.Value = lblValue.Text = (Value ?? "").ToString();
            string result = "";

            if (!string.IsNullOrEmpty(Request["model"]))
            {
                ModelInfo mi = ModelHelper.GetModelInfoByName(Request["model"]);
                if (mi != null && !string.IsNullOrEmpty(mi.RelationModelName))
                {
                    AdviceType adviceType = AdviceTypeHelper.GetAdviceTypeByModelName(mi.RelationModelName);
                    if (adviceType != null && !string.IsNullOrEmpty(adviceType.ID))
                    {
                        string adviceTypeID = adviceType.ID;
                        result = "<a href='" + GetUrl() + "?typeID=" + adviceTypeID + "&RelationID=" + hfValue.Value + "'>查看反馈</a>";
                    }
                }
            }
            ltlText.Text = result;
        }
Exemplo n.º 2
0
        public string GetText(object dataItem, ColumnInfo columnInfo)
        {
            string result = "#";
            string v      = ModelControlField.GetValue(dataItem, columnInfo.Name);

            string[] columnInfoSZ = columnInfo.Expression.Split(new char[] { '|' });
            if (columnInfoSZ.Length > 1 && !string.IsNullOrEmpty(columnInfoSZ[1]))
            {
                ModelInfo mi = ModelHelper.GetModelInfoByName(columnInfoSZ[1]);
                if (mi != null && !string.IsNullOrEmpty(mi.RelationModelName))
                {
                    AdviceType adviceType = AdviceTypeHelper.GetAdviceTypeByModelName(mi.RelationModelName);
                    if (adviceType != null && !string.IsNullOrEmpty(adviceType.ID))
                    {
                        string adviceTypeID = adviceType.ID;
                        result = "<a href='/admin/Advice/AdviceListEx.aspx?typeID=" + adviceTypeID + "&RelationID=" + v + "'>查看反馈</a>";
                    }
                }
            }
            return(result);
        }
Exemplo n.º 3
0
        public bool InsertEmailAdvice(We7.Model.Core.PanelContext data)
        {
            Advice advice = new Advice();

            advice.OwnID = Security.CurrentAccountID;
            //advice.TypeID = GetAdviceTypeID(data.ModelName);
            //advice.ID = GetValue<string>(data, "ID");
            advice.Title      = GetValue <string>(data, "Title");
            advice.UserID     = GetValue <string>(data, "UserID");
            advice.Content    = GetValue <string>(data, "Content");
            advice.CreateDate = DateTime.Now;
            advice.Updated    = DateTime.Now;

            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.State = (int)AdviceState.WaitAccept;
            advice.SN    = AdviceHelper.CreateArticleSN();
            int isshow;

            Int32.TryParse(GetValue <string>(data, "IsShow"), out isshow);
            string stateStr = StateMgr.StateProcess(advice.EnumState, EnumLibrary.Business.AdviceDisplay, isshow);

            advice.IsShow    = isshow;
            advice.EnumState = stateStr;
            advice.Display1  = GetValue <string>(data, "Display1");
            advice.Display2  = GetValue <string>(data, "Display2");
            advice.Display3  = GetValue <string>(data, "Display3");
            if (advice.SN < 100000)
            {
                advice.SN = advice.SN + 100000;
            }
            advice.MyQueryPwd = We7Helper.CreateNewID().Substring(1, 8);

            //下面是添加模型信息
            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      = GetValue <string>(data, "TypeID");
            if (String.IsNullOrEmpty(advice.TypeID))
            {
                AdviceType type = AdviceTypeHelper.GetAdviceTypeByModelName(data.ModelName);
                if (type != null)
                {
                    advice.TypeID = type.ID;
                }
            }

            AdviceHelper.AddAdvice(advice);

            SetValue(data, "ID", advice.ID);
            try
            {
                AdviceHelper.SendNotifyMail(advice.ID);
            }
            catch { }
            finally { }
            return(true);
        }