Example #1
0
        public List <Models_Admin_Bank_List> RetrieveAdminBankList()
        {
            try
            {
                var data = (from t1 in _db.MstAdminBank
                            join t2 in _db.MstBank on t1.BankSrno equals t2.Srno
                            select new Models_Admin_Bank_List
                {
                    Srno = t1.Srno,
                    BankSrno = t1.BankSrno,
                    BankCode = t2.BankCode,
                    BankName = t2.BankName,
                    BankAccountHolder = t1.BankAccountHolder,
                    BankCardNo = t1.BankCardNo,
                    Country = t1.Country,
                    Status = t1.Status,
                    CreatedDateTime = t1.CreatedDateTime,
                }).ToList();

                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Admin Bank Listing",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(null);
            }
        }
Example #2
0
        public int MemberUpdateBank(long MemberSrno, long UserBankSrno, long BankSrno, string BankAccountHolderName, string BankCardNo)
        {
            try
            {
                var UserBankDetails = _db.MstUserBank.Where(x => x.MemberSrno == MemberSrno && x.Srno == UserBankSrno).FirstOrDefault();
                if (UserBankDetails != null)
                {
                    UserBankDetails.BankSrno          = BankSrno;
                    UserBankDetails.BankAccountHolder = BankAccountHolderName;
                    UserBankDetails.BankCardNo        = BankCardNo;

                    _db.SaveChanges();
                    return(Models_General.SUCC_MEMBER_UPDATE_BANK);
                }
                return(Models_General.ERR_USER_BANK_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Member Update Bank",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
 public List <Models_Winlose_List> RetrieveWinloseList()
 {
     try
     {
         var data = (from t1 in _db.MstWinlose
                     join t2 in _db.MstUserAccount on t1.MemberSrno equals t2.MemberSrno
                     select new Models_Winlose_List
         {
             MemberSrno = t1.MemberSrno,
             WinloseAmount = t1.WinloseAmount,
             StakeAmount = t1.StakeAmount,
             Vendor = t1.Vendor,
             Currency = t1.Currency,
             CreatedDateTime = t1.CreatedDateTime,
             Product = t1.Product,
             GameType = t1.GameType,
             LoginId = t2.LoginId,
         }).OrderByDescending(x => x.CreatedDateTime).ToList();
         return(data);
     }
     catch (Exception ex)
     {
         var new_error = new LogErrorSystem
         {
             Title           = "Retrieve Winlose List",
             Details         = ex.Message + "/" + ex.StackTrace,
             Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
             CreatedDateTime = DateTime.Now,
         };
         _db.LogErrorSystem.Add(new_error);
         _db.SaveChanges();
         return(null);
     }
 }
Example #4
0
        public int DeleteAnnoucement(long AnnoucementSrno)
        {
            try
            {
                var Announcement_Details = _db.MstAnnouncement.Where(x => x.Srno == AnnoucementSrno).FirstOrDefault();
                if (Announcement_Details != null)
                {
                    _db.MstAnnouncement.Remove(Announcement_Details);
                    _db.SaveChanges();
                    return(Models_General.SUCC_ADMIN_DELETE_ANNOUNCEMENT);
                }
                return(Models_General.ERR_ANNOUNCEMENT_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Delete Announcement",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();

                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #5
0
 public int CreateNewBanner(string AdminID, IFormFile BannerImage, string RedirectURL, bool IsActive, string WebPath, string BaseURL)
 {
     try
     {
         var image_url = _image_services.SaveImage(BannerImage, WebPath, "BANNER", BaseURL);
         if (!string.IsNullOrEmpty(image_url))
         {
             var new_banner = new MstBanner
             {
                 ImagePath       = image_url,
                 RedirectUrl     = RedirectURL,
                 IsActive        = IsActive,
                 CreatedBy       = AdminID,
                 CreatedDateTime = DateTime.Now,
             };
             _db.MstBanner.Add(new_banner);
             _db.SaveChanges();
             return(Models_General.SUCC_ADMIN_CREATE_BANNER);
         }
         return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
     }
     catch (Exception ex)
     {
         var new_error = new LogErrorSystem
         {
             Title           = "Create Banner",
             Details         = ex.Message + "/" + ex.StackTrace,
             Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
             CreatedDateTime = DateTime.Now,
         };
         _db.LogErrorSystem.Add(new_error);
         _db.SaveChanges();
         return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
     }
 }
Example #6
0
 public int MemberRequestTopupWithCrypto(long MemberSrno, decimal TopupAmount, decimal Rate, string Currency, string TransactionHash)
 {
     try
     {
         var TopupRequest = new MstTopUp
         {
             MemberSrno      = MemberSrno,
             TopupAmount     = TopupAmount,
             Rate            = Rate,
             WalletType      = "CASH WALLET",
             Currency        = Currency,
             TransactionHash = TransactionHash,
             Status          = 0,
             RequestDate     = DateTime.Now,
             TransactionType = 1
         };
         _db.MstTopUp.Add(TopupRequest);
         _db.SaveChanges();
         return(Models_General.SUCC_CREATE_REQUEST_TOPUP);
     }
     catch (Exception ex)
     {
         var new_error = new LogErrorSystem
         {
             Title           = "Member Request Topup With Crypto",
             Details         = ex.Message + "/" + ex.StackTrace,
             Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
             CreatedDateTime = DateTime.Now,
         };
         _db.LogErrorSystem.Add(new_error);
         _db.SaveChanges();
         return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
     }
 }
Example #7
0
        public async Task <CheckTransaction_Response> CheckTransactionStatus(string strTransactionID)
        {
            try
            {
                //PREPARE URL
                string API_PATH    = "check";
                int    TimeStamp   = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
                var    requestbody = new Models_Player_CheckTransaction_Intergration
                {
                    Partner       = PartnerName,
                    Sign          = HttpService.CreateSignature(PartnerName, TimeStamp, PatnerKey),
                    TimeStamp     = TimeStamp,
                    TransactionId = strTransactionID,
                };

                //Prepare Body in json format
                string Content = JsonConvert.SerializeObject(requestbody);

                string FULL_API_PATH = WALLET_BASE_URL + API_PATH;
                //Invoke API
                return(JsonConvert.DeserializeObject <CheckTransaction_Response>(await HttpService.POST(FULL_API_PATH, Content)));
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Check Transaction Status Intergration",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                return(null);
            }
        }
Example #8
0
        public List <MstTopUp> RetrieveTopupListing(long?_MemberSrno)
        {
            try
            {
                var data = _db.MstTopUp.ToList();

                if (_MemberSrno != null)
                {
                    data = _db.MstTopUp.Where(x => x.MemberSrno == _MemberSrno).ToList();
                }
                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Topup Listing",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();

                return(null);
            }
        }
Example #9
0
        public Tuple <int, MstUserWallet> GetUserWallet(long MemberSrno)
        {
            try
            {
                var result = _db.MstUserWallet.Where(x => x.MemberSrno.Equals(MemberSrno)).FirstOrDefault();

                if (result != null)
                {
                    return(new Tuple <int, MstUserWallet>(0, result));
                }
                else
                {
                    return(new Tuple <int, MstUserWallet>(Models_General.ERR_USER_NOT_FOUND, null));
                }
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve User Wallet",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(new Tuple <int, MstUserWallet>(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR, null));
            }
        }
Example #10
0
        //998 API List Start//
        public async Task <Login_Response> CreateNewPlayer(string strPlayerUserName, string strPlayerFullName, string strPlayerEmail, string strPlayerPhone, string strPlayerDOB, string strPlayerPassword, string Country, int Gender)
        {
            try
            {
                //PREPARE URL
                string API_PATH  = "partner/register";
                int    TimeStamp = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

                if (string.IsNullOrEmpty(strPlayerUserName) || string.IsNullOrEmpty(strPlayerPassword))
                {
                    return(null);
                }

                string currency_code = "";

                //Based on the country code set the currency code
                currency_code = Country switch
                {
                    "CN" => "CNY",
                    "MY" => "MYR",
                    _ => "MYR",
                };


                var requestbody = new Models_Register_Player_Intergration()
                {
                    Partner   = PartnerName,
                    Sign      = HttpService.CreateSignature(PartnerName, TimeStamp, PatnerKey),
                    TimeStamp = TimeStamp,
                    UserName  = strPlayerUserName,
                    Password  = strPlayerPassword,
                    Fullname  = strPlayerFullName,
                    Email     = strPlayerEmail,
                    Mobile    = strPlayerPhone,
                    DoB       = strPlayerDOB,
                    Gender    = Gender,
                    Currency  = currency_code,
                };

                //Prepare Body in json format
                string Content = JsonConvert.SerializeObject(requestbody);


                string FULL_API_PATH = ACCOUNT_BASE_URL + API_PATH;
                //Invoke API
                return(JsonConvert.DeserializeObject <Login_Response>(await HttpService.POST(FULL_API_PATH, Content)));
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Create Player Intergration",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                return(null);
            }
        }
        public int UserUpdatePassword(string NewPassword, string OldPassword, long MemberSrno)
        {
            try
            {
                var UserAccount = _db.MstUserAccount.Where(x => x.MemberSrno == MemberSrno && x.Password == OldPassword).FirstOrDefault();
                if (UserAccount != null)
                {
                    UserAccount.Password = NewPassword;
                    _db.SaveChanges();

                    return(Models_General.SUCC_UPDATE_PASSWORD);
                }


                return(Models_General.ERR_INCORRECT_PASSWORD);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "User Update Password",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
        public Tuple <int, long> AuthorizeAdminAccount(string LoginID, string _Password)
        {
            //Declare a default result
            int  result    = Models_General.ERR_INCORRECT_CREDENTIALS;
            long AdminSrno = 0;

            try
            {
                //Check the Password Correct for the corressponding account.
                var AdminDetails = _db.MstAdminAccount.Where(x => x.Password.Equals(_Password) && x.LoginId.Equals(LoginID) && x.Status == "ACTIVE").FirstOrDefault();

                if (AdminDetails != null)
                {
                    AdminSrno = AdminDetails.Srno;
                    result    = Models_General.SUCC_AUTHORIZE_GRANTED;
                }


                return(new Tuple <int, long>(result, AdminSrno));
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Authorize Admin Account",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(new Tuple <int, long>(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR, AdminSrno));
            }
        }
        public int InactiveMember(long _MemberSrno, bool status)
        {
            try
            {
                var UserExist = _db.MstUserAccount.Where(x => x.MemberSrno == _MemberSrno).FirstOrDefault();
                if (UserExist != null)
                {
                    UserExist.Status = status == true ? "ACTIVE" : "INACTIVE";
                    _db.SaveChanges();

                    return(status == true ? Models_General.SUCC_ACTIVE_MEMBER : Models_General.SUCC_INACTIVE_MEMBER);
                }
                return(Models_General.ERR_USER_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve All Member Listing",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
        public List <SubGameDescription> RetrieveSubGameListing()
        {
            try
            {
                var data = (from t1 in _db.MstSubGame.Where(x => x.Status == "ACTIVE")
                            select new SubGameDescription
                {
                    GameType = t1.GameType,
                    VendorCode = t1.VendorCode,
                    GameName = t1.GameName,
                    GameCode = t1.GameCode,
                    ImageUrl = t1.GameImageUrl,
                    Status = t1.Status,
                }).ToList();

                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Sub Game Listing",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(null);
            }
        }
Example #15
0
        public int UpdateSettings(long SettingSrno, string AdminID, string SettingValue)
        {
            try
            {
                var Settings_Details = _db.MstSettings.Where(x => x.Srno == SettingSrno).FirstOrDefault();

                if (Settings_Details != null)
                {
                    Settings_Details.SettingValue     = SettingValue;
                    Settings_Details.LastUpdateBy     = AdminID;
                    Settings_Details.ModifiedDateTime = DateTime.Now;
                    _db.SaveChanges();

                    return(Models_General.SUCC_ADMIN_UPDATE_SETTINGS);
                }

                return(Models_General.ERR_SETTINGS_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Update Settings",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #16
0
        public int UserChangeUpline(string LoginID, string Upline)
        {
            try
            {
                int result;
                if (Upline != null && Upline != "" && !IsUsernameExist(Upline))
                {
                    result = Models_General.ERR_UPLINE_REFERCODE_NOT_EXIST;
                    return(result);
                }

                if (!IsUsernameExist(LoginID))
                {
                    result = Models_General.ERR_USER_NOT_FOUND;
                    return(result);
                }
                if (Upline != null && Upline != "")
                {
                    var UplineAccount  = _db.MstUserAccount.Where(x => x.LoginId.Equals(Upline)).FirstOrDefault();
                    var LoginIdAccount = _db.MstUserAccount.Where(x => x.LoginId.Equals(LoginID)).FirstOrDefault();

                    var UplineUser  = _db.MstUser.Where(x => x.MemberSrno.Equals(UplineAccount.MemberSrno)).FirstOrDefault();
                    var LoginIdUser = _db.MstUser.Where(x => x.MemberSrno.Equals(LoginIdAccount.MemberSrno)).FirstOrDefault();

                    LoginIdUser.Upline   = UplineAccount.LoginId;
                    LoginIdUser.UplineId = UplineAccount.MemberSrno;
                    result = Models_General.SUCC_CHANGE_UPLINE;
                }
                else
                {
                    var LoginIdAccount = _db.MstUserAccount.Where(x => x.LoginId.Equals(LoginID)).FirstOrDefault();
                    var LoginIdUser    = _db.MstUser.Where(x => x.MemberSrno.Equals(LoginIdAccount.MemberSrno)).FirstOrDefault();

                    LoginIdUser.Upline   = null;
                    LoginIdUser.UplineId = null;
                    result = Models_General.SUCC_CHANGE_UPLINE;
                }


                _db.SaveChanges();

                return(result);
            }catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Twelve User Change Upline",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #17
0
        public async Task <Open_Game_Response> OpenGame(string token, string gameVendor, string language, string browser, string gameCode)
        {
            try
            {
                //PREPARE URL
                string API_PATH      = "play/login";
                string finalGameCode = "";
                int    TimeStamp     = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

                if (string.IsNullOrEmpty(token) || string.IsNullOrEmpty(gameVendor) || string.IsNullOrEmpty(language) || string.IsNullOrEmpty(browser))
                {
                    return(null);
                }

                if (gameCode != null)
                {
                    finalGameCode = gameCode;
                }

                var requestbody = new Models_Player_PlayGame_Intergration()
                {
                    Vendor       = gameVendor,
                    Browser      = browser,
                    Lang         = language,
                    GameCode     = finalGameCode,
                    GameHall     = "",
                    MerchantCode = "",
                    Ticket       = "",
                    SeatId       = "",
                    Tag          = "",
                    GameProvider = "",
                    Device       = "unknown"
                };

                //Prepare Body in json format
                string Content       = JsonConvert.SerializeObject(requestbody);
                string FULL_API_PATH = OPEN_GAME_BASE_URL + API_PATH;
                //Invoke API

                var data = await HttpService.GAME_POST(FULL_API_PATH, Content, token);

                return(JsonConvert.DeserializeObject <Open_Game_Response>(data));
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Open Game Intergration",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                return(null);
            }
        }
Example #18
0
        public List <Models_Tracking_Wallet_Log_List> RetrieveTrackingWalletLogListByFilter(string loginid, int transactiontype, string startdate, string enddate)
        {
            try
            {
                var end = Convert.ToDateTime(enddate).AddDays(1);

                var query1 = _db.LogUserTrackingWallet.Where(x => x.CreatedDateTime >= Convert.ToDateTime(startdate) && x.CreatedDateTime < end).ToList();
                var query2 = _db.MstUserAccount.ToList();
                if (transactiontype > -1)
                {
                    query1 = query1.Where(x => x.TransactionType == transactiontype).ToList();
                }


                if (!string.IsNullOrEmpty(loginid))
                {
                    query2 = query2.Where(x => x.LoginId == loginid).ToList();
                }

                var data = (from t1 in query1
                            join t2 in query2 on t1.MemberSrno equals t2.MemberSrno
                            select new Models_Tracking_Wallet_Log_List
                {
                    MemberSrno = t1.MemberSrno,
                    WalletFrom = t1.WalletFrom,
                    WalletTo = t1.WalletTo,
                    TransactionType = t1.TransactionType,
                    PreviousAmount = t1.PreviousAmount,
                    TransactionAmount = t1.TransactionAmount,
                    CurrentTotalAmount = t1.CurrentTotalAmount,
                    IsDeduct = t1.IsDeduct,
                    Description = t1.Description,
                    CreatedDateTime = t1.CreatedDateTime,
                    Receiver = t1.Receiver,
                    Sender = t1.Sender,
                    LoginId = t2.LoginId,
                }).OrderByDescending(x => x.CreatedDateTime).ToList();
                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Tracking Wallet Log List",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(null);
            }
        }
Example #19
0
        public string SaveImage(IFormFile Images, string WebPath, string ImageType, string BaseURL)
        {
            try
            {
                if (Images != null)
                {
                    string UploadPath = null;
                    string URL        = null;

                    switch (ImageType)
                    {
                    case "ANNOUNCEMENT":
                        UploadPath = Path.Combine(WebPath, "images/announcement");
                        URL        = BaseURL + "/announcement";
                        break;

                    case "BANNER":
                        UploadPath = Path.Combine(WebPath, "images/banner");
                        URL        = BaseURL + "/banner";
                        break;

                    case "TOPUP":
                        UploadPath = Path.Combine(WebPath, "images/topup");
                        URL        = BaseURL + "/topup";
                        break;
                    }

                    string ImageName = Guid.NewGuid().ToString() + Path.GetExtension(Images.FileName);
                    string FullPath  = Path.Combine(UploadPath, ImageName);
                    using (var fileStream = new FileStream(FullPath, FileMode.Create))
                    {
                        Images.CopyTo(fileStream);
                    }

                    return(URL + "/" + ImageName);
                }
                return(null);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Save Image",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(null);
            }
        }
Example #20
0
        public int UpdateAnnoucement(long AnnoucementSrno, string AdminID, string TitleEN, string TitleCN, string TitleMS, string AnnoucementContentEN, string AnnouncementContentCN, string AnnouncementContentMS, bool IsPublish, bool IsImagePublish, string WebPath, string BaseURL, IFormFile AnnoucementImg = null)
        {
            try
            {
                var Announcement_Details = _db.MstAnnouncement.Where(x => x.Srno == AnnoucementSrno).FirstOrDefault();

                if (Announcement_Details != null)
                {
                    if (AnnoucementImg != null)
                    {
                        var image_url = _image_services.SaveImage(AnnoucementImg, WebPath, "ANNOUNCEMENT", BaseURL);

                        if (!string.IsNullOrEmpty(image_url))
                        {
                            Announcement_Details.AnnouncementImagePath = image_url;
                        }
                    }

                    Announcement_Details.TitleEn = TitleEN;
                    Announcement_Details.TitleCn = TitleCN;
                    Announcement_Details.TitleMs = TitleMS;
                    Announcement_Details.AnnouncementContentEn = AnnoucementContentEN;
                    Announcement_Details.AnnouncementContentCn = AnnouncementContentCN;
                    Announcement_Details.AnnouncementContentMs = AnnouncementContentMS;
                    Announcement_Details.IsPublish             = IsPublish;
                    Announcement_Details.IsImagePublish        = IsImagePublish;
                    Announcement_Details.LastUpdateBy          = AdminID;
                    Announcement_Details.LastModifiedDate      = DateTime.Now;
                    _db.SaveChanges();

                    return(Models_General.SUCC_ADMIN_UPDATE_ANNOUNCEMENT);
                }

                return(Models_General.ERR_ANNOUNCEMENT_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Update Announcement",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();

                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #21
0
        public List <Models_Topup_List> AdminRetrieveTopupListing()
        {
            try
            {
                var data = (from t1 in _db.MstTopUp
                            join t2 in _db.MstUserAccount on t1.MemberSrno equals t2.MemberSrno
                            select new Models_Topup_List
                {
                    Srno = t1.Srno,
                    LoginId = t2.LoginId,
                    MemberSrno = t1.MemberSrno,
                    WalletType = t1.WalletType,
                    TopupAmount = t1.TopupAmount,
                    Status = t1.Status,
                    Remarks = t1.Remarks,
                    RequestDate = t1.RequestDate,
                    ApproveBy = t1.ApproveBy,
                    ApproveRemark = t1.ApproveRemark,
                    ApproveDate = t1.ApproveDate,
                    RejectBy = t1.RejectBy,
                    RejectRemark = t1.RejectRemark,
                    RejectDate = t1.RejectDate,
                    TopupImageProof = t1.TopupImageProof,
                    TransactionReferenceNumber = t1.TransactionReferenceNumber,
                    BankCode = t1.BankCode,
                    BankAccountNumber = t1.BankAccountNumber,
                    BankName = t1.BankName,
                    BankAccountHolder = t1.BankAccountHolder,
                    TransactionType = t1.TransactionType,
                    TransactionHash = t1.TransactionHash,
                    Rate = t1.Rate,
                    Currency = t1.Currency,
                }).OrderByDescending(x => x.RequestDate).ToList();
                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Admin Retrieve Topup Listing",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();

                return(null);
            }
        }
Example #22
0
        public int MemberRequestWithdrawalCrypto(long _MemberSrno, decimal WithdrawalAmount, string ToAddress, decimal Rate, string Currency)
        {
            try
            {
                var WithdrawalRequest = new MstWithdraw
                {
                    MemberSrno      = _MemberSrno,
                    Status          = 0,
                    RequestDate     = DateTime.Now,
                    WithdrawAmount  = WithdrawalAmount,
                    TransactionType = 1,
                    ToAddress       = ToAddress,
                    Rate            = Rate,
                    Currency        = Currency,
                };

                var CurrentUserWalletInfo = _db.MstUserWallet.Where(x => x.MemberSrno == _MemberSrno).FirstOrDefault();

                if (WithdrawalAmount > CurrentUserWalletInfo.CashCredit)
                {
                    return(Models_General.ERR_WALLET_CREDIT_INSUFFICIENT);
                }

                if (CurrentUserWalletInfo.TurnoverAmount > 0)
                {
                    return(Models_General.ERR_WALLET_TURNOVER_CLEAR);
                }

                CurrentUserWalletInfo.CashCredit             = CurrentUserWalletInfo.CashCredit - WithdrawalAmount;
                CurrentUserWalletInfo.PendingWithdrawAmount += WithdrawalAmount;

                _db.MstWithdraw.Add(WithdrawalRequest);
                _db.SaveChanges();
                return(Models_General.SUCC_CREATE_REQUEST_WITHDRAWAL);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Member Request Withdrawal Crypto",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #23
0
        public int CreateAnnoucement(string AdminID, string TitleEN, string TitleCN, string TitleMS, string AnnoucementContentEN, string AnnouncementContentCN, string AnnouncementContentMS, bool IsPublish, bool IsImagePublish, string WebPath, string BaseURL, IFormFile AnnoucementImg = null)
        {
            try
            {
                var imageurl = "";
                if (AnnoucementImg != null)
                {
                    var image_url = _image_services.SaveImage(AnnoucementImg, WebPath, "ANNOUNCEMENT", BaseURL);

                    if (!string.IsNullOrEmpty(image_url))
                    {
                        imageurl = image_url;
                    }
                }

                var new_announcement = new MstAnnouncement
                {
                    TitleEn = TitleEN,
                    TitleCn = TitleCN,
                    TitleMs = TitleMS,
                    AnnouncementContentEn = AnnoucementContentEN,
                    AnnouncementContentCn = AnnouncementContentCN,
                    AnnouncementContentMs = AnnouncementContentMS,
                    IsPublish             = IsPublish,
                    IsImagePublish        = IsImagePublish,
                    AnnouncementImagePath = imageurl,
                    LastUpdateBy          = AdminID,
                    LastModifiedDate      = DateTime.Now,
                    CreatedDateTime       = DateTime.Now,
                };
                _db.MstAnnouncement.Add(new_announcement);
                _db.SaveChanges();

                return(Models_General.SUCC_ADMIN_CREATE_ANNOUNCEMENT);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Create Announcement",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
        public List <Models_Winlose_List> RetrieveWinloseListByFilter(string loginid, int vendor, string startdate, string enddate)
        {
            try
            {
                var end = Convert.ToDateTime(enddate).AddDays(1);

                var query1 = _db.MstWinlose.Where(x => x.CreatedDateTime >= Convert.ToDateTime(startdate) && x.CreatedDateTime < end).ToList();
                var query2 = _db.MstUserAccount.ToList();
                if (vendor > 0)
                {
                    query1 = query1.Where(x => x.Vendor == vendor).ToList();
                }


                if (!string.IsNullOrEmpty(loginid))
                {
                    query2 = query2.Where(x => x.LoginId == loginid).ToList();
                }

                var data = (from t1 in query1
                            join t2 in query2 on t1.MemberSrno equals t2.MemberSrno
                            select new Models_Winlose_List
                {
                    MemberSrno = t1.MemberSrno,
                    WinloseAmount = t1.WinloseAmount,
                    StakeAmount = t1.StakeAmount,
                    Vendor = t1.Vendor,
                    Currency = t1.Currency,
                    CreatedDateTime = t1.CreatedDateTime,
                    Product = t1.Product,
                    GameType = t1.GameType,
                    LoginId = t2.LoginId,
                }).OrderByDescending(x => x.CreatedDateTime).ToList();
                return(data);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Winlose List",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(null);
            }
        }
        public async Task <int> UpdateGameWalletAmounts()
        {
            using var dbContextTransaction = _db.Database.BeginTransaction();
            try
            {
                var UserGameAccounts = _db.MstUserGameAccount.ToList();

                foreach (var useraccount in UserGameAccounts)
                {
                    var balance = await _intergration.GetBalance(useraccount.GameId);

                    if (balance.Error == 0)
                    {
                        var founduserwallet = _db.MstUserGameWallet.Where(x => x.MemberSrno == useraccount.MemberSrno).FirstOrDefault();

                        if (founduserwallet != null)
                        {
                            founduserwallet.GameCredit = balance.Balance;
                        }
                        else
                        {
                            continue;
                        }
                    }
                }

                await _db.SaveChangesAsync();

                dbContextTransaction.Commit();
                return(Models_General.SUCC_GET_ALL_GAMER_WALLET_BALANCE);
            }
            catch (Exception ex)
            {
                dbContextTransaction.Rollback();

                var new_error = new LogErrorSystem
                {
                    Title           = "Update Game Wallets Account",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
        public int UserUpdateAccountDetails(long _MemberSrno, string FullName, string _Email, string _Phonenumber, string _DOB, int Gender)
        {
            try
            {
                var UserDetails = _db.MstUser.Where(x => x.MemberSrno == _MemberSrno).FirstOrDefault();

                var checkEmail = _db.MstUser.Where(x => x.Email == _Email).FirstOrDefault();
                var checkPhone = _db.MstUser.Where(x => x.Phone == _Phonenumber).FirstOrDefault();

                if (UserDetails == null)
                {
                    return(Models_General.ERR_USER_NOT_FOUND);
                }
                else if (checkEmail != null && checkEmail.MemberSrno != _MemberSrno)
                {
                    return(Models_General.ERR_EMAIL_EXIST);
                }
                else if (checkPhone != null && checkPhone.MemberSrno != _MemberSrno)
                {
                    return(Models_General.ERR_PHONENUMBER_EXIST);
                }

                UserDetails.Name   = FullName;
                UserDetails.Email  = _Email;
                UserDetails.Phone  = _Phonenumber;
                UserDetails.DoB    = _DOB;
                UserDetails.Gender = Gender;
                _db.SaveChanges();

                return(Models_General.SUCC_UPDATE_PROFILE);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "User Update Account Details",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
Example #27
0
        public async Task <Login_Response> RetrievePlayerToken(string strUserName)
        {
            try
            {
                //PREPARE URL
                string API_PATH  = "partner/login";
                int    TimeStamp = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

                if (string.IsNullOrEmpty(strUserName))
                {
                    return(null);
                }

                var requestbody = new Models_Login_Player_Intergration()
                {
                    Partner = PartnerName,

                    // For Login API the PartnerName will be : partnername + loginid for creating sign
                    Sign      = HttpService.CreateSignature(PartnerName + strUserName + "game1234", TimeStamp, PatnerKey),
                    TimeStamp = TimeStamp,
                    UserName  = strUserName,
                };

                //Prepare Body in json format
                string Content       = JsonConvert.SerializeObject(requestbody);
                string FULL_API_PATH = ACCOUNT_BASE_URL + API_PATH;
                //Invoke API

                var data = await HttpService.POST(FULL_API_PATH, Content);

                return(JsonConvert.DeserializeObject <Login_Response>(data));
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Token Intergration",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                return(null);
            }
        }
Example #28
0
        public async Task <decimal> GetBalanceGameCredit(long _MemberSrno)
        {
            using var dbContextTransaction = _db.Database.BeginTransaction();
            try
            {
                var     ISUserExist = _db.MstUserAccount.Where(x => x.MemberSrno == _MemberSrno && x.Status == "ACTIVE").Any();
                decimal data        = -1;
                if (ISUserExist)
                {
                    var UserGameAccountDetails = _db.MstUserGameAccount.Where(x => x.MemberSrno == _MemberSrno).FirstOrDefault();

                    var result = await _intergration.GetBalance(UserGameAccountDetails.GameId);

                    if (result.Error == 0)
                    {
                        data = result.Balance;
                        await _db.SaveChangesAsync();

                        dbContextTransaction.Commit();

                        return(data);
                    }

                    return(data);
                }

                return(Models_General.ERR_BALANCE_NOT_FOUND);
            }
            catch (Exception ex)
            {
                dbContextTransaction.Rollback();


                var new_error = new LogErrorSystem
                {
                    Title           = "Retrieve Game Balance Credit",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }
 public List <Models_User_Listing> RetrieveAllMemberListing()
 {
     try
     {
         return((from t1 in _db.MstUserAccount
                 join t2 in _db.MstUser
                 on t1.MemberSrno equals t2.MemberSrno
                 join t3 in _db.MstUserWallet
                 on t1.MemberSrno equals t3.MemberSrno
                 select new Models_User_Listing
         {
             MemberSrno = t1.MemberSrno,
             LoginID = t1.LoginId,
             Name = t2.Name,
             Phone = t2.Phone,
             Email = t2.Email,
             Password = t1.Password,
             Status = t1.Status,
             GameRegister = t1.GameRegister,
             Country = t2.Country,
             Dob = t2.DoB,
             RegisterDate = t2.RegisterDate,
             Gender = t2.Gender == 1 ? "MALE" : "FEMALE",
             DirectSponsor = t2.DirectSponsor,
             Refcode = t2.RefCode,
             Upline = t2.Upline,
             CashCredit = t3.CashCredit,
             TurnoverAmount = t3.TurnoverAmount
         }).ToList() ?? null);
     }
     catch (Exception ex)
     {
         var new_error = new LogErrorSystem
         {
             Title           = "Retrieve All Member Listing",
             Details         = ex.Message + "/" + ex.StackTrace,
             Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
             CreatedDateTime = DateTime.Now,
         };
         _db.LogErrorSystem.Add(new_error);
         _db.SaveChanges();
         return(null);
     }
 }
Example #30
0
        public int UpdateWalletTurnover(long Srno, long MemberSrno, decimal TurnoverAmount)
        {
            try
            {
                var UserWallet = _db.MstUserWallet.Where(x => x.MemberSrno == MemberSrno).FirstOrDefault();

                if (UserWallet != null)
                {
                    //Create new log to log which admin at what datetime change member password
                    var log_turnover = new LogTurnover
                    {
                        MemberSrno      = MemberSrno,
                        PreviousAmount  = UserWallet.TurnoverAmount,
                        TotalAmount     = TurnoverAmount,
                        UpdatedAmount   = TurnoverAmount,
                        Description     = string.Format("ADMIN:{0} UPDATE TURNOVER AMOUNT OF USER WALLET:{1} TO AMOUNT:{2} AT:{3}", Srno, MemberSrno, TurnoverAmount, DateTime.Now),
                        CreatedDateTime = DateTime.Now,
                        TransactionType = 14
                    };

                    //update the current user password to latest
                    UserWallet.TurnoverAmount = TurnoverAmount;

                    _db.LogTurnover.Add(log_turnover);
                    _db.SaveChanges();

                    return(Models_General.SUCC_CHANGE_MEMBER_TURNOVER);
                }
                return(Models_General.ERR_USER_WALLET_NOT_FOUND);
            }
            catch (Exception ex)
            {
                var new_error = new LogErrorSystem
                {
                    Title           = "Update Wallet Turnover",
                    Details         = ex.Message + "/" + ex.StackTrace,
                    Context         = _accessor.ActionContext.HttpContext.Connection.RemoteIpAddress.ToString(),
                    CreatedDateTime = DateTime.Now,
                };
                _db.LogErrorSystem.Add(new_error);
                _db.SaveChanges();
                return(Models_General.ERR_SERVER_BUSY_INTERNAL_ERROR);
            }
        }