protected void btnRegistration_Click(object sender, EventArgs e) { ActivityParticipants er = new ActivityParticipants(); string id = Request["id"]; string TopNavId = Request["TopNavId"] == null ? string.Empty : Request["TopNavId"]; string CurNavId = Request["CurNavId"] == null ? string.Empty : Request["CurNavId"]; string EventAccount = txtEventAccount.Text.Trim(); if (isBookMax(id)) { Response.Write("<script defer='defer'>alert('这个活动名额已满!!');</script>"); Response.Write("<script>window.location.href='NY_Home_eventDetail.aspx?TopNavId=" + TopNavId + "&CurNavId=" + CurNavId + "&id=" + id.ToString() + "';</script>"); return; } if (isRegist(id, EventAccount)) { Response.Write("<script defer='defer'>alert('您已报名或者员工号已提交过,请勿重复提交!');</script>"); Response.Write("<script>window.location.href='NY_Home_eventDetail.aspx?TopNavId=" + TopNavId + "&CurNavId=" + CurNavId + "&id=" + id.ToString() + "';</script>"); return; } if (isBookTime(id)) { Response.Write("<script defer='defer'>alert('您已错过报名时间!');</script>"); Response.Write("<script>window.location.href='NY_Home_eventDetail.aspx?TopNavId=" + TopNavId + "&CurNavId=" + CurNavId + "&id=" + id.ToString() + "';</script>"); return; } er.NY_EventSolicitationID = id; er.UserAccount = UserInfo.Account; er.UserDisplayName = txtName.Text.Trim(); er.RegistTime = DateTime.Now; er.Sex = int.Parse(dropSex.SelectedValue); er.PhoneNumber = txtPhoneNumber.Text.Trim(); er.EventAccount = txtEventAccount.Text.Trim(); er.Email = txtEmail.Text.Trim() + "@hkbea.com"; esSerivce.GenericService.Add(er); esSerivce.GenericService.Save(); Response.Write("<script defer='defer'>alert('报名已成功!');</script>"); //Fxm.Utility.Page.MessageBox.Show("保存已成功!"); Response.Write("<script>window.location.href='NY_Home_eventsDetail.aspx?TopNavId=" + TopNavId + "&CurNavId=" + CurNavId + "&id=" + id.ToString() + "';</script>"); }
protected void btnRegistration_Click(object sender, EventArgs e) { ActivityParticipants er = new ActivityParticipants(); string id = Request["id"]; string EventAccount = UserInfo.Account; if (esSerivce.isBookMax(id)) { Fxm.Utility.Page.MessageBox.Show("这个活动名额已满!"); return; } if (esSerivce.isRegist(id, EventAccount)) { Fxm.Utility.Page.MessageBox.Show("您已报名,请勿重复提交!"); return; } if (eventSerivce.isBookTime(id)) { Fxm.Utility.Page.MessageBox.Show("您已错过报名时间!"); return; } var user = userService.GenericService.GetAll(p => p.Account == EventAccount).First(); er.NY_EventSolicitationID = id; er.UserAccount = UserInfo.Account; //er.UserDisplayName = NySoftland.Moss.Helper.GetCurrentDisplayName(); er.UserDisplayName = userDisplayName.UserDisplayName(); er.RegistTime = DateTime.Now; //er.Sex = int.Parse(dropSex.SelectedValue); er.PhoneNumber = user.MobilePhone; er.EventAccount = user.OrganizationName; er.Email = user.Email; esSerivce.GenericService.Add(er); esSerivce.GenericService.Save(); Fxm.Utility.Page.MessageBox.Show("您已成功报名,可在报名记录中查询到您的报名记录!"); LoadEvents(id.ToString()); GetRegAndBind(id.ToString(), 1); }