//新增報名 protected void GoSecondStep_Click(object sender, RegistGoSecondEventArgs e) { try { RegistActivity_Query1.Visible = false; Wizard1.Visible = true; //必要屬性 MyFormMode = FormViewMode.Insert; ActivityID = e.activity_id; EmpID = clsAuth.ID;//預設是登入者 RegistBy = clsAuth.ID;//執行是登入者 MyHiddenField.Value = ActivityID.ToString(); //載入活動資訊 GetActivityDefault(); //登入者為第一個團員 ACMS.VO.ActivityTeamMemberVO myActivityTeamMemberVO = new ACMS.VO.ActivityTeamMemberVO(); myActivityTeamMemberVO.activity_id = ActivityID; myActivityTeamMemberVO.emp_id = clsAuth.ID; myActivityTeamMemberVO.boss_id = RegistBy; myActivityTeamMemberVO.idno = ""; myActivityTeamMemberVO.remark = ""; myActivityTeamMemberVO.check_status = 0; myActivityTeamMemberVO.WORK_ID = clsAuth.WORK_ID; myActivityTeamMemberVO.NATIVE_NAME = clsAuth.NATIVE_NAME; myActivityTeamMemberVO.C_DEPT_ABBR = clsAuth.C_DEPT_ABBR; myActivityTeamMemberVO.C_DEPT_NAME = clsAuth.C_DEPT_NAME; myActivityTeamMemberVO.WritePersonInfo = "否"; //新增時,預設帶入登入者當團長 if (!Page_ActivityTeamMemberVOList.Exists(delegate(ACMS.VO.ActivityTeamMemberVO p) { return p.emp_id == myActivityTeamMemberVO.emp_id; })) { Page_ActivityTeamMemberVOList.Add(myActivityTeamMemberVO); } GridView_TemMember.DataSource = Page_ActivityTeamMemberVOList; GridView_TemMember.DataBind(); Wizard1.MoveTo(Wizard1.WizardSteps[0]); InitQueryBlock(ActivityID.ToString()); } catch (Exception ex) { WriteErrorLog("SecondStep", ex.Message, "0"); } }
//選取隊員之後 protected void GetEmployees_Click(object sender, EventArgs e) { GridView GridView_Employee = (GridView)OpenTeamMemberSelector1.FindControl("GridView_Employee"); int i; try { for (i = 0; i < GridView_Employee.Rows.Count; i++) { if (((CheckBox)GridView_Employee.Rows[i].FindControl("chkRJRA")).Checked) { ACMS.VO.ActivityTeamMemberVO myActivityTeamMemberVO = new ACMS.VO.ActivityTeamMemberVO(); myActivityTeamMemberVO.activity_id = ActivityID; myActivityTeamMemberVO.emp_id = GridView_Employee.DataKeys[i].Value.ToString(); myActivityTeamMemberVO.boss_id = RegistBy; myActivityTeamMemberVO.idno_type = 0; myActivityTeamMemberVO.idno = ""; myActivityTeamMemberVO.remark = ""; myActivityTeamMemberVO.check_status = 0; myActivityTeamMemberVO.WritePersonInfo = "否"; myActivityTeamMemberVO.WORK_ID = GridView_Employee.Rows[i].Cells[0].Text.ToString(); myActivityTeamMemberVO.NATIVE_NAME = GridView_Employee.Rows[i].Cells[1].Text.ToString(); myActivityTeamMemberVO.C_DEPT_NAME = GridView_Employee.Rows[i].Cells[2].Text.ToString(); if (!Page_ActivityTeamMemberVOList.Exists(delegate(ACMS.VO.ActivityTeamMemberVO p) { return p.emp_id == myActivityTeamMemberVO.emp_id; })) { Page_ActivityTeamMemberVOList.Add(myActivityTeamMemberVO); } } else { ACMS.VO.ActivityTeamMemberVO myActivityTeamMemberVO = Page_ActivityTeamMemberVOList.Find(delegate(ACMS.VO.ActivityTeamMemberVO p) { return p.emp_id == GridView_Employee.DataKeys[i].Value.ToString(); }); if (myActivityTeamMemberVO != null) { if (myActivityTeamMemberVO.emp_id != myActivityTeamMemberVO.boss_id) { Page_ActivityTeamMemberVOList.Remove(myActivityTeamMemberVO); } } } } } catch (Exception ex) { ShowMessageForAjax(this, "加入隊員失敗!"); WriteErrorLog("GetEmployee_click", ex.Message, "0"); } GridView_TemMember.DataSource = Page_ActivityTeamMemberVOList; GridView_TemMember.DataBind(); OpenTeamMemberSelector1.Page_ActivityTeamMemberVOList = Page_ActivityTeamMemberVOList; }