Пример #1
0
        public async Task <ActionResult> DeleteConfirmed(long id)
        {
            qenSkill qenSkill = await db.qenSkills.FindAsync(id);

            db.qenSkills.Remove(qenSkill);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult DeleteqenSkills(long qenSkillsID)
        {
            qenSkill oqenSkill = null;

            oqenSkill = db.qenSkills.Where(ex => ex.qenSkillsID == qenSkillsID).FirstOrDefault();
            if (oqenSkill != null)
            {
                db.qenSkills.Remove(oqenSkill);
                db.SaveChanges();
            }
            //return RedirectToAction("skills", new { qenid = oqenSkill.qenSkillsID });
            return(RedirectToAction("skills", new { qenid = qenSkillsID }));
        }
Пример #3
0
        // GET: qenSkills/Delete/5
        public async Task <ActionResult> Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            qenSkill qenSkill = await db.qenSkills.FindAsync(id);

            if (qenSkill == null)
            {
                return(HttpNotFound());
            }
            return(View(qenSkill));
        }
Пример #4
0
        // GET: qenSkills/Edit/5
        public async Task <ActionResult> Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            qenSkill qenSkill = await db.qenSkills.FindAsync(id);

            if (qenSkill == null)
            {
                return(HttpNotFound());
            }
            ViewBag.qenID    = new SelectList(db.qendidateLists, "qenID", "qenName", qenSkill.qenID);
            ViewBag.skillsID = new SelectList(db.skills, "skillsID", "skillName", qenSkill.skillsID);
            return(View(qenSkill));
        }
Пример #5
0
        public ActionResult AddSkills(qenSkillName model)
        {
            try
            {
                qenSkill oqenSkill = null;
                oqenSkill = db.qenSkills.Where(ex => ex.qenSkillsID == model.qenSkillsID).FirstOrDefault();
                if (oqenSkill != null)
                {
                    int skill_id = checkValuExist(model.skillName.ToString());
                    oqenSkill.skillsID        = skill_id;
                    oqenSkill.yearOfExp       = model.yearOfExp;
                    oqenSkill.qenID           = model.qenID;
                    oqenSkill.qenSkillsID     = model.qenSkillsID;
                    db.Entry(oqenSkill).State = EntityState.Modified;
                    db.SaveChanges();
                }
                else
                {
                    oqenSkill = new qenSkill();
                    int skill_id = checkValuExist(model.skillName.ToString());
                    oqenSkill.skillsID  = skill_id;
                    oqenSkill.yearOfExp = model.yearOfExp;
                    oqenSkill.qenID     = model.qenID;
                    db.qenSkills.Add(oqenSkill);
                    db.SaveChanges();
                }

                return(RedirectToAction("skills", new { qenid = model.qenID }));
            }
            catch (Exception ex)
            {
                TempData["msg"] = ex.Message.ToString();
                app_error_log oapp_error_log = new app_error_log();

                oapp_error_log.user_id         = Convert.ToInt32(model.qenID);
                oapp_error_log.error_message   = ex.Message.ToString();
                oapp_error_log.ApplicationName = "NewsLetter";
                oapp_error_log.created_date    = DateTime.Now;
                db.app_error_log.Add(oapp_error_log);
                db.SaveChanges();
                return(RedirectToAction("Error"));
            }
        }
Пример #6
0
        public async Task <ActionResult> Edit([Bind(Include = "qenSkillsID,qenID,skillsID,yearOfExp")] qenSkill qenSkill)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Entry(qenSkill).State = EntityState.Modified;
                    await db.SaveChangesAsync();

                    return(RedirectToAction("Index"));
                }
            }
            catch (Exception ex)
            {
                TempData["msg"] = ex.Message.ToString();
                BaseUtil.CaptureErrorValues(ex);
                return(RedirectToAction("Error"));
            }
            ViewBag.qenID    = new SelectList(db.qendidateLists, "qenID", "qenName", qenSkill.qenID);
            ViewBag.skillsID = new SelectList(db.skills, "skillsID", "skillName", qenSkill.skillsID);
            return(View(qenSkill));
        }
Пример #7
0
        // GET: qenSkills/Details/5
        public async Task <ActionResult> Details(long?id)
        {
            try
            {
                if (id == null)
                {
                    return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
                }
                qenSkill qenSkill = await db.qenSkills.FindAsync(id);

                if (qenSkill == null)
                {
                    return(HttpNotFound());
                }
                return(View(qenSkill));
            }
            catch (Exception ex)
            {
                TempData["msg"] = ex.Message.ToString();
                BaseUtil.CaptureErrorValues(ex);
                return(RedirectToAction("Error"));
            }
        }