private string ImportEnrollData(string pRequest) { HttpFileCollection files = HttpContext.Current.Request.Files; string errorMessage = ""; //1. 保存上传的文件 //string fileName = Utils.SaveUploadAttachment(files, PrivateLoggingSessionInfo.ClientID, PrivateLoggingSessionInfo.UserID, out errorMessage); string fileName = Utils.SaveUploadAttachment(files, "PrivateLoggingSessionInfo.ClientID", "PrivateLoggingSessionInfo.UserID", out errorMessage); var rp = pRequest.DeserializeJSONTo <APIRequest <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRP> >(); rp.Parameters.Validate(); var rd = new JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD(); int total = 0, add = 0, update = 0; string result = PrivateLEventSignUpBLL.ImportEnrollData(fileName, rp.Parameters, out total, out add, out update); var rsp = new SuccessResponse <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD>(rd); if (!string.IsNullOrEmpty(result)) { rsp.ResultCode = 201; rsp.Message = result; rsp.Data.Total = total; rsp.Data.Add = add; rsp.Data.Update = update; } return(rsp.ToJSON()); }
private string DownEnrollTpl(string pRequest) { var rp = pRequest.DeserializeJSONTo <APIRequest <JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRP> >(); rp.Parameters.Validate(); var rd = new EmptyRD(); // new JIT.CPOS.BS.BLL.LEventSignUpBLL.DownEnrollTplRD(); DataTable dataTable = PrivateLEventSignUpBLL.DownEnrollTpl(rp.Parameters.EventID, rp.Parameters.Status); //数据获取 Workbook wb = DataTableExporter.WriteXLS(dataTable, 0); string savePath = HttpContext.Current.Server.MapPath(@"~/File/Excel"); if (!System.IO.Directory.Exists(savePath)) { System.IO.Directory.CreateDirectory(savePath); } savePath = savePath + "\\报名人员模板-" + dataTable.TableName + ".xls"; wb.Save(savePath);//保存Excel文件 new ExcelCommon().OutPutExcel(HttpContext.Current, savePath); HttpContext.Current.Response.End(); var rsp = new SuccessResponse <IAPIResponseData>(rd); if (dataTable == null || !(dataTable.Columns.Count > 0)) { rsp.ResultCode = 201; rsp.Message = "生成失败!"; } return(rsp.ToJSON()); }
protected string DoGetEventUserMapping(string pRequest) { //1、请求参数反序列化 var rp = pRequest.DeserializeJSONTo <APIRequest <GetEventUserMappingRP> >(); //2、参数校验 rp.Parameters.Validate(); //3、构造响应数据 var rd = new APIResponse <GetEventUserMappingRD>(new GetEventUserMappingRD()); try { //4、获取当前用户登录信息 //5、获取签到列表信息 int pageCount = 0; int rowCount = 0; rd.Data.MappingList = PrivateLEventSignUpBLL.GetEventUserMappingList(rp.Parameters.EventId, rp.Parameters.PageIndex, rp.Parameters.PageSize, out rowCount, out pageCount); rd.Data.TotalPage = pageCount; rd.Data.TotalCount = rowCount; } catch (Exception ex) { Loggers.Exception(new ExceptionLogInfo(ex)); throw new Exception(ex.Message, ex); } return(rd.ToJSON()); }
protected string DoSetSignUpGroup(string pRequest) { //1、请求参数反序列化 var rp = pRequest.DeserializeJSONTo <APIRequest <SetSignUpGroupRP> >(); //2、参数校验 rp.Parameters.Validate(); //3、构造响应数据 var rd = new APIResponse <SetSignUpGroupRD>(new SetSignUpGroupRD()); try { //4、获取当前用户登录信息 //5、设置分组 PrivateLEventSignUpBLL.SetSignUpGroup(rp.Parameters.SignUpId, rp.Parameters.GroupName, rp.UserID); } catch (Exception ex) { Loggers.Exception(new ExceptionLogInfo(ex)); throw new Exception(ex.Message, ex); } return(rd.ToJSON()); }
protected string DoGetEventSignUp(string pRequest) { //1、请求参数反序列化 var rp = pRequest.DeserializeJSONTo <APIRequest <GetEventSignUpRP> >(); //2、参数校验 rp.Parameters.Validate(); //3、构造响应数据 var rd = new APIResponse <GetEventSignUpRD>(new GetEventSignUpRD()); try { //4、获取当前用户登录信息 //5、获取数据信息 int pageCount = 0; int rowCountUn = 0; int rowCountYet = 0; Dictionary <string, string> dicCloumnNames = new Dictionary <string, string>(); rd.Data.SignUpList = PrivateLEventSignUpBLL.GetEventSignUpList(rp.Parameters.EventId, rp.Parameters.Status, rp.Parameters.PageIndex, rp.Parameters.PageSize, out pageCount, out rowCountUn, out rowCountYet, out dicCloumnNames); rd.Data.TotalPage = pageCount; rd.Data.TotalCountUn = rowCountUn; rd.Data.TotalCountYet = rowCountYet; rd.Data.DicColNames = dicCloumnNames; } catch (Exception ex) { Loggers.Exception(new ExceptionLogInfo(ex)); throw new Exception(ex.Message, ex); } return(rd.ToJSON()); }
private string EventSponsorList(string pRequest) { var rp = pRequest.DeserializeJSONTo <APIRequest <EmptyRequestParameter> >(); rp.Parameters.Validate(); var rd = new JIT.CPOS.BS.BLL.LEventSignUpBLL.EventSponsorListRD(); rd.EventSponsorList = PrivateLEventSignUpBLL.EventSponsorList(); var rsp = new SuccessResponse <IAPIResponseData>(rd); return(rsp.ToJSON()); }
protected string DoNotifyEventSignUp(string pRequest) { //1、请求参数反序列化 var rp = pRequest.DeserializeJSONTo <APIRequest <NotifyEventSignUpRP> >(); //2、参数校验 rp.Parameters.Validate(); //3、构造响应数据 var rd = new APIResponse <NotifyEventSignUpRD>(new NotifyEventSignUpRD()); try { //4、获取当前用户登录信息 //5、获取 DataTable dtRes = PrivateLEventSignUpBLL.GetNotifyEventSignUpList(rp.Parameters.SignUpIds); if (dtRes != null) { foreach (DataRow row in dtRes.Rows) { #region 发送短信 string msg; if (!SMSHelper.Send(row["Phone"].ToString(), row["RegistrationCode"].ToString(), "阿拉丁", out msg)) { throw new Exception("短信发送失败:" + msg); } PrivateLEventSignUpBLL.SetEventSignUpStatus(row["SignUpID"].ToString(), 1, 1, rp.UserID); #endregion } } } catch (Exception ex) { Loggers.Exception(new ExceptionLogInfo(ex)); throw new Exception(ex.Message, ex); } return(rd.ToJSON()); }