예제 #1
0
        public ActionResult Create()
        {
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());

            objQualService = new EmpQualificationService();
            List <EmpQualificationItem> listQual = new List <EmpQualificationItem>();

            listQual      = objQualService.ExperienceListData(Empid);
            ViewBag.Empid = Empid;
            EmpQualificationItem objQualitem = new EmpQualificationItem();

            objQualitem.ListQualification = new List <EmpQualificationItem>();
            objQualitem.ListQualification.AddRange(listQual);

            List <clsMasterData> lstMaster = new List <clsMasterData>();

            lstMaster = objQualService.GetALLIComp();
            objQualitem.ListMasterDetails = new List <clsMasterData>();
            objQualitem.ListMasterDetails.AddRange(lstMaster);

            listQual = objQualService.GetQualificationDoc(Empid);
            objQualitem.ListQualificationDoc = new List <EmpQualificationItem>();
            objQualitem.ListQualificationDoc.AddRange(listQual);
            ViewBag.Menuid = Request.QueryString["menuId"];
            return(View(objQualitem));
        }
예제 #2
0
        public int Update(EmpQualificationItem model)
        {
            Mapper.CreateMap <EmpQualificationItem, EmployeeQualification>();
            EmployeeQualification objQual = DBcontext.EmployeeQualifications.SingleOrDefault(m => m.Qid == model.Qid);

            objQual = Mapper.Map(model, objQual);
            return(DBcontext.SaveChanges());
        }
예제 #3
0
 public EmpQualificationItem GetById(int id)
 {
     try
     {
         Mapper.CreateMap <EmployeeQualification, EmpQualificationItem>();
         EmployeeQualification objQual     = DBcontext.EmployeeQualifications.SingleOrDefault(m => m.Qid == id);
         EmpQualificationItem  objQualItem = Mapper.Map <EmpQualificationItem>(objQual);
         return(objQualItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
예제 #4
0
 public int Insert(EmpQualificationItem model)
 {
     try
     {
         Mapper.CreateMap <EmpQualificationItem, EmployeeQualification>();
         EmployeeQualification objQual = Mapper.Map <EmployeeQualification>(model);
         DBcontext.EmployeeQualifications.Add(objQual);
         return(DBcontext.SaveChanges());
     }
     catch (Exception)
     {
         throw;
     }
 }
예제 #5
0
        public ActionResult delete(int id, int QId, int menuid)
        {
            //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            EmpQualificationService     objService = new EmpQualificationService();
            List <EmpQualificationItem> lstItem    = new List <EmpQualificationItem>();
            EmpQualificationItem        objDoc     = new EmpQualificationItem();

            objDoc = objService.GetById(QId);
            db.EmployeeQualifications.Remove(db.EmployeeQualifications.Find(QId));
            db.SaveChanges();

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

            return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] }));
        }
예제 #6
0
        public ActionResult Create(EmpQualificationItem model)
        {
            int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());

            model.Empid    = Empid;
            objQualService = new EmpQualificationService();
            string uid = null;

            if (Session["UserId"] != null)
            {
                uid = Session["UserId"].ToString();
            }
            model.CreatedDate = System.DateTime.Now;
            model.CreatedBy   = uid;
            objQualService.Insert(model);
            return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu }));
        }
예제 #7
0
        public ActionResult View(int id, int VQid)
        {
            objQualService = new EmpQualificationService();
            EmpQualificationItem objQualItem = new EmpQualificationItem();

            objQualItem = objQualService.GetById(VQid);
            //Session["Empid"] = objExpItem.EmpId;
            List <EmpQualificationItem> lstDl = new List <EmpQualificationItem>();

            objQualItem.ListQualification = new List <EmpQualificationItem>();
            objQualItem.ListQualification.AddRange(lstDl);

            List <clsMasterData> lstMaster = new List <clsMasterData>();

            lstMaster = objQualService.GetALLIComp();
            objQualItem.ListMasterDetails = new List <clsMasterData>();
            objQualItem.ListMasterDetails.AddRange(lstMaster);
            ViewBag.Menuid = Request.QueryString["menuId"];
            ViewBag.VQid   = VQid;
            return(View(objQualItem));
        }