Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo();
         //從QueryString取得 簽核代碼
         string docID = String.IsNullOrEmpty(Request["SignDocID"]) ? String.Empty : Request["SignDocID"].ToString();
         //根據查詢的 簽核代碼 搜尋忘刷單
         model = _trainDetaiRepo.GetData(docID);
         WebUtils.PageDataBind(model, this.Page);
         Signed.NavigateUrl = "~/Area/Sign/WorkflowDetail.aspx?signDocID=" + docID;
     }
     PageInit();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo();
            _rootRepo       = RepositoryFactory.CreateRootRepo();
            if (!Authentication.HasResource(User.Identity.Name, "TrainDetail02"))
            {
                Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f");
            }
            if (!IsPostBack)
            {
                string signDocID = String.IsNullOrEmpty(Request["SignDocID_FK"]) ? String.Empty : Request["SignDocID_FK"].ToString();
                PageTitle.Value  = "受訓心得報告維護 > 編輯";
                FormSeries.Value = "Train";

                string CLID            = String.IsNullOrEmpty(Request["CLID"]) ? String.Empty : Request["CLID"].ToString();
                string SID             = String.IsNullOrEmpty(Request["SID"]) ? String.Empty : Request["SID"].ToString();
                var    employeeData    = _rootRepo.QueryForEmployeeByEmpID(SID);
                string DepartmentID_FK = employeeData != null ? employeeData["DepartmentID_FK"].ToString() : String.Empty;
                model = _trainDetaiRepo.GetDetail(CLID, SID, DepartmentID_FK);

                // 取得 QueryString
                //var paggerParms = WebUtils.ParseQueryString<PaggerParms>(Page.Request);
                //var signListParms = WebUtils.ParseQueryString<SignListParms>(Page.Request);
                //signListParms.Member = Authentication.GetMemberViewModel(User.Identity.Name);
                //signListParms.GridView = TrainDetailGridView;
                //signListParms.PaginationBar = paginationBar;
                //paggerParms.OrderField = "qno";

                ////建構頁面
                //ConstructPage(signListParms, paggerParms, RepositoryFactory.CreateTrainDetailRepo());
                WebUtils.PageDataBind(model, this.Page);
                if (!String.IsNullOrWhiteSpace(signDocID))
                {
                    //將 viewModel 的值綁定到 頁面上
                    WebUtils.PageDataBind(_trainDetaiRepo.GetData(signDocID), this.Page);

                    SignDocID_FK.Text = signDocID;
                    PageTitle.Value   = "表單編輯作業 > 忘刷單";
                }
            }
            PageInit();
        }