public async Task <ActionResult> Dashboard() { if (null != Session[Constants.SESSION_OBJ_USER]) { var data = (UserAccount)Session[Constants.SESSION_OBJ_USER]; EmployeeDetailsModel datares = await user.GetUserDetailsAsync(data.RefEmployeeId); Models.LoginModel model = new Models.LoginModel(); model.EmpName = data.UserName; model.UserName = data.UserName; model.Projectname = datares.ProjectName; model.ManagerName = datares.ManagerName; model.TotalLeaveCount = Convert.ToInt16(datares.TotalLeaveCount); model.TotalTaken = datares.TotalCountTaken; model.TotalLeft = Convert.ToInt16(datares.TotalLeaveCount - datares.TotalCountTaken); model.DateOfJoining = DateTime.Now; model.RoleName = datares.RoleName; model.Announcements = new List <Models.Announcement>(); foreach (var item in datares.Announcements) { Models.Announcement announceItem = new Models.Announcement(); announceItem.ImagePath = item.ImagePath; announceItem.CarouselContent = item.CarouselContent; announceItem.Title = item.Title; model.Announcements.Add(announceItem); } model.LeaveDetails = datares.LeaveDetails; // model.Announcements = (Models.Announcement)datares.Announcements; return(View(model)); } return(View("Login")); }
public ActionResult AddAnnouncement(Models.Announcement announcement) { client = new FirebaseClient(config); FirebaseResponse response = client.Get("Announcements/"); var list = new List <Announcement>(); announcement.user = CurrentUser.Instance.User; AddToFirebase("Announcements/", announcement); return(View()); }
private void button8_Click(object sender, EventArgs e) { if (textBox2.Text.Any()) { Models.Announcement task = new Models.Announcement(); task.description = textBox2.Text; Models.Announcement.Create(task); MessageBox.Show("Announced"); this.Hide(); } else { MessageBox.Show("Please Fill All Required Fields"); } }
public async Task <IActionResult> CreateProgramAnnouncement(string title, string body, int programid) { var announcement = new Models.Announcement(); announcement.Title = title; announcement.Body = body; announcement.ProgramID = programid; announcement.CreatedOn = DateTime.Now; _context.Add(announcement); await _context.SaveChangesAsync(); string redirectAction = "Details/" + programid; return(RedirectToAction(redirectAction)); }
public Announcement(Models.Announcement announcement) { _announcement = announcement; }