Exemple #1
0
        protected override void SetEditObject(object obj)
        {
            if (obj == null)
            {
                this.txtRouteDescriptionEdit.Text   = "";
                this.drpRouteTypeEdit.SelectedIndex = 0;
                //				this.dateEffectiveDateEdit.Text	= "";
                //				this.dateInvalidDateEdit.Text	= "";
                this.txtRouteCodeEdit.Text   = "";
                this.chbRouteEnabled.Checked = true;

                return;
            }

            this.txtRouteDescriptionEdit.Text = ((Route)obj).RouteDescription.ToString();
            try
            {
                this.drpRouteTypeEdit.SelectedValue = ((Route)obj).RouteType.ToString();
            }
            catch
            {
                this.drpRouteTypeEdit.SelectedIndex = 0;
            }

            //			this.dateEffectiveDateEdit.Text	= FormatHelper.ToDateString(((Route)obj).EffectiveDate);
            //			this.dateInvalidDateEdit.Text	= FormatHelper.ToDateString(((Route)obj).InvalidDate);

            this.txtRouteCodeEdit.Text   = ((Route)obj).RouteCode.ToString();
            this.chbRouteEnabled.Checked = (((Route)obj).Enabled == FormatHelper.TRUE_STRING);
            if (_facade == null)
            {
                _facade = new BaseModelFacadeFactory(base.DataProvider).Create();
            }
            if (_facade.IsRouteRef(((Route)obj).RouteCode.ToString()))
            {
                this.txtRouteCodeEdit.ReadOnly = true;
            }
        }