private void FillModel(VST_Route m)
 {
     if (m == null) return;
     ID = m.ID;
     Code = m.Code;
     Name = m.Name;
     VisitCycle = m.VisitCycle;
     VisitDay = m.VisitDay;
     IsMustSequenceVisit = m.IsMustSequenceVisit.ToUpper() == "Y";
 }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        #region 初始化界面控件
        tr_OrganizeCity = (MCSTreeControl)pl_detail.FindControl("VST_Route_OrganizeCity");
        ddl_RelateStaff = (DropDownList)pl_detail.FindControl("VST_Route_RelateStaff");
        if (tr_OrganizeCity != null)
        {
            tr_OrganizeCity.Selected += tr_OrganizeCity_Selected;
            tr_OrganizeCity.AutoPostBack = true;
        }
        #endregion

        // 在此处放置用户代码以初始化页面
        if (!Page.IsPostBack)
        {
            #region 获取页面参数
            ViewState["ID"] = Request.QueryString["ID"] != null ? int.Parse(Request.QueryString["ID"]) : 0;
            #endregion

            BindDropDown();

            //TDP维护自己的路线
            if ((int)Session["OwnerType"] == 3) Header.Attributes["WebPageSubCode"] = "OwnerType=3";

            if ((int)ViewState["ID"] != 0)
            {
                //修改
                BindData();
            }
            else
            {
                //新增
                VST_Route m = new VST_Route();
                m.OrganizeCity = (int)Session["OrganizeCity"];
                m.EnableFlag = "Y";
                m.InsertTime = DateTime.Now;

                pl_detail.BindData(m);
                tr_OrganizeCity_Selected(null, null);
            }
        }
    }
 public VisitRoute(VST_Route m)
 {
     if (m != null) FillModel(m);
 }