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)); }
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)); }
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)); }