Ejemplo n.º 1
0
        public ActionResult Index()
        {
            ViewBag.DistrictList   = CM.DistrictList();
            ViewBag.ContestantList = Create2cs.ContestantDetailList();
            return(View());
            //List<Naba1> Clist = new List<Naba1>();
            //using (NabayubakDBEntities db = new NabayubakDBEntities())
            //{
            //    var obj = db.Contestants.Join(db.Districts, x => x.DistrictId, y => y.Id, (x, y) => new
            //    {
            //        x.Id,
            //        x.Firstname,
            //        x.Lastname,
            //        x.Gender,
            //        y.Name,
            //        x.DateOfBirth
            //    }).ToList();

            //    foreach (var item in obj)
            //    {
            //        Naba1 cd = new Naba1();
            //        cd.ConstantId = item.Id;
            //        cd.FullName = item.Firstname + " " + item.Lastname;
            //        cd.DateOfBirth = item.DateOfBirth.Value.ToShortDateString();
            //        cd.District= item.Name;
            //        cd.Gender = item.Gender;
            //        Clist.Add(cd);
            //    }
            //    ViewBag.ok = Clist.ToList();

            //    return View();
            //}
        }
Ejemplo n.º 2
0
        public ActionResult Create2(string mode, int contestantid, string firstname, string lastname, DateTime dob, bool active, int district, string gender)
        {
            var obj = Create2cs.Create2(mode, contestantid, firstname, lastname, dob, active, district, gender);

            return(Json(obj, JsonRequestBehavior.AllowGet));
        }