Пример #1
0
        /// <summary>
        /// 获取广告详细内容
        /// </summary>
        /// <param name="model">新建广告模型</param>
        public DemandDetailsModel GetOneDemandContentByID(Guid aid)
        {
            IRepository <Demand> rep = Factory.Factory <IRepository <Demand> > .GetConcrete <Demand>();

            Demand             demand = null;
            DemandDetailsModel target = null;

            try
            {
                demand = rep.GetByKey(aid);

                target = new DemandDetailsModel()
                {
                    BusinessmanName      = demand.BusinessmanName,
                    CustomerName         = demand.CustomerName,
                    CustomerOtherConnect = demand.CustomerOtherConnect,
                    CustomerPhoneNum     = demand.CustomerPhoneNum,
                    DemandCity           = demand.DemandCity,
                    DemandContent        = demand.DemandContent,
                    GroupOnType          = demand.GroupOnType,
                };
            }

            catch (Exception error)
            {
                throw new Exception(error.Message);
            }

            return(target);
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null)
         {
             string             id        = Request.QueryString["id"];
             DemandService      myservice = new DemandService();
             DemandDetailsModel demand    = myservice.GetOneDemandContentByID(new Guid(id));
             LB_BussissName.Text = demand.BusinessmanName;
             LB_City.Text        = demand.DemandCity;
             LB_Content.Text     = demand.DemandContent;
             LB_Name.Text        = demand.CustomerName;
             LB_Othernum.Text    = demand.CustomerOtherConnect;
             LB_Telnum.Text      = demand.CustomerPhoneNum;
             LB_Type.Text        = demand.GroupOnType;
         }
     }
 }