protected void Page_Load(object sender, EventArgs e) { _trainDetaiRepo = RepositoryFactory.CreateTrainDetailRepo(); _rootRepo = RepositoryFactory.CreateRootRepo(); if (!Authentication.HasResource(User.Identity.Name, "TrainDetail01")) { Response.Redirect(@"/account/logon.aspx?ReturnUrl=%2f"); } if (!IsPostBack) { PageTitle.Value = "學員意見調查維護 > 編輯"; 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); SaveBtn.Attributes.Add("onclick ", "return confirm( '提醒:送出後就不可更改,確定要送出嗎?');"); } 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(); }