public static void SaveActivityProposal(QuiGigAPIEntities context, string message, string fromUserId, string toUserId, string activityType, long jobId, string userType, bool isNotification, bool isRead, long proposalId) { Activity activity = new Activity(); activity.Message = message; activity.FromID = fromUserId; activity.ToID = toUserId; activity.ActivityType = activityType; activity.ProposalId = proposalId; activity.JobId = jobId; activity.IsNotification = isNotification; if (activityType == ProfileParameterEnum.SIGNUP.ToString()) { activity.RedirectPath = "#"; } else if (proposalId > 0) { activity.RedirectPath = "/order-detail?key=" + Encrypt(userType) + "¶m1=" + jobId + "¶m2=" + proposalId; } else { activity.RedirectPath = "/order-detail?key=" + Encrypt(userType) + "¶m1=" + jobId; } activity.IsRead = false; activity.IsActive = true; activity.IsDelete = false; activity.CreatedDate = DateTime.UtcNow; activity.UpdatedDate = DateTime.UtcNow; context.Activities.Add(activity); context.SaveChanges(); }
public static void SaveUserWallet(QuiGigAPIEntities context, string userId, long userPaymentId, string description, int creditAmount, int debitAmount, long packgId, string paymentStatus, string paymentFrom, decimal payAmount, int bonusCoin, string paymentGateway) { try { UserWallet entity = new UserWallet(); entity.UserID = userId; entity.UserPaymentId = userPaymentId; entity.Description = description; entity.CreditAmount = creditAmount; entity.DebitAmount = debitAmount; entity.CreatedDate = DateTime.UtcNow; entity.PaymentFrom = paymentFrom; entity.PaymentStatus = paymentStatus; entity.PayAmount = payAmount; entity.BonusCoin = bonusCoin; if (packgId > 0) { entity.PackageId = packgId; } entity.PaymentGateway = paymentGateway; context.UserWallets.Add(entity); context.SaveChanges(); } catch (Exception ex) { } }
public static string GetRoleNameById(string roleId, QuiGigAPIEntities context) { var roleName = ""; var role = context.AspNetRoles.FirstOrDefault(x => x.Id == roleId); if (role != null) { roleName = role.Name; } return(roleName); }
public static long SaveUserPayment(QuiGigAPIEntities context, string userId, string provider, long planID, decimal durationAmount, string description, string token, string transactionId, long packgId, string paymentFrom, string paymentStatus) { long id = 0; try { var providerDetail = context.PaymentSubscriptions.Where(x => x.Provider.ToLower() == provider.ToLower() && x.IsActive == true).FirstOrDefault(); if (providerDetail != null) { UserPayment entity = new UserPayment(); entity.ProviderId = providerDetail.ID; entity.UserID = userId; if (planID > 0) { entity.UserPlanId = planID; } entity.Token = token; entity.Amount = durationAmount; entity.PaymentStatus = paymentStatus; entity.PaymentFrom = paymentFrom; if (!string.IsNullOrEmpty(transactionId)) { entity.TransactionId = transactionId; } entity.CreatedDate = DateTime.UtcNow; entity.Description = description; if (packgId > 0) { entity.PackageId = packgId; } context.UserPayments.Add(entity); context.SaveChanges(); id = entity.ID; } } catch (Exception ex) { } return(id); }
public static bool GetNotificationValue(string notificationType, string notificationCat, string userId, QuiGigAPIEntities context) { bool notificationVal = false; try { var userNotify = context.UserNotifications.Where(x => x.Notification.UniqueCode == notificationType && x.UserId == userId && x.Notification.NotificationCategory.UniqueName == notificationCat && x.IsActive == true && x.Notification.IsActive == true && x.Notification.IsDelete == false && x.Notification.NotificationCategory.IsActive == true && x.Notification.NotificationCategory.IsDelete == false && x.IsDelete == false ).FirstOrDefault(); if (userNotify != null) { notificationVal = userNotify.NotificationValue; } } catch (Exception ex) { throw (ex); } return(notificationVal); }