public async Task AddAsync(Card entity) { try { var spParameters = new SqlParameter[5]; spParameters[0] = new SqlParameter() { ParameterName = "CardExMonth", Value = entity.CardExpiryMonth }; spParameters[1] = new SqlParameter() { ParameterName = "CardExYear", Value = entity.CardExpiryYear }; spParameters[2] = new SqlParameter() { ParameterName = "CardCvv", Value = entity.CardCvv }; spParameters[3] = new SqlParameter() { ParameterName = "CardNumber", Value = entity.CardNumber }; spParameters[4] = new SqlParameter() { ParameterName = "UserId", Value = entity.UserId }; await DbContextManager.StoreProc <StoreProcResult>("[dbo].spPayment", spParameters); } catch (Exception e) { DbContextManager.RollbackTransaction(); } await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(vCartItem entity) { var spParameters = new SqlParameter[4]; spParameters[0] = new SqlParameter() { ParameterName = "FashionProductId", Value = entity.FashionProductId }; spParameters[1] = new SqlParameter() { ParameterName = "PaytmUserId", Value = entity.PaytmUserId }; spParameters[2] = new SqlParameter() { ParameterName = "ProductQuantity", Value = entity.ProductQuantity }; spParameters[3] = new SqlParameter() { ParameterName = "TotalAmount", Value = entity.TotalAmount }; await DbContextManager.StoreProc <StoreProcResult>("[dbo].[spCart]", spParameters); await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(BookTrainResult entity) { /* var spParameters = new SqlParameter[11]; * spParameters[0] = new SqlParameter() { ParameterName = "BookTrainId", Value = entity.BookTrainId }; * spParameters[1] = new SqlParameter() { ParameterName = "UserId", Value = entity.UserId }; * spParameters[2] = new SqlParameter() { ParameterName = "TrainName", Value = entity.TrainName }; * spParameters[3] = new SqlParameter() { ParameterName = "StationStartingPoint", Value = entity.StationStartingPoint }; * spParameters[4] = new SqlParameter() { ParameterName = "StationEndingPoint", Value = entity.StationEndingPoint }; * spParameters[5] = new SqlParameter() { ParameterName = "StationArriveTime", Value = entity.StationArriveTime }; * spParameters[6] = new SqlParameter() { ParameterName = "StationDepartTime", Value = entity.StationDepartTime }; * spParameters[7] = new SqlParameter() { ParameterName = "TrainObjectTypeName", Value = entity.TrainObjectTypeName }; * spParameters[8] = new SqlParameter() { ParameterName = "TrainAvailableDay", Value = entity.TrainAvailableDay }; * spParameters[9] = new SqlParameter() { ParameterName = "TrainApplicationObjectClassName", Value = entity.TrainApplicationObjectClassName }; * spParameters[10] = new SqlParameter() { ParameterName = "data", Value = entity.data }; * * * await DbContextManager.StoreProc<StoreProcResult>("[dbo].spBookTrainResult ", spParameters); * try * { * await DbContextManager.CommitAsync(); * } * catch (Exception) * { * DbContextManager.RollbackTransaction(); * }*/ await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(Card entity) { try { var spParameters = new SqlParameter[4]; spParameters[0] = new SqlParameter() { ParameterName = "CardExMonth", Value = entity.CardExpiryMonth }; spParameters[1] = new SqlParameter() { ParameterName = "CardExYear", Value = entity.CardExpiryYear }; spParameters[2] = new SqlParameter() { ParameterName = "CardCvv", Value = entity.CardCvv }; spParameters[3] = new SqlParameter() { ParameterName = "CardNumber", Value = entity.CardNumber }; spParameters[0] = new SqlParameter() { ParameterName = "UserId", Value = entity.UserId }; } catch (Exception e) { } await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(User entity) { PasswordResult passwordResult = PasswordHash.Encrypt(entity.userPassword); entity.Password = passwordResult.Signature; entity.Salt = passwordResult.Salt; await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(BlockedUser entity) { if (entity.IsBlocked == true) { entity.UsercontactId = entity.BlockedUserId; } await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(User entity) { //var UserPassword = "******"; //PasswordResult passwordResult = PasswordHash.Encrypt(UserPassword); //entity.Password = passwordResult.Signature; //entity.Salt = passwordResult.Salt; await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(PostLike entity) { var count = Uow.Repository <PostLike>().Count(a => a.LikedById == entity.LikedById && a.PostId == entity.PostId); if (count == 0) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); } }
public async Task <object> GetBy(OTP parameters) { Random rand = new Random(); parameters.OtpNumber = rand.Next(1000, 9999); parameters.ActivateTime = System.DateTime.Now; parameters.DeactivateTime = parameters.ActivateTime.AddMinutes(2); await Uow.RegisterNewAsync(parameters); await Uow.CommitAsync(); return(await Task.FromResult(parameters.OTPId)); }
public async Task AddAsync(User entity) { /* byte[] arr = System.Text.Encoding.ASCII.GetBytes("h"); * entity.Password = arr; * entity.Salt = arr;*/ //entity.Password = System.Text.Encoding.ASCII.GetBytes(entity.pwd); //entity.Salt = System.Text.Encoding.ASCII.GetBytes(entity.slt); await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task <object> GetBy(OTP parameters) { Random random = new Random(); int randomNumber = random.Next(1000, 9999); parameters.OTPNumber = randomNumber; await Uow.RegisterNewAsync(parameters); await Uow.CommitAsync(); return(await Task.FromResult(parameters.OTPId)); //throw new NotImplementedException(); }
public async Task AddAsync(MyContact entity) { var count = 0; count = Uow.Repository <User>().Count(t => t.UserMobileNumber == 7405755503); var temp = Uow.Repository <User>().SingleOrDefault(t => t.UserMobileNumber == 1233); if (count != 0) { entity.UsercontactId = temp.UserId; await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); } }
public async Task AddAsync(LInkedInUserAuth entity) { PasswordResult passwordResult = PasswordHash.Encrypt(entity.Password); LinkedInUser linkedInUser = new LinkedInUser(); linkedInUser.Password = passwordResult.Signature; linkedInUser.Salt = passwordResult.Salt; linkedInUser.LIFirstName = entity.LIFirstName; linkedInUser.LILastName = entity.LILastName; linkedInUser.LIRegistrationDate = entity.LIRegistrationDate; linkedInUser.IsActive = entity.IsActive; linkedInUser.LIMobileNumber = entity.LIMobileNumber; linkedInUser.LIEmailId = entity.LIEmailId; await Uow.RegisterNewAsync(linkedInUser); await Uow.CommitAsync(); }
public async Task AddAsync(FacebookUserModel entity) { FacebookUser facebookUser = new FacebookUser(); PasswordResult passwordResult = PasswordHash.Encrypt(entity.Password); facebookUser.FirstName = entity.FirstName; facebookUser.LastName = entity.LastName; facebookUser.Email = entity.Email; facebookUser.MobileNo = entity.MobileNo; facebookUser.GenderAO = entity.GenderAO; facebookUser.LoginStatus = entity.LoginStatus; facebookUser.DateOfBirth = entity.DateOfBirth; facebookUser.CreatedDateTime = entity.CreatedDateTime; facebookUser.Password = passwordResult.Signature; facebookUser.Salt = passwordResult.Salt; await Uow.RegisterNewAsync(facebookUser); await Uow.CommitAsync(); }
public async Task <object> GetBy(EWallet parameters) { var x = await Uow.Repository <PNRGeneration>().SingleOrDefaultAsync(t => t.PNRId == parameters.PNRId); if (x != null) { var pnrDetails = await Uow.Repository <PassengerInvoice>().SingleOrDefaultAsync(r => r.passengerInvoiceId == x.PassengerInvoiceId); var z = pnrDetails.TotalPrice / pnrDetails.NumberOfPassengers; var currentDate = DateTime.Now; var time = await Uow.Repository <Payment>().SingleOrDefaultAsync(r => r.UserId == x.UserId); TimeSpan t = currentDate - time.PaymentDate; float d; if (t.TotalHours <= 12) { d = (50 * z) / 100; } else { d = (70 * z) / 100; } parameters.PaymentId = x.PaymentId; parameters.UserId = x.UserId; parameters.Refund = d; await Uow.RegisterNewAsync(parameters); var deletePNR = Uow.Repository <PNRGeneration>().FindByKey(x.PNRId); await Uow.RegisterDeletedAsync(deletePNR); await Uow.CommitAsync(); return("REFUND SUCCESSFUL"); } else { return("PNR INVALID"); } }
public async Task AddAsync(AppUser entity) { AppUser appuser = new AppUser(); PasswordResult passwordResult = PasswordHash.Encrypt(entity.userPassword); appuser.FirstName = entity.FirstName; appuser.LastName = entity.LastName; appuser.UserName = entity.UserName; appuser.MobileNumber = entity.MobileNumber; appuser.EmailId = entity.EmailId; appuser.BirthDate = entity.BirthDate; appuser.Gender = entity.Gender; appuser.CreatedDateTime = entity.CreatedDateTime; appuser.UpdatedDateTime = entity.UpdatedDateTime; appuser.RoleId = entity.RoleId; appuser.Status = entity.Status; appuser.Password = passwordResult.Signature; appuser.Salt = passwordResult.Salt; await Uow.RegisterNewAsync(appuser); await Uow.CommitAsync(); }
public async Task <object> GetBy(Kyc parameters) { AadharDetail AadharDetail = new AadharDetail(); var temp = await Uow.Repository <AadharDetail>().SingleOrDefaultAsync(t => t.AadharNumber == parameters.UAadharNumber); if (temp != null) { Random rand = new Random(); parameters.UAadharNumber = parameters.UAadharNumber; parameters.KycVerifyNumber = rand.Next(1000, 9999); //parameters.KycStatus = true; await Uow.RegisterNewAsync(parameters); await Uow.CommitAsync(); return(await Task.FromResult(parameters.KycId)); } else { return(await Task.FromResult("not found")); } }
public async Task AddAsync(Otp entity) { //Generate Otp var temp = Uow.Repository <Otp>().Count(t => t.UserId == entity.UserId); if (temp != 0) { var candidate = Uow.Repository <Otp>().FindBy(t => t.UserId == entity.UserId); await Uow.RegisterDeletedAsync(candidate); await Uow.CommitAsync(); } Random rnd = new Random(); string randomNumber = (rnd.Next(100000, 999999)).ToString(); entity.OtpCode = Int32.Parse(randomNumber); //Otp send via msg await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task <object> GetBy(GpayUser parameters) { //checking the mobile number availbale in DB or not var isAvailable = await Uow.Repository <GpayUser>().SingleOrDefaultAsync(t => t.MobileNumber == parameters.MobileNumber); if (isAvailable == null) { flag = false; //generating OTP //Random random = new Random(); //int randomNumber = random.Next(1000, 9999); await Uow.RegisterNewAsync(parameters); return(await Task.FromResult("otp genrated")); } else { flag = true; return(await Task.FromResult("Available")); } // throw new NotImplementedException(); }
public async Task <object> GetBy(Authentication parameters) { var mobileValidate = await Uow.Repository <User>().SingleOrDefaultAsync(t => t.MobileNumber == parameters.MobileNumber); if (mobileValidate != null) { Random rand = new Random(); var otpNumber = rand.Next(1000, 9999); Authentication Authentication = new Authentication() { UserId = mobileValidate.UserId, Otp = otpNumber }; await Uow.RegisterNewAsync <Authentication>(Authentication); await Uow.CommitAsync(); return(mobileValidate.UserId); } else { return("Invalid Mobile number"); } /* throw new NotImplementedException();*/ }
public async Task AddAsync(GpayUser entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(Designation entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(vAvailableBed entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(vCheckShareUser entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(vAllTransaction entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(Reward entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(vAllPost entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(ChatContent entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(SellerProduct entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }
public async Task AddAsync(PostCaption entity) { await Uow.RegisterNewAsync(entity); await Uow.CommitAsync(); }