public string AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail, string IbanCode, string SwiftCode, string Other, string UserID) { Domain.Socioboard.Domain.User _User; try { _User = _UserRepository.getUsersById(Guid.Parse(UserID)); Domain.Socioboard.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Socioboard.Domain.EwalletWithdrawRequest(); _EwalletWithdrawRequest.Id = Guid.NewGuid(); _EwalletWithdrawRequest.UserName = _User.UserName; _EwalletWithdrawRequest.UserEmail = _User.EmailId; _EwalletWithdrawRequest.PaypalEmail = PaypalEmail; _EwalletWithdrawRequest.PaymentMethod = PaymentMethod; _EwalletWithdrawRequest.IbanCode = IbanCode; _EwalletWithdrawRequest.SwiftCode = SwiftCode; _EwalletWithdrawRequest.Other = Other; _EwalletWithdrawRequest.Status = 0; _EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount; _EwalletWithdrawRequest.UserId = Guid.Parse(UserID); _EwalletWithdrawRequest.RequestDate = DateTime.Now; _EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest); _UserRepository.UpdateEwalletAmount(Guid.Parse(UserID), (Double.Parse(_User.Ewallet) - Double.Parse(WithdrawAmount)).ToString()); } catch (Exception ex) { logger.Error(ex.Message); } _User = _UserRepository.getUsersById(Guid.Parse(UserID)); return(new JavaScriptSerializer().Serialize(_User)); }
public void Add(Domain.Socioboard.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest) { //Creates a database connection and opens up a session using (NHibernate.ISession session = SessionFactory.GetNewSession()) { using (NHibernate.ITransaction transaction = session.BeginTransaction()) { session.Save(_EwalletWithdrawRequest); transaction.Commit(); } } }
public void AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail, int Status, string UserID) { Domain.Socioboard.Domain.User _User = _UserRepository.getUsersById(Guid.Parse(UserID)); Domain.Socioboard.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Socioboard.Domain.EwalletWithdrawRequest(); _EwalletWithdrawRequest.Id = Guid.NewGuid(); _EwalletWithdrawRequest.UserName = _User.UserName; _EwalletWithdrawRequest.UserEmail = _User.EmailId; _EwalletWithdrawRequest.PaypalEmail = PaypalEmail; _EwalletWithdrawRequest.PaymentMethod = PaymentMethod; _EwalletWithdrawRequest.Status = Status; _EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount; _EwalletWithdrawRequest.UserId = Guid.Parse(UserID); _EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest); }
public void AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail, int Status, string UserID) { Domain.Socioboard.Domain.User _User = _UserRepository.getUsersById(Guid.Parse(UserID)); Domain.Socioboard.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Socioboard.Domain.EwalletWithdrawRequest(); _EwalletWithdrawRequest.Id = Guid.NewGuid(); _EwalletWithdrawRequest.UserName = _User.UserName; _EwalletWithdrawRequest.UserEmail = _User.EmailId; _EwalletWithdrawRequest.PaypalEmail = PaypalEmail; _EwalletWithdrawRequest.PaymentMethod = PaymentMethod; _EwalletWithdrawRequest.Status = Status; _EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount; _EwalletWithdrawRequest.UserId =Guid.Parse(UserID); _EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest); }
public string AddRequestToWithdraw(string WithdrawAmount, string PaymentMethod, string PaypalEmail,string IbanCode, string SwiftCode, string Other, string UserID) { Domain.Socioboard.Domain.User _User; try { _User = _UserRepository.getUsersById(Guid.Parse(UserID)); Domain.Socioboard.Domain.EwalletWithdrawRequest _EwalletWithdrawRequest = new Domain.Socioboard.Domain.EwalletWithdrawRequest(); _EwalletWithdrawRequest.Id = Guid.NewGuid(); _EwalletWithdrawRequest.UserName = _User.UserName; _EwalletWithdrawRequest.UserEmail = _User.EmailId; _EwalletWithdrawRequest.PaypalEmail = PaypalEmail; _EwalletWithdrawRequest.PaymentMethod = PaymentMethod; _EwalletWithdrawRequest.IbanCode = IbanCode; _EwalletWithdrawRequest.SwiftCode = SwiftCode; _EwalletWithdrawRequest.Other = Other; _EwalletWithdrawRequest.Status = 0; _EwalletWithdrawRequest.WithdrawAmount = WithdrawAmount; _EwalletWithdrawRequest.UserId = Guid.Parse(UserID); _EwalletWithdrawRequest.RequestDate = DateTime.Now; _EwalletWithdrawRequestRepository.Add(_EwalletWithdrawRequest); _UserRepository.UpdateEwalletAmount(Guid.Parse(UserID),(Double.Parse(_User.Ewallet)-Double.Parse(WithdrawAmount)).ToString()); } catch (Exception ex) { logger.Error(ex.Message); } _User = _UserRepository.getUsersById(Guid.Parse(UserID)); return new JavaScriptSerializer().Serialize(_User); }