public async Task registrationAsync(User_Authorization user_auth) { NotificationManagement nm = new NotificationManagement(); UserStoryManagement usm = new UserStoryManagement(); var users = dataContext.getConnection().GetCollection <User_Authorization>("User"); await users.InsertOneAsync(user_auth); await nm.insert_notificationAsync(new Notification_Record { _id = user_auth._id.ToString(), notifications = new List <Notification>() }); await usm.insert_userStoryAsync(new Entities.UserStory { _id = user_auth._id.ToString(), user_stories = new List <Entities.Story>() }); }
public NotificationsController() { db = new ApplicationDbContext(); notificationManagement = new NotificationManagement(db); }
public object GetNotification(JsonMember.TranscationManagement obj) { NotificationManagement obj1 = new NotificationManagement(); try { Sqldbmanager.Open(); Sqldbmanager.CreateParameters(1); Sqldbmanager.AddParameters(0, "@UserId", obj.UserId); idr = Sqldbmanager.ExecuteReader(CommandType.StoredProcedure, "USP_GetNotification"); List <JsonMember.NotificationManagementDetails> lstDetails = new List <JsonMember.NotificationManagementDetails>(); List <JsonMember.MoneyRequestNotificationDetails> lstMoneyDetails = new List <JsonMember.MoneyRequestNotificationDetails>(); while (idr.Read()) { lstDetails.Add(new JsonMember.NotificationManagementDetails() { TranscationId = Convert.ToString(idr["TranscationId"]), ShortMsg = Convert.ToString(idr["ShortMsg"]), MsgDescription = Convert.ToString(idr["MsgDescription"]), LdateTime = Convert.ToString(idr["LdateTime"]), }); } if (idr.NextResult()) { while (idr.Read()) { lstMoneyDetails.Add(new JsonMember.MoneyRequestNotificationDetails() { RequestId = Convert.ToInt64(idr["RequestId"]), Amount = Convert.ToDecimal(idr["Amount"]), Ldate = Convert.ToString(idr["Ldate"]), LTime = Convert.ToString(idr["LTime"]), UserName = Convert.ToString(idr["UserName"]), MobileNo = Convert.ToString(idr["MobileNo"]), PartnerId = Convert.ToInt64(idr["RequesterId"]) }); } } if (idr.NextResult()) { while (idr.Read()) { obj1 = new NotificationManagement() { flag = "true", Message = "success", AvailableBalance = Convert.ToDecimal(idr["AvailableBalance"].ToString()), NotificationCount = Convert.ToInt64(idr["NotificationCount"].ToString()), RequestMoneyNotificationCount = Convert.ToInt64(idr["RequestMoneyNotificationCount"].ToString()), lstNotificationManagementDetails = lstDetails, lstMoneyRequestNotificationDetails = lstMoneyDetails }; } } } catch (Exception Ex) { DS = LogError("Get Notification", Ex.Message.ToString(), "SP Name: USP_GetNotification"); obj1 = new NotificationManagement() { flag = "false", Message = DS.Tables[0].Rows[0]["Meaasge"].ToString(), AvailableBalance = 0, NotificationCount = 0, RequestMoneyNotificationCount = 0 }; } finally { idr.Close(); Sqldbmanager.Close(); } return(obj1); }
public ProjectsController() { notificationManager = new NotificationManagement(db); }