コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.hd_eventId.Value = Request.QueryString["id"];

                EventBLL eventBll = new EventBLL();
                Timeline.AppCode.Domain.Event myEvent = null;
                if (Request.QueryString["id"] != null)
                {
                    myEvent = eventBll.getEvent(int.Parse(Request.QueryString["id"]));
                }
                else
                {
                    myEvent = eventBll.getEvent(7);
                }

                this.tb_dateFrom.Text  = String.Format("{0:MM/dd/yyyy}", myEvent.from);
                this.tb_dateTo.Text    = String.Format("{0:MM/dd/yyyy}", myEvent.to);
                this.lb_eventName.Text = myEvent.name;
                this.lb_location.Text  = myEvent.location;
                this.lb_from.Text      = String.Format("{0:g}", myEvent.from);
                this.lb_to.Text        = String.Format("{0:g}", myEvent.to); //String.Format("{0:MM/dd/yyyy}", myEvent.to)
                this.lb_status.Text    = myEvent.status;
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                EventBLL eventBll = new EventBLL();
                Timeline.AppCode.Domain.Event myEvent = null;
                if (Request.QueryString["id"] != null || Request.QueryString["id"] != "")
                {
                    myEvent = eventBll.getEvent(int.Parse(Request.QueryString["id"]));
                }
                else
                {
                    myEvent = eventBll.getEvent(7);
                }
                hf_eventId.Value      = myEvent.id.ToString();
                this.tb_name.Text     = myEvent.name;
                this.tb_location.Text = myEvent.location;

                this.tb_dateFrom.Text = String.Format("{0:MM/dd/yyyy}", myEvent.from);
                this.tb_dateTo.Text   = String.Format("{0:MM/dd/yyyy}", myEvent.to);

                this.tb_timeFrom.Text = String.Format("{0:HH:mm:ss}", myEvent.from);
                this.tb_timeTo.Text   = String.Format("{0:HH:mm:ss}", myEvent.to);


                foreach (GridViewRow row in this.gv_friends.Rows)
                {
                    HiddenField hd      = row.Cells[3].FindControl("hf_friendId") as HiddenField;
                    User        userTmp = new User();
                    userTmp.userId = int.Parse(hd.Value);

                    if (myEvent.participants.Contains(userTmp))
                    {
                        CheckBox check = row.Cells[2].FindControl("cb_select") as CheckBox;
                        check.Checked = true;
                    }
                }
            }
        }