public MemberRankNumber Get(string sid) { MemberRankNumber result = new MemberRankNumber(); // Get the sid or memberID of the current user. var claimsPrincipal = this.User as ClaimsPrincipal; sid = CBAuth.getMemberID(sid, claimsPrincipal); /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(sid); try { /// fetch redis value by member sid result.rank = CBRedis.GetSortedSetRank(sid); return result; } catch (Exception ex) { // error log logMessage.memberID = sid; // authenricated server sid logMessage.Level = "ERROR"; logMessage.Logger = "CBRankController-MemberRankNumber"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { // 메일 주소로 메일 전송 - 회원 가입 확인(메일 주소 체크) 등 - 관리자 또는 특수 조건 하에 회원 호출 Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspSelSendEmailToMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } ////////////////////////////////////////////////////////////////////////////////////// // 메일 전송 루틴 - CloudBreadlib/BAL/SendSMTPMail 참조 //방화벽, 안티바이러스 등 outbound 체크 //SendEmail 찾아가서 인증 정보 등 변경할 것 //string s = SendSMTPMail.SendEmail(dreader[0].ToString(), "제목", "내용"); //Debug.WriteLine(s); ////////////////////////////////////////////////////////////////////////////////////// dreader.Close(); } connection.Close(); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelSendEmailToMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw ; } }
// GET api/CBSocketAuth public Payload Get() { Payload payload = new Payload(); /// Get the sid or memberID of the current user. string sid = CBAuth.getMemberID("debug", this.User as ClaimsPrincipal); // only for log payload.sid = sid; /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(sid); try { /// return token object Token t = new Token(); /// generate paylod payload.guid = Guid.NewGuid().ToString(); payload.genDateUTC = DateTimeOffset.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); ; /// token Serialize and encrypt t.token = JsonConvert.SerializeObject(payload); /// save to Rdis CBRedis.SetRedisKey(payload.guid, t.token, 30); // 30 min for socket suth TTL payload.sid = ""; payload.genDateUTC = ""; /// @brief chagned for plain processing - token encrypt //t.token = Crypto.AES_encrypt(t.token, globalVal.CloudBreadSocketKeyText, globalVal.CloudBreadSocketKeyIV); return payload; //changed } catch (Exception ex) { // error log logMessage.memberID = sid; logMessage.Level = "ERROR"; logMessage.Logger = "CBSocketAuth"; logMessage.Message = "SocketAuth error"; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { // 메일 주소로 메일 전송 - 회원 가입 확인(메일 주소 체크) 등 Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspUdtConfirmedEmailAddress", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID; command.Parameters.Add("@MemberPWD", SqlDbType.NVarChar, -1).Value = p.memberPWD; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtConfirmedEmailAddressController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
// GET api/CBSocketTokenValidCheck public Result POST(Token token) { // return Result r = new Result(); string redisResult = ""; /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(token); try { /// fetch redis value by requested token.guid redisResult = CBRedis.GetRedisKeyValue(token.guid); if (redisResult == null) { // does not exist on Redis r.guid = ""; r.sid = ""; r.genDateUTC = ""; } else { // Deserialize json r = JsonConvert.DeserializeObject<Result>(redisResult); } return r; } catch (Exception ex) { // error log logMessage.memberID = r.sid; // requested value. Not redis data value. logMessage.Level = "ERROR"; logMessage.Logger = "CBSocketTokenValidCheck"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(COMUdtMemberInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<COMUdtMemberInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.MemberID, this.User as ClaimsPrincipal); p.MemberID = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); RowcountResult rowcountResult = new RowcountResult(); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); try { // start task log //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBCOMUdtMemberController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspComUdtMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; command.Parameters.Add("@MemberPWD", SqlDbType.NVarChar, -1).Value = p.MemberPWD; command.Parameters.Add("@EmailAddress", SqlDbType.NVarChar, -1).Value = p.EmailAddress; command.Parameters.Add("@EmailConfirmedYN", SqlDbType.NVarChar, -1).Value = p.EmailConfirmedYN; command.Parameters.Add("@PhoneNumber1", SqlDbType.NVarChar, -1).Value = p.PhoneNumber1; command.Parameters.Add("@PhoneNumber2", SqlDbType.NVarChar, -1).Value = p.PhoneNumber2; command.Parameters.Add("@PINumber", SqlDbType.NVarChar, -1).Value = p.PINumber; command.Parameters.Add("@Name1", SqlDbType.NVarChar, -1).Value = p.Name1; command.Parameters.Add("@Name2", SqlDbType.NVarChar, -1).Value = p.Name2; command.Parameters.Add("@Name3", SqlDbType.NVarChar, -1).Value = p.Name3; command.Parameters.Add("@DOB", SqlDbType.NVarChar, -1).Value = p.DOB; command.Parameters.Add("@RecommenderID", SqlDbType.NVarChar, -1).Value = p.RecommenderID; command.Parameters.Add("@MemberGroup", SqlDbType.NVarChar, -1).Value = p.MemberGroup; command.Parameters.Add("@LastDeviceID", SqlDbType.NVarChar, -1).Value = p.LastDeviceID; command.Parameters.Add("@LastIPaddress", SqlDbType.NVarChar, -1).Value = p.LastIPaddress; command.Parameters.Add("@LastLoginDT", SqlDbType.NVarChar, -1).Value = p.LastLoginDT; command.Parameters.Add("@LastLogoutDT", SqlDbType.NVarChar, -1).Value = p.LastLogoutDT; command.Parameters.Add("@LastMACAddress", SqlDbType.NVarChar, -1).Value = p.LastMACAddress; command.Parameters.Add("@AccountBlockYN", SqlDbType.NVarChar, -1).Value = p.AccountBlockYN; command.Parameters.Add("@AccountBlockEndDT", SqlDbType.NVarChar, -1).Value = p.AccountBlockEndDT; command.Parameters.Add("@AnonymousYN", SqlDbType.NVarChar, -1).Value = p.AnonymousYN; command.Parameters.Add("@3rdAuthProvider", SqlDbType.NVarChar, -1).Value = p._3rdAuthProvider; command.Parameters.Add("@3rdAuthID", SqlDbType.NVarChar, -1).Value = p._3rdAuthID; command.Parameters.Add("@3rdAuthParam", SqlDbType.NVarChar, -1).Value = p._3rdAuthParam; command.Parameters.Add("@PushNotificationID", SqlDbType.NVarChar, -1).Value = p.PushNotificationID; command.Parameters.Add("@PushNotificationProvider", SqlDbType.NVarChar, -1).Value = p.PushNotificationProvider; command.Parameters.Add("@PushNotificationGroup", SqlDbType.NVarChar, -1).Value = p.PushNotificationGroup; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10 ", SqlDbType.NVarChar, -1).Value = p.sCol10; command.Parameters.Add("@TimeZoneID ", SqlDbType.NVarChar, -1).Value = p.TimeZoneID; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { rowcountResult.result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // end task log logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBCOMUdtMemberController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(rowcountResult), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, rowcountResult); return response; } } } catch (Exception ex) { // error log logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBCOMUdtMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(SelLoginIDDupeCheckInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<SelLoginIDDupeCheckInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.memberID, this.User as ClaimsPrincipal); p.memberID = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); SelLoginIDDupeCheckResult result = new SelLoginIDDupeCheckResult(); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); try { /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using(SqlCommand command = new SqlCommand("uspSelLoginIDDupeCheck", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@FindID", SqlDbType.NVarChar, -1).Value = p.findID; command.Parameters.Add("@Category", SqlDbType.NVarChar, -1).Value = p.category; connection.OpenWithRetry(retryPolicy); using(SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { result.result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(result), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, result); return response; } } } catch (Exception ex) { // error log logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelLoginIDDupeCheckController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //익명 회원가입 모듈 시작 Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MembersMemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBInsAnonymousRegMemberController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspInsAnonymousRegMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MembersMemberID", SqlDbType.NVarChar, -1).Value = p.MembersMemberID; command.Parameters.Add("@MembersMemberPWD", SqlDbType.NVarChar, -1).Value = p.MembersMemberPWD; command.Parameters.Add("@MembersEmailAddress", SqlDbType.NVarChar, -1).Value = p.MembersEmailAddress; command.Parameters.Add("@MembersEmailConfirmedYN", SqlDbType.NVarChar, -1).Value = p.MembersEmailConfirmedYN; command.Parameters.Add("@MembersPhoneNumber1", SqlDbType.NVarChar, -1).Value = p.MembersPhoneNumber1; command.Parameters.Add("@MembersPhoneNumber2", SqlDbType.NVarChar, -1).Value = p.MembersPhoneNumber2; command.Parameters.Add("@MembersPINumber", SqlDbType.NVarChar, -1).Value = p.MembersPINumber; command.Parameters.Add("@MembersName1", SqlDbType.NVarChar, -1).Value = p.MembersName1; command.Parameters.Add("@MembersName2", SqlDbType.NVarChar, -1).Value = p.MembersName2; command.Parameters.Add("@MembersName3", SqlDbType.NVarChar, -1).Value = p.MembersName3; command.Parameters.Add("@MembersDOB", SqlDbType.NVarChar, -1).Value = p.MembersDOB; command.Parameters.Add("@MembersRecommenderID", SqlDbType.NVarChar, -1).Value = p.MembersRecommenderID; command.Parameters.Add("@MembersMemberGroup", SqlDbType.NVarChar, -1).Value = p.MembersMemberGroup; command.Parameters.Add("@MembersLastDeviceID", SqlDbType.NVarChar, -1).Value = p.MembersLastDeviceID; command.Parameters.Add("@MembersLastIPaddress", SqlDbType.NVarChar, -1).Value = p.MembersLastIPaddress; command.Parameters.Add("@MembersLastLoginDT", SqlDbType.NVarChar, -1).Value = p.MembersLastLoginDT; command.Parameters.Add("@MembersLastLogoutDT", SqlDbType.NVarChar, -1).Value = p.MembersLastLogoutDT; command.Parameters.Add("@MembersLastMACAddress", SqlDbType.NVarChar, -1).Value = p.MembersLastMACAddress; command.Parameters.Add("@MembersAccountBlockYN", SqlDbType.NVarChar, -1).Value = p.MembersAccountBlockYN; command.Parameters.Add("@MembersAccountBlockEndDT", SqlDbType.NVarChar, -1).Value = p.MembersAccountBlockEndDT; command.Parameters.Add("@MembersAnonymousYN", SqlDbType.NVarChar, -1).Value = p.MembersAnonymousYN; command.Parameters.Add("@Members3rdAuthProvider", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthProvider; command.Parameters.Add("@Members3rdAuthID", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthID; command.Parameters.Add("@Members3rdAuthParam", SqlDbType.NVarChar, -1).Value = p.Members3rdAuthParam; command.Parameters.Add("@MembersPushNotificationID", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationID; command.Parameters.Add("@MembersPushNotificationProvider", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationProvider; command.Parameters.Add("@MembersPushNotificationGroup", SqlDbType.NVarChar, -1).Value = p.MembersPushNotificationGroup; command.Parameters.Add("@MemberssCol1", SqlDbType.NVarChar, -1).Value = p.MemberssCol1; command.Parameters.Add("@MemberssCol2", SqlDbType.NVarChar, -1).Value = p.MemberssCol2; command.Parameters.Add("@MemberssCol3", SqlDbType.NVarChar, -1).Value = p.MemberssCol3; command.Parameters.Add("@MemberssCol4", SqlDbType.NVarChar, -1).Value = p.MemberssCol4; command.Parameters.Add("@MemberssCol5", SqlDbType.NVarChar, -1).Value = p.MemberssCol5; command.Parameters.Add("@MemberssCol6", SqlDbType.NVarChar, -1).Value = p.MemberssCol6; command.Parameters.Add("@MemberssCol7", SqlDbType.NVarChar, -1).Value = p.MemberssCol7; command.Parameters.Add("@MemberssCol8", SqlDbType.NVarChar, -1).Value = p.MemberssCol8; command.Parameters.Add("@MemberssCol9", SqlDbType.NVarChar, -1).Value = p.MemberssCol9; command.Parameters.Add("@MemberssCol10", SqlDbType.NVarChar, -1).Value = p.MemberssCol10; command.Parameters.Add("@MembersTimeZoneID", SqlDbType.NVarChar, -1).Value = p.MembersTimeZoneID; command.Parameters.Add("@MemberGameInfoesLevel", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesLevel; command.Parameters.Add("@MemberGameInfoesExps", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesExps; command.Parameters.Add("@MemberGameInfoesPoints", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesPoints; command.Parameters.Add("@MemberGameInfoesUserSTAT1", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT1; command.Parameters.Add("@MemberGameInfoesUserSTAT2", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT2; command.Parameters.Add("@MemberGameInfoesUserSTAT3", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT3; command.Parameters.Add("@MemberGameInfoesUserSTAT4", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT4; command.Parameters.Add("@MemberGameInfoesUserSTAT5", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT5; command.Parameters.Add("@MemberGameInfoesUserSTAT6", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT6; command.Parameters.Add("@MemberGameInfoesUserSTAT7", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT7; command.Parameters.Add("@MemberGameInfoesUserSTAT8", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT8; command.Parameters.Add("@MemberGameInfoesUserSTAT9", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT9; command.Parameters.Add("@MemberGameInfoesUserSTAT10", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoesUserSTAT10; command.Parameters.Add("@MemberGameInfoessCol1", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol1; command.Parameters.Add("@MemberGameInfoessCol2", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol2; command.Parameters.Add("@MemberGameInfoessCol3", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol3; command.Parameters.Add("@MemberGameInfoessCol4", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol4; command.Parameters.Add("@MemberGameInfoessCol5", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol5; command.Parameters.Add("@MemberGameInfoessCol6", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol6; command.Parameters.Add("@MemberGameInfoessCol7", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol7; command.Parameters.Add("@MemberGameInfoessCol8", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol8; command.Parameters.Add("@MemberGameInfoessCol9", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol9; command.Parameters.Add("@MemberGameInfoessCol10", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoessCol10; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); //완료 로그 logMessage.memberID = p.MembersMemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBInsAnonymousRegMemberController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MembersMemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBInsAnonymousRegMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBComUdtGiftDepositoryController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComUdtGiftDepository", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@GiftDepositoryID", SqlDbType.NVarChar, -1).Value = p.GiftDepositoryID; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; command.Parameters.Add("@ItemCount", SqlDbType.NVarChar, -1).Value = p.ItemCount; command.Parameters.Add("@FromMemberID", SqlDbType.NVarChar, -1).Value = p.FromMemberID; command.Parameters.Add("@ToMemberID", SqlDbType.NVarChar, -1).Value = p.ToMemberID; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // 완료 로그 logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBComUdtGiftDepositoryController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { // 에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComUdtGiftDepositoryController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComSelMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { MemberID = dreader[0].ToString(), MemberPWD = dreader[1].ToString(), EmailAddress = dreader[2].ToString(), EmailConfirmedYN = dreader[3].ToString(), PhoneNumber1 = dreader[4].ToString(), PhoneNumber2 = dreader[5].ToString(), PINumber = dreader[6].ToString(), Name1 = dreader[7].ToString(), Name2 = dreader[8].ToString(), Name3 = dreader[9].ToString(), DOB = dreader[10].ToString(), RecommenderID = dreader[11].ToString(), MemberGroup = dreader[12].ToString(), LastDeviceID = dreader[13].ToString(), LastIPaddress = dreader[14].ToString(), LastLoginDT = dreader[15].ToString(), LastLogoutDT = dreader[16].ToString(), LastMACAddress = dreader[17].ToString(), AccountBlockYN = dreader[18].ToString(), AccountBlockEndDT = dreader[19].ToString(), AnonymousYN = dreader[20].ToString(), _3rdAuthProvider = dreader[21].ToString(), _3rdAuthID = dreader[22].ToString(), _3rdAuthParam = dreader[23].ToString(), PushNotificationID = dreader[24].ToString(), PushNotificationProvider = dreader[25].ToString(), PushNotificationGroup = dreader[26].ToString(), sCol1 = dreader[27].ToString(), sCol2 = dreader[28].ToString(), sCol3 = dreader[29].ToString(), sCol4 = dreader[30].ToString(), sCol5 = dreader[31].ToString(), sCol6 = dreader[32].ToString(), sCol7 = dreader[33].ToString(), sCol8 = dreader[34].ToString(), sCol9 = dreader[35].ToString(), sCol10 = dreader[36].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComSelMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(AddUseMemberItemInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<AddUseMemberItemInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.MemberID_MemberGameInfoes, this.User as ClaimsPrincipal); p.MemberID_MemberGameInfoes = sid; p.MemberID_MemberItem = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); RowcountResult rowcountResult = new RowcountResult(); try { // start task log //logMessage.memberID = p.MemberID_MemberItem; //logMessage.Level = "INFO"; //logMessage.Logger = "CBAddUseMemberItemController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspAddUseMemberItem", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdateORDelete", SqlDbType.NVarChar, -1).Value = p.InsertORUpdateORDelete.ToUpper(); command.Parameters.Add("@MemberItemID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberItemID_MemberItem; command.Parameters.Add("@MemberID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberItem; command.Parameters.Add("@ItemListID_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemListID_MemberItem; command.Parameters.Add("@ItemCount_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemCount_MemberItem; command.Parameters.Add("@ItemStatus_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemStatus_MemberItem; command.Parameters.Add("@sCol1_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberItem; command.Parameters.Add("@sCol2_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberItem; command.Parameters.Add("@sCol3_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberItem; command.Parameters.Add("@sCol4_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberItem; command.Parameters.Add("@sCol5_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberItem; command.Parameters.Add("@sCol6_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberItem; command.Parameters.Add("@sCol7_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberItem; command.Parameters.Add("@sCol8_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberItem; command.Parameters.Add("@sCol9_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberItem; command.Parameters.Add("@sCol10_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberItem; command.Parameters.Add("@MemberID_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberGameInfoes; command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes; command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes; command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes; command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes; command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes; command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes; command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes; command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes; command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes; command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes; command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes; command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes; command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes; command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes; command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes; command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes; command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes; command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes; command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes; command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes; command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes; command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes; command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { rowcountResult.result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // end task log logMessage.memberID = p.MemberID_MemberItem; logMessage.Level = "INFO"; logMessage.Logger = "CBAddUseMemberItemController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(rowcountResult), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, rowcountResult); return response; } } } catch (Exception ex) { // error log logMessage.memberID = p.MemberID_MemberItem; logMessage.Level = "ERROR"; logMessage.Logger = "CBAddUseMemberItemController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
/// Set redis rank by member public MemberRankNumber POST(InputParams p) { MemberRankNumber result = new MemberRankNumber(); // Get the sid or memberID of the current user. var claimsPrincipal = this.User as ClaimsPrincipal; p.sid = CBAuth.getMemberID(p.sid, claimsPrincipal); /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p.sid); try { /// set redis point and return CBRedis.SetSortedSetRank(p.sid, p.point); result.rank = CBRedis.GetSortedSetRank(p.sid); return result; } catch (Exception ex) { // error log logMessage.memberID = p.sid; // requested value. Not redis data value. logMessage.Level = "ERROR"; logMessage.Logger = "CBRankController-SetMemberPoint"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// // 한번 사용한 쿠폰. 쿠폰에서 받은 아이템을 insert 또는 update하고 // MemberCoupon 테이블에 저장. // Coupon 중복 사용이 불가한 경우 DeleteYN을 Y로 처리. //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID_MemberItems; //logMessage.Level = "INFO"; //logMessage.Logger = "CBUdtCouponMemberController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspUdtCouponMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper(); command.Parameters.Add("@CouponID_Coupon", SqlDbType.NVarChar, -1).Value = p.CouponID_Coupon; command.Parameters.Add("@MemberItemID_MemberItems", SqlDbType.NVarChar, -1).Value = p.MemberItemID_MemberItems; command.Parameters.Add("@MemberID_MemberItems", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberItems; command.Parameters.Add("@ItemListID_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemListID_MemberItems; command.Parameters.Add("@ItemCount_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemCount_MemberItems; command.Parameters.Add("@ItemStatus_MemberItems", SqlDbType.NVarChar, -1).Value = p.ItemStatus_MemberItems; command.Parameters.Add("@sCol1_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberItems; command.Parameters.Add("@sCol2_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberItems; command.Parameters.Add("@sCol3_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberItems; command.Parameters.Add("@sCol4_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberItems; command.Parameters.Add("@sCol5_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberItems; command.Parameters.Add("@sCol6_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberItems; command.Parameters.Add("@sCol7_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberItems; command.Parameters.Add("@sCol8_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberItems; command.Parameters.Add("@sCol9_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberItems; command.Parameters.Add("@sCol10_MemberItems", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberItems; command.Parameters.Add("@CouponID_CouponMember", SqlDbType.NVarChar, -1).Value = p.CouponID_CouponMember; command.Parameters.Add("@MemberID_CouponMember", SqlDbType.NVarChar, -1).Value = p.MemberID_CouponMember; command.Parameters.Add("@sCol1_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol1_CouponMember; command.Parameters.Add("@sCol2_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol2_CouponMember; command.Parameters.Add("@sCol3_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol3_CouponMember; command.Parameters.Add("@sCol4_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol4_CouponMember; command.Parameters.Add("@sCol5_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol5_CouponMember; command.Parameters.Add("@sCol6_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol6_CouponMember; command.Parameters.Add("@sCol7_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol7_CouponMember; command.Parameters.Add("@sCol8_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol8_CouponMember; command.Parameters.Add("@sCol9_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol9_CouponMember; command.Parameters.Add("@sCol10_CouponMember", SqlDbType.NVarChar, -1).Value = p.sCol10_CouponMember; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); //완료 로그 logMessage.memberID = p.MemberID_MemberItems; logMessage.Level = "INFO"; logMessage.Logger = "CBUdtCouponMemberController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID_MemberItems; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtCouponMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(SelSendEmailToMemberInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<SelSendEmailToMemberInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.memberID, this.User as ClaimsPrincipal); p.memberID = sid; // check proper authentication of member who trigger this API (Admin or member with authorized) Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); RowcountResult rowcountResult = new RowcountResult(); try { /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspSelSendEmailToMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { rowcountResult.result = dreader[0].ToString(); } ////////////////////////////////////////////////////////////////////////////////////// //// mail sending module - reference CloudBreadlib/BAL/SendSMTPMail //// check firewall, anti-virus and outbound traffic //// in SendEmail lib, change your mail login info //string s = SendSMTPMail.SendEmail(dreader[0].ToString(), "subject", "content"); ////////////////////////////////////////////////////////////////////////////////////// dreader.Close(); } connection.Close(); /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(rowcountResult), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, rowcountResult); return response; // or return mail send result string s } } } catch (Exception ex) { // error log logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelSendEmailToMemberController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw ; } }
public SortedSetEntry[] GET(string sid, int countnum) { // Get the sid or memberID of the current user. var claimsPrincipal = this.User as ClaimsPrincipal; sid = CBAuth.getMemberID(sid, claimsPrincipal); /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(sid); try { /// fetch redis list by top countnum rankers SortedSetEntry[] sse = CBRedis.GetTopSortedSetRank(countnum); return sse; } catch (Exception ex) { // error log logMessage.memberID = sid; // server authenticated value logMessage.Level = "ERROR"; logMessage.Logger = "CBRankController-TopRankerList"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { // 아이템 리스트 1개를 가져오는 프로시져. using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspSelItem1", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { ItemListID = dreader[0].ToString(), ItemName = dreader[1].ToString(), ItemDescription = dreader[2].ToString(), ItemPrice = dreader[3].ToString(), ItemSellPrice = dreader[4].ToString(), ItemCategory1 = dreader[5].ToString(), ItemCategory2 = dreader[6].ToString(), ItemCategory3 = dreader[7].ToString(), sCol1 = dreader[8].ToString(), sCol2 = dreader[9].ToString(), sCol3 = dreader[10].ToString(), sCol4 = dreader[11].ToString(), sCol5 = dreader[12].ToString(), sCol6 = dreader[13].ToString(), sCol7 = dreader[14].ToString(), sCol8 = dreader[15].ToString(), sCol9 = dreader[16].ToString(), sCol10 = dreader[17].ToString(), }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelItem1Controller"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// // 공통 MemberItemPurchase 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음. // Json에서는 null 으로 값을 지정하거나 아예 로우 값을 제공하지 않아도 가능 //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBComUdtMemberItemPurchaseController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComUdtMemberItemPurchase", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberItemPurchaseID", SqlDbType.NVarChar, -1).Value = p.MemberItemPurchaseID; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; command.Parameters.Add("@PurchaseQuantity", SqlDbType.NVarChar, -1).Value = p.PurchaseQuantity; command.Parameters.Add("@PurchasePrice", SqlDbType.NVarChar, -1).Value = p.PurchasePrice; command.Parameters.Add("@PGinfo1", SqlDbType.NVarChar, -1).Value = p.PGinfo1; command.Parameters.Add("@PGinfo2", SqlDbType.NVarChar, -1).Value = p.PGinfo2; command.Parameters.Add("@PGinfo3", SqlDbType.NVarChar, -1).Value = p.PGinfo3; command.Parameters.Add("@PGinfo4", SqlDbType.NVarChar, -1).Value = p.PGinfo4; command.Parameters.Add("@PGinfo5", SqlDbType.NVarChar, -1).Value = p.PGinfo5; command.Parameters.Add("@PurchaseDeviceID", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceID; command.Parameters.Add("@PurchaseDeviceIPAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceIPAddress; command.Parameters.Add("@PurchaseDeviceMACAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseDeviceMACAddress; command.Parameters.Add("@PurchaseDT", SqlDbType.NVarChar, -1).Value = p.PurchaseDT; command.Parameters.Add("@PurchaseCancelYN", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelYN; command.Parameters.Add("@PurchaseCancelDT", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDT; command.Parameters.Add("@PurchaseCancelingStatus", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelingStatus; command.Parameters.Add("@PurchaseCancelReturnedAmount", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelReturnedAmount; command.Parameters.Add("@PurchaseCancelDeviceID", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceID; command.Parameters.Add("@PurchaseCancelDeviceIPAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceIPAddress; command.Parameters.Add("@PurchaseCancelDeviceMACAddress", SqlDbType.NVarChar, -1).Value = p.PurchaseCancelDeviceMACAddress; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // 완료 로그 logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBComUdtMemberItemPurchaseController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComUdtMemberItemPurchaseController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComSelMemberGameInfoes", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { MemberID = dreader[0].ToString(), Level = dreader[1].ToString(), Exps = dreader[2].ToString(), Points = dreader[3].ToString(), UserSTAT1 = dreader[4].ToString(), UserSTAT2 = dreader[5].ToString(), UserSTAT3 = dreader[6].ToString(), UserSTAT4 = dreader[7].ToString(), UserSTAT5 = dreader[8].ToString(), UserSTAT6 = dreader[9].ToString(), UserSTAT7 = dreader[10].ToString(), UserSTAT8 = dreader[11].ToString(), UserSTAT9 = dreader[12].ToString(), UserSTAT10 = dreader[13].ToString(), sCol1 = dreader[14].ToString(), sCol2 = dreader[15].ToString(), sCol3 = dreader[16].ToString(), sCol4 = dreader[17].ToString(), sCol5 = dreader[18].ToString(), sCol6 = dreader[19].ToString(), sCol7 = dreader[20].ToString(), sCol8 = dreader[21].ToString(), sCol9 = dreader[22].ToString(), sCol10 = dreader[23].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComSelMemberGameInfoesController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// //보유 아이템 추가-사용 컨트롤러 시작 //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID_MemberItem; //logMessage.Level = "INFO"; //logMessage.Logger = "CBAddUseMemberItemController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspAddUseMemberItem", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdateORDelete", SqlDbType.NVarChar, -1).Value = p.InsertORUpdateORDelete.ToUpper(); command.Parameters.Add("@MemberItemID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberItemID_MemberItem; command.Parameters.Add("@MemberID_MemberItem", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberItem; command.Parameters.Add("@ItemListID_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemListID_MemberItem; command.Parameters.Add("@ItemCount_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemCount_MemberItem; command.Parameters.Add("@ItemStatus_MemberItem", SqlDbType.NVarChar, -1).Value = p.ItemStatus_MemberItem; command.Parameters.Add("@sCol1_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberItem; command.Parameters.Add("@sCol2_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberItem; command.Parameters.Add("@sCol3_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberItem; command.Parameters.Add("@sCol4_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberItem; command.Parameters.Add("@sCol5_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberItem; command.Parameters.Add("@sCol6_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberItem; command.Parameters.Add("@sCol7_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberItem; command.Parameters.Add("@sCol8_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberItem; command.Parameters.Add("@sCol9_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberItem; command.Parameters.Add("@sCol10_MemberItem", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberItem; command.Parameters.Add("@MemberID_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberGameInfoes; command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes; command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes; command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes; command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes; command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes; command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes; command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes; command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes; command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes; command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes; command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes; command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes; command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes; command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes; command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes; command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes; command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes; command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes; command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes; command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes; command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes; command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes; command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); //완료 로그 logMessage.memberID = p.MemberID_MemberItem; logMessage.Level = "INFO"; logMessage.Logger = "CBAddUseMemberItemController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID_MemberItem; logMessage.Level = "ERROR"; logMessage.Logger = "CBAddUseMemberItemController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(ComSelCouponInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<ComSelCouponInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.MemberID, this.User as ClaimsPrincipal); p.MemberID = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<ComSelCouponModel> result = new List<ComSelCouponModel>(); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); try { /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspComSelCoupon", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@CouponID", SqlDbType.NVarChar, -1).Value = p.CouponID; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { ComSelCouponModel workItem = new ComSelCouponModel() { CouponID = dreader[0].ToString(), CouponCategory1 = dreader[1].ToString(), CouponCategory2 = dreader[2].ToString(), CouponCategory3 = dreader[3].ToString(), ItemListID = dreader[4].ToString(), ItemCount = dreader[5].ToString(), ItemStatus = dreader[6].ToString(), TargetGroup = dreader[7].ToString(), TargetOS = dreader[8].ToString(), TargetDevice = dreader[9].ToString(), Title = dreader[10].ToString(), Content = dreader[11].ToString(), sCol1 = dreader[12].ToString(), sCol2 = dreader[13].ToString(), sCol3 = dreader[14].ToString(), sCol4 = dreader[15].ToString(), sCol5 = dreader[16].ToString(), sCol6 = dreader[17].ToString(), sCol7 = dreader[18].ToString(), sCol8 = dreader[19].ToString(), sCol9 = dreader[20].ToString(), sCol10 = dreader[21].ToString(), }; result.Add(workItem); } dreader.Close(); } connection.Close(); } /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(result), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, result); return response; } } catch (Exception ex) { // error log logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComSelCouponController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// // 공통 MemberGameInfo 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음. // Json에서는 null 으로 값을 지정하거나 아예 로우 값을 제공하지 않아도 가능 //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBComUdtMemberGameInfoesController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComUdtMemberGameInfoes", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; command.Parameters.Add("@Level", SqlDbType.NVarChar, -1).Value = p.Level; command.Parameters.Add("@Exps", SqlDbType.NVarChar, -1).Value = p.Exps; command.Parameters.Add("@Points", SqlDbType.NVarChar, -1).Value = p.Points; command.Parameters.Add("@UserSTAT1", SqlDbType.NVarChar, -1).Value = p.UserSTAT1; command.Parameters.Add("@UserSTAT2", SqlDbType.NVarChar, -1).Value = p.UserSTAT2; command.Parameters.Add("@UserSTAT3", SqlDbType.NVarChar, -1).Value = p.UserSTAT3; command.Parameters.Add("@UserSTAT4", SqlDbType.NVarChar, -1).Value = p.UserSTAT4; command.Parameters.Add("@UserSTAT5", SqlDbType.NVarChar, -1).Value = p.UserSTAT5; command.Parameters.Add("@UserSTAT6", SqlDbType.NVarChar, -1).Value = p.UserSTAT6; command.Parameters.Add("@UserSTAT7", SqlDbType.NVarChar, -1).Value = p.UserSTAT7; command.Parameters.Add("@UserSTAT8", SqlDbType.NVarChar, -1).Value = p.UserSTAT8; command.Parameters.Add("@UserSTAT9", SqlDbType.NVarChar, -1).Value = p.UserSTAT9; command.Parameters.Add("@UserSTAT10", SqlDbType.NVarChar, -1).Value = p.UserSTAT10; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // 완료 로그 logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBComUdtMemberGameInfoesController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComUdtMemberGameInfoesController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// //공통 회원 정보 수정 모듈 시작 update시 파라미터를 NULL로 주면 해당 컬럼은 변화되지 않음. // Json에서는 null 으로 값을 지정하거나 아예 값을 제공하지 않아도 가능 //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBUdtMoveGiftController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspUdtMoveGift", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper(); // INSERT UPDATE 여부 분기 command.Parameters.Add("@GiftDepositoryID", SqlDbType.NVarChar, -1).Value = p.GiftDepositoryID; command.Parameters.Add("@MemberItemID", SqlDbType.NVarChar, -1).Value = p.MemberItemID; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; command.Parameters.Add("@ItemCount", SqlDbType.NVarChar, -1).Value = p.ItemCount; command.Parameters.Add("@ItemStatus", SqlDbType.NVarChar, -1).Value = p.ItemStatus; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); //완료 로그 logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBUdtMoveGiftController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtMoveGiftController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspComSelMemberItemPurchase", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberItemPurchaseID", SqlDbType.NVarChar, -1).Value = p.MemberItemPurchaseID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { MemberItemPurchaseID = dreader[0].ToString(), MemberID = dreader[1].ToString(), ItemListID = dreader[2].ToString(), PurchaseQuantity = dreader[3].ToString(), PurchasePrice = dreader[4].ToString(), PGinfo1 = dreader[5].ToString(), PGinfo2 = dreader[6].ToString(), PGinfo3 = dreader[7].ToString(), PGinfo4 = dreader[8].ToString(), PGinfo5 = dreader[9].ToString(), PurchaseDeviceID = dreader[10].ToString(), PurchaseDeviceIPAddress = dreader[11].ToString(), PurchaseDeviceMACAddress = dreader[12].ToString(), PurchaseDT = dreader[13].ToString(), PurchaseCancelYN = dreader[14].ToString(), PurchaseCancelDT = dreader[15].ToString(), PurchaseCancelingStatus = dreader[16].ToString(), PurchaseCancelReturnedAmount = dreader[17].ToString(), PurchaseCancelDeviceID = dreader[18].ToString(), PurchaseCancelDeviceIPAddress = dreader[19].ToString(), PurchaseCancelDeviceMACAddress = dreader[20].ToString(), sCol1 = dreader[21].ToString(), sCol2 = dreader[22].ToString(), sCol3 = dreader[23].ToString(), sCol4 = dreader[24].ToString(), sCol5 = dreader[25].ToString(), sCol6 = dreader[26].ToString(), sCol7 = dreader[27].ToString(), sCol8 = dreader[28].ToString(), sCol9 = dreader[29].ToString(), sCol10 = dreader[30].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBComSelMemberItemPurchaseController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspSelGameEvents", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { GameEventID = dreader[0].ToString(), eventCategory1 = dreader[1].ToString(), eventCategory2 = dreader[2].ToString(), eventCategory3 = dreader[3].ToString(), ItemListID = dreader[4].ToString(), ItemCount = dreader[5].ToString(), Itemstatus = dreader[6].ToString(), TargetGroup = dreader[7].ToString(), TargetOS = dreader[8].ToString(), TargetDevice = dreader[9].ToString(), EventImageLink = dreader[10].ToString(), Title = dreader[11].ToString(), Content = dreader[12].ToString(), sCol1 = dreader[13].ToString(), sCol2 = dreader[14].ToString(), sCol3 = dreader[15].ToString(), sCol4 = dreader[16].ToString(), sCol5 = dreader[17].ToString(), sCol6 = dreader[18].ToString(), sCol7 = dreader[19].ToString(), sCol8 = dreader[20].ToString(), sCol9 = dreader[21].ToString(), sCol10 = dreader[22].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelGameEventsController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(UdtMoveGiftInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<UdtMoveGiftInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.MemberID, this.User as ClaimsPrincipal); p.MemberID = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); RowcountResult rowcountResult = new RowcountResult(); try { // task start log //logMessage.memberID = p.MemberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBUdtMoveGiftController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspUdtMoveGift", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper(); // INSERT UPDATE 여부 분기 command.Parameters.Add("@GiftDepositoryID", SqlDbType.NVarChar, -1).Value = p.GiftDepositoryID; command.Parameters.Add("@MemberItemID", SqlDbType.NVarChar, -1).Value = p.MemberItemID; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.MemberID; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; command.Parameters.Add("@ItemCount", SqlDbType.NVarChar, -1).Value = p.ItemCount; command.Parameters.Add("@ItemStatus", SqlDbType.NVarChar, -1).Value = p.ItemStatus; command.Parameters.Add("@sCol1", SqlDbType.NVarChar, -1).Value = p.sCol1; command.Parameters.Add("@sCol2", SqlDbType.NVarChar, -1).Value = p.sCol2; command.Parameters.Add("@sCol3", SqlDbType.NVarChar, -1).Value = p.sCol3; command.Parameters.Add("@sCol4", SqlDbType.NVarChar, -1).Value = p.sCol4; command.Parameters.Add("@sCol5", SqlDbType.NVarChar, -1).Value = p.sCol5; command.Parameters.Add("@sCol6", SqlDbType.NVarChar, -1).Value = p.sCol6; command.Parameters.Add("@sCol7", SqlDbType.NVarChar, -1).Value = p.sCol7; command.Parameters.Add("@sCol8", SqlDbType.NVarChar, -1).Value = p.sCol8; command.Parameters.Add("@sCol9", SqlDbType.NVarChar, -1).Value = p.sCol9; command.Parameters.Add("@sCol10", SqlDbType.NVarChar, -1).Value = p.sCol10; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { rowcountResult.result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // task end log logMessage.memberID = p.MemberID; logMessage.Level = "INFO"; logMessage.Logger = "CBUdtMoveGiftController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(rowcountResult), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, rowcountResult); return response; } } } catch (Exception ex) { // error log logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtMoveGiftController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; //////////////////////////////////////////////////////////////////////// // 게임 스테이지 진행 중 스테이지 정보 업데이트(삽입/수정) + 게임정보 인포 업데이트 //////////////////////////////////////////////////////////////////////// Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { // 진입로그 //logMessage.memberID = p.MemberID_MemberGameInfoes; //logMessage.Level = "INFO"; //logMessage.Logger = "CBUdtMemberGameInfoStageController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspUdtMemberGameInfoStage", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdate", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper(); command.Parameters.Add("@MemberID_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberGameInfoes; command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes; command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes; command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes; command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes; command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes; command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes; command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes; command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes; command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes; command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes; command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes; command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes; command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes; command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes; command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes; command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes; command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes; command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes; command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes; command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes; command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes; command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes; command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes; command.Parameters.Add("@MemberGameInfoStageID_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.MemberGameInfoStageID_MemberGameInfoStages; command.Parameters.Add("@MemberID_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.MemberID_MemberGameInfoStages; command.Parameters.Add("@StageName_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageName_MemberGameInfoStages; command.Parameters.Add("@StageStatus_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStatus_MemberGameInfoStages; command.Parameters.Add("@Category1_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Category1_MemberGameInfoStages; command.Parameters.Add("@Category2_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Category2_MemberGameInfoStages; command.Parameters.Add("@Category3_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Category3_MemberGameInfoStages; command.Parameters.Add("@Mission1_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Mission1_MemberGameInfoStages; command.Parameters.Add("@Mission2_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Mission2_MemberGameInfoStages; command.Parameters.Add("@Mission3_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Mission3_MemberGameInfoStages; command.Parameters.Add("@Mission4_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Mission4_MemberGameInfoStages; command.Parameters.Add("@Mission5_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Mission5_MemberGameInfoStages; command.Parameters.Add("@Points_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoStages; command.Parameters.Add("@StageStat1_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStat1_MemberGameInfoStages; command.Parameters.Add("@StageStat2_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStat2_MemberGameInfoStages; command.Parameters.Add("@StageStat3_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStat3_MemberGameInfoStages; command.Parameters.Add("@StageStat4_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStat4_MemberGameInfoStages; command.Parameters.Add("@StageStat5_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.StageStat5_MemberGameInfoStages; command.Parameters.Add("@sCol1_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoStages; command.Parameters.Add("@sCol2_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoStages; command.Parameters.Add("@sCol3_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoStages; command.Parameters.Add("@sCol4_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoStages; command.Parameters.Add("@sCol5_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoStages; command.Parameters.Add("@sCol6_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoStages; command.Parameters.Add("@sCol7_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoStages; command.Parameters.Add("@sCol8_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoStages; command.Parameters.Add("@sCol9_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoStages; command.Parameters.Add("@sCol10_MemberGameInfoStages", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoStages; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); //완료 로그 logMessage.memberID = p.MemberID_MemberGameInfoes; logMessage.Level = "INFO"; logMessage.Logger = "CBUdtMemberGameInfoStageController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID_MemberGameInfoes; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtMemberGameInfoStageController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public List<Model> Post(InputParams p) { Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<Model> result = new List<Model>(); try { // 아이템 리스트들을 가져오는 프로시져. 전체를 가져올 경우 페이지사이즈를 최대로 준다. // 페이징이 필요 없을 경우는 파라미터를 크게 잡을 것 // 참고로 big int -9223372036854775808 부터 9223372036854775807 까지 using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspSelItemListAll", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@Page", SqlDbType.BigInt).Value = p.Page; command.Parameters.Add("@PageSize", SqlDbType.BigInt).Value = p.PageSize; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { Model workItem = new Model() { ROWNUM = dreader[0].ToString(), ItemListID = dreader[1].ToString(), ItemName = dreader[2].ToString(), ItemDescription = dreader[3].ToString(), ItemPrice = dreader[4].ToString(), ItemSellPrice = dreader[5].ToString(), ItemCategory1 = dreader[6].ToString(), ItemCategory2 = dreader[7].ToString(), ItemCategory3 = dreader[8].ToString(), sCol1 = dreader[9].ToString(), sCol2 = dreader[10].ToString(), sCol3 = dreader[11].ToString(), sCol4 = dreader[12].ToString(), sCol5 = dreader[13].ToString(), sCol6 = dreader[14].ToString(), sCol7 = dreader[15].ToString(), sCol8 = dreader[16].ToString(), sCol9 = dreader[17].ToString(), sCol10 = dreader[18].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); } return result; } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelItemListAllController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw ex; } }
public SortedSetEntry[] GET(string sid, long startRank, long endRank) { // Get the sid or memberID of the current user. var claimsPrincipal = this.User as ClaimsPrincipal; sid = CBAuth.getMemberID(sid, claimsPrincipal); /// logging purpose Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(sid); try { /// fetch redis list by rank range SortedSetEntry[] se = CBRedis.GetSortedSetRankByRange(startRank, endRank); return se; } catch (Exception ex) { // error log logMessage.memberID = sid; // server autenticated sid logMessage.Level = "ERROR"; logMessage.Logger = "CBRankController-RankerListByRange"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(SelLoginInfoInputParams p) { // try decrypt data if (!string.IsNullOrEmpty(p.token) && globalVal.CloudBreadCryptSetting == "AES256") { try { string decrypted = Crypto.AES_decrypt(p.token, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); p = JsonConvert.DeserializeObject<SelLoginInfoInputParams>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } // Get the sid or memberID of the current user. string sid = CBAuth.getMemberID(p.memberID, this.User as ClaimsPrincipal); p.memberID = sid; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); List<SelLoginInfoModel> result = new List<SelLoginInfoModel>(); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); try { // start task log //logMessage.memberID = p.memberID; //logMessage.Level = "INFO"; //logMessage.Logger = "CBSelLoginInfoController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); /// Database connection retry policy RetryPolicy retryPolicy = new RetryPolicy<SqlAzureTransientErrorDetectionStrategy>(globalVal.conRetryCount, TimeSpan.FromSeconds(globalVal.conRetryFromSeconds)); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("uspSelLoginInfo", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID", SqlDbType.NVarChar, -1).Value = p.memberID; command.Parameters.Add("@MemberPWD", SqlDbType.NVarChar, -1).Value = p.memberPWD; command.Parameters.Add("@LastDeviceID", SqlDbType.NVarChar, -1).Value = p.memberPWD; command.Parameters.Add("@LastIPaddress", SqlDbType.NVarChar, -1).Value = p.memberPWD; command.Parameters.Add("@LastMACAddress", SqlDbType.NVarChar, -1).Value = p.memberPWD; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { SelLoginInfoModel workItem = new SelLoginInfoModel() { MemberID = dreader[0].ToString(), MemberPWD = dreader[1].ToString(), EmailAddress = dreader[2].ToString(), EmailConfirmedYN = dreader[3].ToString(), PhoneNumber1 = dreader[4].ToString(), PhoneNumber2 = dreader[5].ToString(), PINumber = dreader[6].ToString(), Name1 = dreader[7].ToString(), Name2 = dreader[8].ToString(), Name3 = dreader[9].ToString(), DOB = dreader[10].ToString(), RecommenderID = dreader[11].ToString(), MemberGroup = dreader[12].ToString(), LastDeviceID = dreader[13].ToString(), LastIPaddress = dreader[14].ToString(), LastLoginDT = dreader[15].ToString(), LastLogoutDT = dreader[16].ToString(), LastMACAddress = dreader[17].ToString(), AccountBlockYN = dreader[18].ToString(), AccountBlockEndDT = dreader[19].ToString(), AnonymousYN = dreader[20].ToString(), _3rdAuthProvider = dreader[21].ToString(), _3rdAuthID = dreader[22].ToString(), _3rdAuthParam = dreader[23].ToString(), PushNotificationID = dreader[24].ToString(), PushNotificationProvider = dreader[25].ToString(), PushNotificationGroup = dreader[26].ToString(), sCol1 = dreader[27].ToString(), sCol2 = dreader[28].ToString(), sCol3 = dreader[29].ToString(), sCol4 = dreader[30].ToString(), sCol5 = dreader[31].ToString(), sCol6 = dreader[32].ToString(), sCol7 = dreader[33].ToString(), sCol8 = dreader[34].ToString(), sCol9 = dreader[35].ToString(), sCol10 = dreader[36].ToString() }; result.Add(workItem); } dreader.Close(); } connection.Close(); // end task log logMessage.memberID = p.memberID; logMessage.Level = "INFO"; logMessage.Logger = "CBSelLoginInfoController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); } /// Encrypt the result response if (globalVal.CloudBreadCryptSetting == "AES256") { try { encryptedResult.token = Crypto.AES_encrypt(JsonConvert.SerializeObject(result), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); response = Request.CreateResponse(HttpStatusCode.OK, encryptedResult); return response; } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Encrypt Error", ex); throw ex; } } response = Request.CreateResponse(HttpStatusCode.OK, result); return response; } } catch (Exception ex) { // error log logMessage.memberID = p.memberID; logMessage.Level = "ERROR"; logMessage.Logger = "CBSelLoginInfoController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public string Post(InputParams p) { string result = ""; Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); try { //// 진입로그 //logMessage.memberID = p.MemberID_Members; //logMessage.Level = "INFO"; //logMessage.Logger = "CBuspInsRegMemberCheckController"; //logMessage.Message = jsonParam; //Logging.RunLog(logMessage); using (SqlConnection connection = new SqlConnection(globalVal.DBConnectionString)) { using (SqlCommand command = new SqlCommand("CloudBread.uspInsRegMember", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@MemberID_Members", SqlDbType.NVarChar, -1).Value = p.MemberID_Members; command.Parameters.Add("@MemberPWD_Members", SqlDbType.NVarChar, -1).Value = p.MemberPWD_Members; command.Parameters.Add("@EmailAddress_Members", SqlDbType.NVarChar, -1).Value = p.EmailAddress_Members; command.Parameters.Add("@EmailConfirmedYN_Members", SqlDbType.NVarChar, -1).Value = p.EmailConfirmedYN_Members; command.Parameters.Add("@PhoneNumber1_Members", SqlDbType.NVarChar, -1).Value = p.PhoneNumber1_Members; command.Parameters.Add("@PhoneNumber2_Members", SqlDbType.NVarChar, -1).Value = p.PhoneNumber2_Members; command.Parameters.Add("@PINumber_Members", SqlDbType.NVarChar, -1).Value = p.PINumber_Members; command.Parameters.Add("@Name1_Members", SqlDbType.NVarChar, -1).Value = p.Name1_Members; command.Parameters.Add("@Name2_Members", SqlDbType.NVarChar, -1).Value = p.Name2_Members; command.Parameters.Add("@Name3_Members", SqlDbType.NVarChar, -1).Value = p.Name3_Members; command.Parameters.Add("@DOB_Members", SqlDbType.NVarChar, -1).Value = p.DOB_Members; command.Parameters.Add("@RecommenderID_Members", SqlDbType.NVarChar, -1).Value = p.RecommenderID_Members; command.Parameters.Add("@MemberGroup_Members", SqlDbType.NVarChar, -1).Value = p.MemberGroup_Members; command.Parameters.Add("@LastDeviceID_Members", SqlDbType.NVarChar, -1).Value = p.LastDeviceID_Members; command.Parameters.Add("@LastIPaddress_Members", SqlDbType.NVarChar, -1).Value = p.LastIPaddress_Members; command.Parameters.Add("@LastLoginDT_Members", SqlDbType.NVarChar, -1).Value = p.LastLoginDT_Members; command.Parameters.Add("@LastLogoutDT_Members", SqlDbType.NVarChar, -1).Value = p.LastLogoutDT_Members; command.Parameters.Add("@LastMACAddress_Members", SqlDbType.NVarChar, -1).Value = p.LastMACAddress_Members; command.Parameters.Add("@AccountBlockYN_Members", SqlDbType.NVarChar, -1).Value = p.AccountBlockYN_Members; command.Parameters.Add("@AccountBlockEndDT_Members", SqlDbType.NVarChar, -1).Value = p.AccountBlockEndDT_Members; command.Parameters.Add("@AnonymousYN_Members", SqlDbType.NVarChar, -1).Value = p.AnonymousYN_Members; command.Parameters.Add("@3rdAuthProvider_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthProvider_Members; command.Parameters.Add("@3rdAuthID_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthID_Members; command.Parameters.Add("@3rdAuthParam_Members", SqlDbType.NVarChar, -1).Value = p._3rdAuthParam_Members; command.Parameters.Add("@PushNotificationID_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationID_Members; command.Parameters.Add("@PushNotificationProvider_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationProvider_Members; command.Parameters.Add("@PushNotificationGroup_Members", SqlDbType.NVarChar, -1).Value = p.PushNotificationGroup_Members; command.Parameters.Add("@sCol1_Members", SqlDbType.NVarChar, -1).Value = p.sCol1_Members; command.Parameters.Add("@sCol2_Members", SqlDbType.NVarChar, -1).Value = p.sCol2_Members; command.Parameters.Add("@sCol3_Members", SqlDbType.NVarChar, -1).Value = p.sCol3_Members; command.Parameters.Add("@sCol4_Members", SqlDbType.NVarChar, -1).Value = p.sCol4_Members; command.Parameters.Add("@sCol5_Members", SqlDbType.NVarChar, -1).Value = p.sCol5_Members; command.Parameters.Add("@sCol6_Members", SqlDbType.NVarChar, -1).Value = p.sCol6_Members; command.Parameters.Add("@sCol7_Members", SqlDbType.NVarChar, -1).Value = p.sCol7_Members; command.Parameters.Add("@sCol8_Members", SqlDbType.NVarChar, -1).Value = p.sCol8_Members; command.Parameters.Add("@sCol9_Members", SqlDbType.NVarChar, -1).Value = p.sCol9_Members; command.Parameters.Add("@sCol10_Members", SqlDbType.NVarChar, -1).Value = p.sCol10_Members; command.Parameters.Add("@TimeZoneID_Members", SqlDbType.NVarChar, -1).Value = p.TimeZoneID_Members; command.Parameters.Add("@Level_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Level_MemberGameInfoes; command.Parameters.Add("@Exps_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Exps_MemberGameInfoes; command.Parameters.Add("@Points_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.Points_MemberGameInfoes; command.Parameters.Add("@UserSTAT1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT1_MemberGameInfoes; command.Parameters.Add("@UserSTAT2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT2_MemberGameInfoes; command.Parameters.Add("@UserSTAT3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT3_MemberGameInfoes; command.Parameters.Add("@UserSTAT4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT4_MemberGameInfoes; command.Parameters.Add("@UserSTAT5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT5_MemberGameInfoes; command.Parameters.Add("@UserSTAT6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT6_MemberGameInfoes; command.Parameters.Add("@UserSTAT7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT7_MemberGameInfoes; command.Parameters.Add("@UserSTAT8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT8_MemberGameInfoes; command.Parameters.Add("@UserSTAT9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT9_MemberGameInfoes; command.Parameters.Add("@UserSTAT10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.UserSTAT10_MemberGameInfoes; command.Parameters.Add("@sCol1_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol1_MemberGameInfoes; command.Parameters.Add("@sCol2_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol2_MemberGameInfoes; command.Parameters.Add("@sCol3_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol3_MemberGameInfoes; command.Parameters.Add("@sCol4_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol4_MemberGameInfoes; command.Parameters.Add("@sCol5_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol5_MemberGameInfoes; command.Parameters.Add("@sCol6_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol6_MemberGameInfoes; command.Parameters.Add("@sCol7_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol7_MemberGameInfoes; command.Parameters.Add("@sCol8_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol8_MemberGameInfoes; command.Parameters.Add("@sCol9_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol9_MemberGameInfoes; command.Parameters.Add("@sCol10_MemberGameInfoes", SqlDbType.NVarChar, -1).Value = p.sCol10_MemberGameInfoes; connection.Open(); using (SqlDataReader dreader = command.ExecuteReader()) { while (dreader.Read()) { result = dreader[0].ToString(); } dreader.Close(); } connection.Close(); // 완료 로그 logMessage.memberID = p.MemberID_Members; logMessage.Level = "INFO"; logMessage.Logger = "CBuspInsRegMemberCheckController"; logMessage.Message = jsonParam; Logging.RunLog(logMessage); return result; } } } catch (Exception ex) { //에러로그 logMessage.memberID = p.MemberID_Members; logMessage.Level = "ERROR"; logMessage.Logger = "CBuspInsRegMemberCheckController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }