// 복호화 수행 public CouponMember DecryptResult(CouponMember item) { try { item.CouponMemberID = Crypto.AES_decrypt(item.CouponMemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.CouponID = Crypto.AES_decrypt(item.CouponID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public GiftDepositories DecryptResult(GiftDepositories item) { try { item.GiftDepositoryID = Crypto.AES_decrypt(item.GiftDepositoryID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemListID = Crypto.AES_decrypt(item.ItemListID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCount = Crypto.AES_decrypt(item.ItemCount, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.FromMemberID = Crypto.AES_decrypt(item.FromMemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ToMemberID = Crypto.AES_decrypt(item.ToMemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members1.Name1 = Crypto.AES_decrypt(item.Members1.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public MemberAccountBlockLog DecryptResult(MemberAccountBlockLog item) { try { item.MemberAccountBlockID = Crypto.AES_decrypt(item.MemberAccountBlockID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberAccountBlockReasonCategory1 = Crypto.AES_decrypt(item.MemberAccountBlockReasonCategory1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberAccountBlockReasonCategory2 = Crypto.AES_decrypt(item.MemberAccountBlockReasonCategory2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberAccountBlockReasonCategory3 = Crypto.AES_decrypt(item.MemberAccountBlockReasonCategory3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberAccountBlockReason = Crypto.AES_decrypt(item.MemberAccountBlockReason, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberAccountBlockProcess = Crypto.AES_decrypt(item.MemberAccountBlockProcess, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public GameEventMember DecryptResult(GameEventMember item) { try { item.GameEventMemberID = Crypto.AES_decrypt(item.GameEventMemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.eventID = Crypto.AES_decrypt(item.eventID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.GameEvents.Title = Crypto.AES_decrypt(item.GameEvents.Title, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public GameEvents DecryptResult(GameEvents item) { try { item.GameEventID = Crypto.AES_decrypt(item.GameEventID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EventCategory1 = Crypto.AES_decrypt(item.EventCategory1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EventCategory2 = Crypto.AES_decrypt(item.EventCategory2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EventCategory3 = Crypto.AES_decrypt(item.EventCategory3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemListID = Crypto.AES_decrypt(item.ItemListID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCount = Crypto.AES_decrypt(item.ItemCount, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Itemstatus = Crypto.AES_decrypt(item.Itemstatus, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetGroup = Crypto.AES_decrypt(item.TargetGroup, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetOS = Crypto.AES_decrypt(item.TargetOS, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetDevice = Crypto.AES_decrypt(item.TargetDevice, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EventImageLink = Crypto.AES_decrypt(item.EventImageLink, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Title = Crypto.AES_decrypt(item.Title, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Content = Crypto.AES_decrypt(item.Content, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public Notices DecryptResult(Notices item) { try { item.NoticeID = Crypto.AES_decrypt(item.NoticeID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.NoticeCategory1 = Crypto.AES_decrypt(item.NoticeCategory1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.NoticeCategory2 = Crypto.AES_decrypt(item.NoticeCategory2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.NoticeCategory3 = Crypto.AES_decrypt(item.NoticeCategory3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetGroup = Crypto.AES_decrypt(item.TargetGroup, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetOS = Crypto.AES_decrypt(item.TargetOS, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.TargetDevice = Crypto.AES_decrypt(item.TargetDevice, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.NoticeImageLink = Crypto.AES_decrypt(item.NoticeImageLink, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.title = Crypto.AES_decrypt(item.title, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.content = Crypto.AES_decrypt(item.content, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
private string getConnectionString() { var connection = Configuration.GetSection("ConnectionStrings").GetChildren().Where(x => x.Key == "DatabaseConnection").First().Value; IConfigurationSection crypto = Configuration.GetSection("Cryptography"); var digit16 = crypto.GetChildren().Where(x => x.Key == "CRYPTO_DIGIT16").First().Value; var digit32 = crypto.GetChildren().Where(x => x.Key == "CRYPTO_DIGIT32").First().Value; var decryptoPass = Crypto.AES_decrypt("e8ExDkQlL4H7sac7GPgzqg==", digit32, digit16); return(connection.Replace("xxx", decryptoPass)); }
private string getConnectionString() { var connection = Configuration.GetSection("ConnectionStrings").GetChildren().First().Value; IConfigurationSection crypto = Configuration.GetSection("Cryptography"); var digit16 = crypto.GetChildren().ElementAt(0).Value; var digit32 = crypto.GetChildren().ElementAt(1).Value; var decryptoPass = Crypto.AES_decrypt("e8ExDkQlL4H7sac7GPgzqg==", digit32, digit16); return(connection.Replace("xxx", decryptoPass)); }
// 개별 entity 복호화 public Members DecryptResult(Members item) { try { item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberPWD = Crypto.AES_decrypt(item.MemberPWD, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EmailAddress = Crypto.AES_decrypt(item.EmailAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EmailConfirmedYN = Crypto.AES_decrypt(item.EmailConfirmedYN, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PhoneNumber1 = Crypto.AES_decrypt(item.PhoneNumber1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PhoneNumber2 = Crypto.AES_decrypt(item.PhoneNumber2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PINumber = Crypto.AES_decrypt(item.PINumber, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Name1 = Crypto.AES_decrypt(item.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Name2 = Crypto.AES_decrypt(item.Name2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Name3 = Crypto.AES_decrypt(item.Name3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.DOB = Crypto.AES_decrypt(item.DOB, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.RecommenderID = Crypto.AES_decrypt(item.RecommenderID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberGroup = Crypto.AES_decrypt(item.MemberGroup, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.LastDeviceID = Crypto.AES_decrypt(item.LastDeviceID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.LastIPaddress = Crypto.AES_decrypt(item.LastIPaddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.LastLoginDT = Crypto.AES_decrypt(item.LastLoginDT, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.LastLogoutDT = Crypto.AES_decrypt(item.LastLogoutDT, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.LastMACAddress = Crypto.AES_decrypt(item.LastMACAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.AccountBlockYN = Crypto.AES_decrypt(item.AccountBlockYN, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.AccountBlockEndDT = Crypto.AES_decrypt(item.AccountBlockEndDT, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.AnonymousYN = Crypto.AES_decrypt(item.AnonymousYN, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.C3rdAuthProvider = Crypto.AES_decrypt(item.C3rdAuthProvider, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.C3rdAuthID = Crypto.AES_decrypt(item.C3rdAuthID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.C3rdAuthParam = Crypto.AES_decrypt(item.C3rdAuthParam, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PushNotificationID = Crypto.AES_decrypt(item.PushNotificationID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PushNotificationProvider = Crypto.AES_decrypt(item.PushNotificationProvider, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PushNotificationGroup = Crypto.AES_decrypt(item.PushNotificationGroup, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public MemberItemPurchases DecryptResult(MemberItemPurchases item) { try { item.MemberItemPurchaseID = Crypto.AES_decrypt(item.MemberItemPurchaseID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemListID = Crypto.AES_decrypt(item.ItemListID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemLists.ItemName = Crypto.AES_decrypt(item.ItemLists.ItemName, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchasePrice = Crypto.AES_decrypt(item.PurchasePrice, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseQuantity = Crypto.AES_decrypt(item.PurchaseQuantity, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PGinfo1 = Crypto.AES_decrypt(item.PGinfo1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PGinfo2 = Crypto.AES_decrypt(item.PGinfo2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PGinfo3 = Crypto.AES_decrypt(item.PGinfo3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PGinfo4 = Crypto.AES_decrypt(item.PGinfo4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PGinfo5 = Crypto.AES_decrypt(item.PGinfo5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseDeviceID = Crypto.AES_decrypt(item.PurchaseDeviceID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseDeviceIPAddress = Crypto.AES_decrypt(item.PurchaseDeviceIPAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseDeviceMACAddress = Crypto.AES_decrypt(item.PurchaseDeviceMACAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseDT = Crypto.AES_decrypt(item.PurchaseDT, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelYN = Crypto.AES_decrypt(item.PurchaseCancelYN, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelDT = Crypto.AES_decrypt(item.PurchaseCancelDT, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelingStatus = Crypto.AES_decrypt(item.PurchaseCancelingStatus, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelReturnedAmount = Crypto.AES_decrypt(item.PurchaseCancelReturnedAmount, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelDeviceID = Crypto.AES_decrypt(item.PurchaseCancelDeviceID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelDeviceIPAddress = Crypto.AES_decrypt(item.PurchaseCancelDeviceIPAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.PurchaseCancelDeviceMACAddress = Crypto.AES_decrypt(item.PurchaseCancelDeviceMACAddress, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
public ItemLists DecryptResult(ItemLists result) { result.GetType().GetProperties().ToList().ForEach(p => { if (p.Name == "IteamUpdateAdminID" || p.Name == "IteamCreateAdminID" || p.Name == "Id" || p.Name == "Version" || p.Name == "Deleted" || p.Name == "CreatedAt" || p.Name == "UpdatedAt" || p.Name == "HideYN" || p.Name == "DeleteYN") // 복호화 안하고 통과 시킬 녀석들 { // 추가 처리 } else { //Debug.WriteLine((p.GetValue(result, null) ?? "").ToString()); p.SetValue(result, Crypto.AES_decrypt((p.GetValue(result, null) ?? "").ToString(), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV), null); //Debug.WriteLine((p.GetValue(result, null) ?? "").ToString()); } }); return(result); }
//복호화 처리 //public IPagedList<ItemLists> DecryptResult(IPagedList<ItemLists> result) //{ // foreach (var item in result) //List의 경우 // { // //리플렉션 쓰지 말자.... // item.GetType().GetProperties().ToList().ForEach(p => // { // if (p.Name == "IteamUpdateAdminID" || p.Name == "IteamCreateAdminID" || p.Name == "HideYN" || p.Name == "DeleteYN" || p.Name == "CreatedAt" || p.Name == "UpdatedAt" || p.Name == "DataFromRegion" || p.Name == "DataFromRegionDT") // 복호화 안하고 통과 시킬 녀석들 // { // // 추가 처리 // } // else // { // Debug.WriteLine((p.GetValue(item, null) ?? "").ToString()); // p.SetValue(item, Crypto.AES_decrypt(p.GetValue(item, null).ToString(), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV), null); // null인 경우 오류, DB기본값 체크 필요 // Debug.WriteLine((p.GetValue(item, null) ?? "").ToString()); // } // }); // } // return result; //} // 개별 entity 복호화 public ItemLists DecryptResult(ItemLists item) { try { item.ItemListID = Crypto.AES_decrypt(item.ItemListID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemName = Crypto.AES_decrypt(item.ItemName, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemDescription = Crypto.AES_decrypt(item.ItemDescription, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemPrice = Crypto.AES_decrypt(item.ItemPrice, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemSellPrice = Crypto.AES_decrypt(item.ItemSellPrice, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCategory1 = Crypto.AES_decrypt(item.ItemCategory1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCategory2 = Crypto.AES_decrypt(item.ItemCategory2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCategory3 = Crypto.AES_decrypt(item.ItemCategory3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); //리플렉션 안쓴다. //result.GetType().GetProperties().ToList().ForEach(p => //{ // if (p.Name == "IteamUpdateAdminID" || p.Name == "IteamCreateAdminID" || p.Name == "HideYN" || p.Name == "DeleteYN" || p.Name == "CreatedAt" || p.Name == "UpdatedAt" || p.Name == "DataFromRegion" || p.Name == "DataFromRegionDT") // 복호화 안하고 통과 시킬 녀석들 // { // // 추가 처리 // } // else // { // p.SetValue(result, Crypto.AES_decrypt((p.GetValue(result, null) ?? "").ToString(), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV), null); // } //}); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public MemberItems DecryptResult(MemberItems item) { try { item.MemberItemID = Crypto.AES_decrypt(item.MemberItemID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemListID = Crypto.AES_decrypt(item.ItemListID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemLists.ItemName = Crypto.AES_decrypt(item.ItemLists.ItemName, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemCount = Crypto.AES_decrypt(item.ItemCount, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ItemStatus = Crypto.AES_decrypt(item.ItemStatus, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); //result.GetType().GetProperties().ToList().ForEach(p => //{ // if (p.Name == "HideYN" || p.Name == "DeleteYN" || p.Name == "CreatedAt" || p.Name == "UpdatedAt" || p.Name == "DataFromRegion" || p.Name == "DataFromRegionDT") // 복호화 안하고 통과 시킬 녀석들 // { // // 추가 처리 // } // else // { // p.SetValue(result, Crypto.AES_decrypt((p.GetValue(result, null) ?? "").ToString(), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV), null); // } //}); } catch (Exception) { throw; } return(item); }
// 복호화 수행 public MemberGameInfoStages DecryptResult(MemberGameInfoStages item) { try { item.MemberGameInfoStageID = Crypto.AES_decrypt(item.MemberGameInfoStageID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageName = Crypto.AES_decrypt(item.StageName, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStatus = Crypto.AES_decrypt(item.StageStatus, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category1 = Crypto.AES_decrypt(item.Category1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category2 = Crypto.AES_decrypt(item.Category2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Category3 = Crypto.AES_decrypt(item.Category3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission1 = Crypto.AES_decrypt(item.Mission1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission2 = Crypto.AES_decrypt(item.Mission2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission3 = Crypto.AES_decrypt(item.Mission3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission4 = Crypto.AES_decrypt(item.Mission4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Mission5 = Crypto.AES_decrypt(item.Mission5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Points = Crypto.AES_decrypt(item.Points, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat1 = Crypto.AES_decrypt(item.StageStat1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat2 = Crypto.AES_decrypt(item.StageStat2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat3 = Crypto.AES_decrypt(item.StageStat3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat4 = Crypto.AES_decrypt(item.StageStat4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.StageStat5 = Crypto.AES_decrypt(item.StageStat5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
//복호화 처리 public IPagedList <ItemLists> DecryptResult(IPagedList <ItemLists> result) { foreach (var item in result) { item.GetType().GetProperties().ToList().ForEach(p => { if (p.Name == "IteamUpdateAdminID" || p.Name == "IteamCreateAdminID" || p.Name == "Id" || p.Name == "Version" || p.Name == "Deleted" || p.Name == "CreatedAt" || p.Name == "UpdatedAt" || p.Name == "HideYN" || p.Name == "DeleteYN") // 복호화 안하고 통과 시킬 녀석들 { // 추가 처리 } else { Debug.WriteLine((p.GetValue(item, null) ?? "").ToString()); p.SetValue(item, Crypto.AES_decrypt(p.GetValue(item, null).ToString(), globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV), null); // null인 경우 오류, DB기본값 체크 필요 Debug.WriteLine((p.GetValue(item, null) ?? "").ToString()); } }); } return(result); }
// 복호화 수행 public ServerInfo DecryptResult(ServerInfo item) { try { item.InfoID = Crypto.AES_decrypt(item.InfoID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.FEServerLists = Crypto.AES_decrypt(item.FEServerLists, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.SocketServerLists = Crypto.AES_decrypt(item.SocketServerLists, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Version = Crypto.AES_decrypt(item.Version, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.ResourceLink = Crypto.AES_decrypt(item.ResourceLink, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.EULAText = Crypto.AES_decrypt(item.EULAText, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
// 개별 entity 복호화 public MemberGameInfoes DecryptResult(MemberGameInfoes item) { try { item.MemberID = Crypto.AES_decrypt(item.MemberID, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Members.Name1 = Crypto.AES_decrypt(item.Members.Name1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Level = Crypto.AES_decrypt(item.Level, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Exps = Crypto.AES_decrypt(item.Exps, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.Points = Crypto.AES_decrypt(item.Points, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT1 = Crypto.AES_decrypt(item.UserSTAT1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT2 = Crypto.AES_decrypt(item.UserSTAT2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT3 = Crypto.AES_decrypt(item.UserSTAT3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT4 = Crypto.AES_decrypt(item.UserSTAT4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT5 = Crypto.AES_decrypt(item.UserSTAT5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT6 = Crypto.AES_decrypt(item.UserSTAT6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT7 = Crypto.AES_decrypt(item.UserSTAT7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT8 = Crypto.AES_decrypt(item.UserSTAT8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT9 = Crypto.AES_decrypt(item.UserSTAT9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.UserSTAT10 = Crypto.AES_decrypt(item.UserSTAT10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol1 = Crypto.AES_decrypt(item.sCol1, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol2 = Crypto.AES_decrypt(item.sCol2, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol3 = Crypto.AES_decrypt(item.sCol3, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol4 = Crypto.AES_decrypt(item.sCol4, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol5 = Crypto.AES_decrypt(item.sCol5, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol6 = Crypto.AES_decrypt(item.sCol6, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol7 = Crypto.AES_decrypt(item.sCol7, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol8 = Crypto.AES_decrypt(item.sCol8, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol9 = Crypto.AES_decrypt(item.sCol9, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); item.sCol10 = Crypto.AES_decrypt(item.sCol10, globalVal.CloudBreadCryptKey, globalVal.CloudBreadCryptIV); } catch (Exception) { throw; } return(item); }
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 HttpResponseMessage Post(UdtGameEventMemberToItemInputParams 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 <UdtGameEventMemberToItemInputParams>(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_MemberItems, this.User as ClaimsPrincipal); p.MemberID_MemberItems = sid; p.MemberID_GameEventMember = 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_MemberItems; //logMessage.Level = "INFO"; //logMessage.Logger = "CBUdtGameEventMemberToItemController"; //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("uspUdtGameEventMemberToItem", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@InsertORUpdate ", SqlDbType.NVarChar, -1).Value = p.InsertORUpdate.ToUpper(); 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("@eventID_GameEventMember", SqlDbType.NVarChar, -1).Value = p.eventID_GameEventMember; command.Parameters.Add("@MemberID_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.MemberID_GameEventMember; command.Parameters.Add("@sCol1_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol1_GameEventMember; command.Parameters.Add("@sCol2_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol2_GameEventMember; command.Parameters.Add("@sCol3_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol3_GameEventMember; command.Parameters.Add("@sCol4_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol4_GameEventMember; command.Parameters.Add("@sCol5_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol5_GameEventMember; command.Parameters.Add("@sCol6_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol6_GameEventMember; command.Parameters.Add("@sCol7_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol7_GameEventMember; command.Parameters.Add("@sCol8_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol8_GameEventMember; command.Parameters.Add("@sCol9_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol9_GameEventMember; command.Parameters.Add("@sCol10_GameEventMember ", SqlDbType.NVarChar, -1).Value = p.sCol10_GameEventMember; 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_MemberItems; logMessage.Level = "INFO"; logMessage.Logger = "CBUdtGameEventMemberToItemController"; 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_MemberItems; logMessage.Level = "ERROR"; logMessage.Logger = "CBUdtGameEventMemberToItemController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(InsRegMemberInputParams 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 <InsRegMemberInputParams>(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_Members, this.User as ClaimsPrincipal); p.MemberID_Members = 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_Members; //logMessage.Level = "INFO"; //logMessage.Logger = "CBuspInsRegMemberCheckController"; //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("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.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_Members; logMessage.Level = "INFO"; logMessage.Logger = "CBuspInsRegMemberCheckController"; 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_Members; logMessage.Level = "ERROR"; logMessage.Logger = "CBuspInsRegMemberCheckController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(SelItem1InputParams 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 <SelItem1InputParams>(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 <SelItem1Model> result = new List <SelItem1Model>(); 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("uspSelItem1", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@ItemListID", SqlDbType.NVarChar, -1).Value = p.ItemListID; connection.OpenWithRetry(retryPolicy); using (SqlDataReader dreader = command.ExecuteReaderWithRetry(retryPolicy)) { while (dreader.Read()) { SelItem1Model workItem = new SelItem1Model() { 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(); } /// 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 = "CBSelItem1Controller"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(DWMarketCheckInputParam 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 <DWMarketCheckInputParam>(decrypted); } catch (Exception ex) { ex = (Exception)Activator.CreateInstance(ex.GetType(), "Decrypt Error", ex); throw ex; } } Logging.CBLoggers logMessage = new Logging.CBLoggers(); string jsonParam = JsonConvert.SerializeObject(p); HttpResponseMessage response = new HttpResponseMessage(); EncryptedData encryptedResult = new EncryptedData(); try { DWMarketCheckModel result = GetResult(p); /// 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 = "Version Check"; logMessage.Level = "ERROR"; logMessage.Logger = "DWMarketVersionCheckController"; logMessage.Message = jsonParam; logMessage.Exception = ex.ToString(); Logging.RunLog(logMessage); throw; } }
public HttpResponseMessage Post(ComUdtMemberItemPurchaseInputParams 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 <ComUdtMemberItemPurchaseInputParams>(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 = "CBComUdtMemberItemPurchaseController"; //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("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.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 = "CBComUdtMemberItemPurchaseController"; 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 = "CBComUdtMemberItemPurchaseController"; 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; } }