Exemplo n.º 1
0
        public ActionResult AddEmployeeTourRecord(EmployeeTour employeetour, string Schedule, HttpPostedFileBase uploadPhoto)
        {
            bool result = false;

            string[] strSchedule = Schedule.Split('-');
            DateTime frmdate     = DateTime.ParseExact(strSchedule[0].Trim(), "dd/MM/yyyy h:mm tt", CultureInfo.InvariantCulture);

            employeetour.TourFromDate = frmdate;
            employeetour.TourFromDate = Convert.ToDateTime(frmdate.ToShortTimeString());

            DateTime todate = DateTime.ParseExact(strSchedule[1].Trim(), "dd/MM/yyyy h:mm tt", CultureInfo.InvariantCulture);

            employeetour.TourToDate = todate;
            employeetour.TourToDate = Convert.ToDateTime(todate.ToShortTimeString());
            string Status = "NA";

            result = admin.AddEmployeeTour(employeetour);
            if (result == true)
            {
                Int64  TourId = db.EmployeeTour.Max(c => c.TourId);
                string res    = admin.uploadTourFileAttachment(uploadPhoto, employeetour.UserId, TourId);
                Status = "Succeeded";
            }
            else
            {
                Status = "UnSucceeded";
            }
            return(RedirectToAction("AddEmployeeTourRecord", "Calendar", new { area = "CMS", savestatus = Status }));
        }
Exemplo n.º 2
0
        public ActionResult AddEmployeeTourRecord(Int64 PlannerId = 0, Int64 TourId = 0, Int64 FileId = 0, string savestatus = "NA")
        {
            string UserId      = User.Identity.GetUserId();
            var    userdetails = generic.GetUserDetail(UserId);

            ViewData["UserProfile"] = userdetails;
            ViewData["CompanyLogo"] = cmsMgr.GetCompanyLogo(userdetails.SubscriberId).FirstOrDefault();
            if (userdetails.Role != "Admin")
            {
                ViewData["EmpDetails"] = emsMgr.GetEmployeeBasicDetails(userdetails.UserId).FirstOrDefault();
            }
            ViewData["EmployeeTourData"] = db.EmployeeTour.Where(x => x.UserId == UserId).ToList();
            ViewBag.UserId = userdetails.UserId;
            ViewBag.Role   = userdetails.Role;
            EmployeeTour empTour = new EmployeeTour();

            empTour.PlannerId  = PlannerId;
            ViewBag.savestatus = savestatus;
            if (TourId != 0)
            {
                empTour = db.EmployeeTour.Where(c => c.TourId == TourId).FirstOrDefault();
                var schedule = empTour.TourFromDate + " " + empTour.TourFromDate.ToString("hh:mm:ss tt") + " " + "-" + " " + empTour.TourToDate + " " + empTour.TourToDate.ToString("hh:mm:ss tt");
                ViewBag.Schedule = schedule;
            }
            return(View(empTour));
        }
Exemplo n.º 3
0
        public ActionResult TourDetails(Int64 TourId = 0, Int64 PlannerId = 0)
        {
            var userdetails = generic.GetUserDetail(User.Identity.GetUserId());

            ViewData["UserProfile"] = userdetails;
            ViewData["CompanyLogo"] = cmsMgr.GetCompanyLogo(userdetails.SubscriberId).FirstOrDefault();
            EmployeeTour emptourdetails = db.EmployeeTour.Where(c => c.PlannerId == PlannerId && c.TourId == TourId).FirstOrDefault();
            var          Filerecord     = db.TourAttachment.Where(x => x.TourId == TourId).FirstOrDefault();

            ViewData["EmployeeTourData"] = Filerecord;
            return(View(emptourdetails));
        }