public ActionResult Index()
        {
            RathoreDetailBL           _rathoreDetailBL  = new RathoreDetailBL();
            List <RathoreDetailModel> lstRathoreDetails = _rathoreDetailBL.GetAllRathoreDetail();

            return(View(lstRathoreDetails));
        }
        public ActionResult EditRathoreDetail(RathoreDetailModel obj)
        {
            @ViewBag.Style = "alert alert-success";
            if (ModelState.IsValid)
            {
                RathoreDetailBL _contactDetailBL = new RathoreDetailBL();
                obj.DateOfBirth = Convert.ToDateTime(obj.DateOfBirthFormated);
                string   Name        = Convert.ToString(TempData["Name"]).Trim();
                DateTime DateofBirth = Convert.ToDateTime(TempData["DateofBirth"]);

                TempData.Keep("Name");
                TempData.Keep("DateofBirth");


                if (Name != obj.Name.Trim() || (!obj.DateOfBirth.Equals(DateofBirth)))
                {
                    if (_contactDetailBL.CheckRathoreDetailExist(obj.Name, obj.DateOfBirth))
                    {
                        ViewBag.Saved   = true;
                        ViewBag.Style   = "alert alert-danger";
                        ViewBag.Message = " इस नाम की जानकारी पहले से अंकित है. ";
                        BindDropdown(ref obj);
                        return(View(obj));
                    }
                }

                obj.ModifiedBy = LoginUserID;

                int result = _contactDetailBL.UpdateRathoreDetail(obj);

                ViewBag.Saved = true;

                if (result == 1)
                {
                    ViewBag.Style   = "alert alert-success";
                    ViewBag.Message = "जानकारी डेटाबेस मे दर्ज हो गया है | धन्यवाद् ";
                }
                else
                {
                    ViewBag.Style   = "alert alert-danger";
                    ViewBag.Message = "तकनिकी खराबी की वजह से आपका सन्देश नहीं मिला , कृपया दुबारा भेजे.  ";
                }


                BindDropdown(ref obj);
            }
            return(View(obj));
        }
Пример #3
0
        public JsonResult GetHierarchicalDetail()
        {
            int             rathoreDetailId  = 0;
            RathoreDetailBL _rathoreDetailBL = new RathoreDetailBL();

            if (TempData["rathoreDetailId"] != null)
            {
                rathoreDetailId = Convert.ToInt32(TempData["rathoreDetailId"]);
            }

            List <HRathoreDetails> empChartList = new List <HRathoreDetails>();

            empChartList = _rathoreDetailBL.GetHierarchicalDetail(rathoreDetailId);

            return(Json(empChartList, JsonRequestBehavior.AllowGet));
        }
        public ActionResult DeleteRathoreDetail(int id)
        {
            RathoreDetailBL _contactDetailBL = new RathoreDetailBL();

            int result = _contactDetailBL.DeleteRathoreDetail(id);

            if (result == 1)
            {
                TempData["Message"] = "चयन किया रिकॉर्ड मिटा दिया गया है !! ";
            }
            else
            {
                TempData["Message"] = "तकनिकी खराबी की वजह से आपका सन्देश नहीं मिला , कृपया दुबारा भेजे.  ";
            }

            return(RedirectToAction("Index"));
        }
Пример #5
0
        // GET: RathoreDetail
        public ActionResult Index()
        {
            RathoreDetailBL           _rathoreDetailBL = new RathoreDetailBL();
            RathoreDetailDisplayModel objDisplay       = _rathoreDetailBL.GetDetailsToDisplay();


            List <RathoreDetailModel> rathoreDetail = new List <RathoreDetailModel>();

            foreach (var val in _rathoreDetailBL.GetAllRathoreDetail())
            {
                val.Age = CalculateAge(Convert.ToDateTime(val.DateOfBirth));
                rathoreDetail.Add(val);
            }



            objDisplay.RathoreDetails = rathoreDetail.OrderBy(o => o.Name).ToList();

            return(View(objDisplay));
        }
        public ActionResult EditRathoreDetail(int id)
        {
            TempData.Remove("Name");
            TempData.Remove("DateofBirth");

            ViewBag.Style = "alert alert-success";
            RathoreDetailBL    _rathoreDetailBL  = new RathoreDetailBL();
            RathoreDetailModel lstRathoreDetails = new RathoreDetailModel();

            lstRathoreDetails = _rathoreDetailBL.GetRathoreDetailId(id);

            TempData["Name"]        = lstRathoreDetails.Name;
            TempData["DateofBirth"] = lstRathoreDetails.DateOfBirth;

            BindDropdown(ref lstRathoreDetails);
            string datetime = string.Format("{0:yyyy-MM-dd}", lstRathoreDetails.DateOfBirth);

            lstRathoreDetails.DateOfBirthFormated = datetime;
            return(View(lstRathoreDetails));
        }
        public ActionResult AddRathoreDetail(RathoreDetailModel obj)
        {
            @ViewBag.Style = "alert alert-success";
            if (ModelState.IsValid)
            {
                RathoreDetailBL _contactDetailBL = new RathoreDetailBL();

                obj.DateOfBirth = Convert.ToDateTime(obj.DateOfBirthFormated);
                obj.CreatedBy   = LoginUserID;
                if (!_contactDetailBL.CheckRathoreDetailExist(obj.Name, obj.DateOfBirth))
                {
                    int result = _contactDetailBL.InsertRathoreDetail(obj);
                    // BindDropdown(ref obj);
                    ViewBag.Saved = true;

                    if (result == 1)
                    {
                        ViewBag.Style   = "alert alert-success";
                        ViewBag.Message = "जानकारी डेटाबेस मे दर्ज हो गया है | धन्यवाद् ";
                        ModelState.Clear();
                    }
                    else
                    {
                        ViewBag.Style   = "alert alert-danger";
                        ViewBag.Message = "तकनिकी खराबी की वजह से आपका सन्देश नहीं मिला , कृपया दुबारा भेजे.  ";
                    }
                }
                else
                {
                    ViewBag.Saved   = true;
                    ViewBag.Style   = "alert alert-danger";
                    ViewBag.Message = " इस नाम की जानकारी पहले से अंकित है. ";
                }
            }
            BindDropdown(ref obj);
            return(View(obj));
        }