Пример #1
0
        public IActionResult Create()
        {
            int    Y     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtYear").Value);
            int    M     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtMonth").Value);
            string KIDro = User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value;

            ViewBag.repPerList = CtVet2DAL.RepPerListList(Y, M);
            ViewBag.KIDdivList = spDAL.KIDdivList(KIDro);
            ViewBag.KIDspcList = spDAL.KIDspcList();
            ViewBag.KIDdtpList = spDAL.KIDdtpList();

            string pg;

            if (DateTime.Today.Month > 6)
            {
                pg = "2";
            }
            else
            {
                pg = "1";
            }
            CtVet2 tmp = new CtVet2
            {
                KIDro  = User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value,
                repPer = DateTime.Today.Year + "/" + pg
                         //new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1)
            };

            ViewBag.Page = "CtVet2";
            return(View(tmp));
        }
Пример #2
0
        public IActionResult Edit(Guid id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            CtVet2 tmp = CtVet2DAL.GetById(id);

            if (tmp == null)
            {
                return(NotFound());
            }

            int    Y     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtYear").Value);
            int    M     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtMonth").Value);
            string KIDro = User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value;

            ViewBag.repPerList = CtVet2DAL.RepPerListList(Y, M);
            ViewBag.KIDdivList = spDAL.KIDdivList(KIDro);
            ViewBag.KIDspcList = spDAL.KIDspcList();
            ViewBag.KIDdtpList = spDAL.KIDdtpList();

            ViewBag.Page = "CtVet2";
            return(View(tmp));
        }
Пример #3
0
        public IActionResult Index()
        {
            int    Y     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtYear").Value);
            int    M     = Convert.ToInt32(User.Claims.ToList().FirstOrDefault(x => x.Type == "reportDtMonth").Value);
            string KIDro = User.Claims.ToList().FirstOrDefault(x => x.Type == "KIDro").Value;
            IEnumerable <CtVet2> list = CtVet2DAL.GetAll(KIDro, Y, M);

            ViewBag.Page    = "CtVet2";
            ViewBag.RepList = CtVet2DAL.RepPerListList(Y, M); //spDAL.ReportToToday();
            return(View(list));
        }