コード例 #1
0
        public ActionResult Edit(int id, int RId)
        {
            EmpRelativeService objRel     = new EmpRelativeService();
            EmpRelativeItem    objRelItem = new EmpRelativeItem();

            objRelItem = objRel.GetById(RId);
            //Session["Empid"] = objRelItem.EmpId;
            List <EmpRelativeItem> lstRel = new List <EmpRelativeItem>();

            objRelItem.ListRelative = new List <EmpRelativeItem>();
            objRelItem.ListRelative.AddRange(lstRel);
            ViewBag.RId    = RId;
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objRelItem));
        }
コード例 #2
0
        public ActionResult Create()
        {
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());

            objRel = new EmpRelativeService();
            List <EmpRelativeItem> listRel = new List <EmpRelativeItem>();

            listRel       = objRel.RelativeListData(Empid);
            ViewBag.Empid = Empid;
            EmpRelativeItem objRelitem = new EmpRelativeItem();

            objRelitem.ListRelative = new List <EmpRelativeItem>();
            objRelitem.ListRelative.AddRange(listRel);
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objRelitem));
        }
コード例 #3
0
        public ActionResult delete(int id, int cid, int menuid)
        {
            //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            EmpRelativeService     objService = new EmpRelativeService();
            List <EmpRelativeItem> lstItem    = new List <EmpRelativeItem>();
            EmpRelativeItem        objDoc     = new EmpRelativeItem();

            objDoc = objService.GetById(cid);
            db.EmployeeRelatives.Remove(db.EmployeeRelatives.Find(cid));
            db.SaveChanges();

            //ViewBag.Empid = Empid;
            ViewBag.Menuid = Request.QueryString["menuId"];

            return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }));
        }
コード例 #4
0
        public ActionResult Create(EmpRelativeItem model)
        {
            model.Status = "Active";
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());

            model.EmpId = Empid;
            string uid = null;

            if (Session["UserId"] != null)
            {
                uid = Session["UserId"].ToString();
            }
            model.CreatedBy   = uid;
            model.CreatedDate = System.DateTime.Now;
            objRel            = new EmpRelativeService();
            objRel.Insert(model);
            return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }));
        }