コード例 #1
0
        public ActionResult View(int id, int Absid)
        {
            EmpAbscondingService objAbsService = new EmpAbscondingService();
            EmpAbscondingItem    objAbsItem    = new EmpAbscondingItem();

            objAbsItem = objAbsService.GetById(Absid);
            //Session["Empid"] = objAbsItem.EmpId;
            List <EmpAbscondingItem> lstAbs = new List <EmpAbscondingItem>();

            objAbsItem.ListAbsconding = new List <EmpAbscondingItem>();
            objAbsItem.ListAbsconding.AddRange(lstAbs);
            ViewBag.Absid  = Absid;
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objAbsItem));
        }
コード例 #2
0
        public ActionResult delete(int id, int AId, int menuid)
        {
            //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            EmpAbscondingService     objService = new EmpAbscondingService();
            List <EmpAbscondingItem> lstItem    = new List <EmpAbscondingItem>();
            EmpAbscondingItem        objDoc     = new EmpAbscondingItem();

            objDoc = objService.GetById(AId);
            db.EmployeeAbscondings.Remove(db.EmployeeAbscondings.Find(AId));
            db.SaveChanges();

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

            return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }));
        }
コード例 #3
0
        public ActionResult Create(EmpAbscondingItem 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;
            EmpAbscondingService objEmpAbs = new EmpAbscondingService();

            objEmpAbs.Insert(model);
            return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }));
        }
コード例 #4
0
        public ActionResult Create()
        {
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            EmpAbscondingService     objAbs  = new EmpAbscondingService();
            List <EmpAbscondingItem> listAbs = new List <EmpAbscondingItem>();

            listAbs       = objAbs.AbsListData(Empid);
            ViewBag.EmpId = Empid;   // 1st stmt Edit
            EmpAbscondingItem objAbsitem = new EmpAbscondingItem();

            objAbsitem.ListAbsconding = new List <EmpAbscondingItem>();
            objAbsitem.ListAbsconding.AddRange(listAbs);

            listAbs = objAbs.GetAbscondingDoc(Empid);
            objAbsitem.ListAbscondingDoc = new List <EmpAbscondingItem>();
            objAbsitem.ListAbscondingDoc.AddRange(listAbs);
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objAbsitem));
        }
コード例 #5
0
        public ActionResult Edit(EmpAbscondingItem model)
        {
            EmpAbscondingService objAbs = new EmpAbscondingService();

            model.AbscId = model.AId;
            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.UpdatedBy   = uid;
            model.UpdatedDate = System.DateTime.Now;
            objAbs.Update(model);
            ViewBag.EmpId = Empid;  // 2nd stmt Edit
            return(RedirectToAction("Create", new { @id = Empid, @menuId = model.Viewbagidformenu }));
        }