public static List <LanguageProficiency> SelectAll()
        {
            List <LanguageProficiency> list = new List <LanguageProficiency>();


            DataProvider.ExecuteCmd(GetConnection, "dbo.LanguageProficiency_GetAll",
                                    inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
            },
                                    map : delegate(IDataReader reader, short set)
            {
                LanguageProficiency p = new LanguageProficiency();
                int startingIndex     = 0;    // this number is dependant on the columns one decides to include.
                p.Key          = reader.GetSafeString(startingIndex++);
                p.Code         = reader.GetSafeString(startingIndex++);
                p.Description  = reader.GetSafeString(startingIndex++);
                p.DisplayOrder = reader.GetSafeInt32(startingIndex++);
                p.Name         = reader.GetSafeString(startingIndex++);

                list.Add(p);
            },

                                    returnParameters: null,

                                    cmdModifier: null

                                    );
            return(list);
        }
        public static LanguageProficiency SelectById(int id)
        {
            LanguageProficiency languageproficiency = null;

            DataProvider.ExecuteCmd(GetConnection, "dbo.LanguageProficiency_SelectById",
                                    inputParamMapper : delegate(SqlParameterCollection paramCollection)
            {
                paramCollection.AddWithValue("@Id", id);
            },
                                    map : delegate(IDataReader reader, short set)
            {
                languageproficiency = new LanguageProficiency();
                int startingIndex   = 0;

                languageproficiency.Key          = reader.GetSafeString(startingIndex++);
                languageproficiency.Name         = reader.GetSafeString(startingIndex++);
                languageproficiency.Code         = reader.GetSafeString(startingIndex++);
                languageproficiency.DisplayOrder = reader.GetSafeInt32(startingIndex++);
                languageproficiency.Inactive     = reader.GetSafeBool(startingIndex++);
            },

                                    returnParameters: null, // added this

                                    cmdModifier: null       // added this

                                    );
            return(languageproficiency);
        }
示例#3
0
 public LanguageProficiencyViewModel(MerkatoDbContext context, LanguageProficiency B) : this(context)
 {
     this.Id          = B.Id;
     this.Code        = B.Code;
     this.Name        = B.Name;
     this.Description = B.Description;
     this.Active      = B.Active;
 }
示例#4
0
        public ActionResult DeleteConfirmed(int id)
        {
            LanguageProficiency languageproficiency = db.LanguageProficiency.Find(id);

            db.LanguageProficiency.Remove(languageproficiency);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#5
0
        //
        // GET: /LanguageProficiency/Details/5

        public ActionResult Details(int id = 0)
        {
            LanguageProficiency languageproficiency = db.LanguageProficiency.Find(id);

            if (languageproficiency == null)
            {
                return(HttpNotFound());
            }
            return(View(languageproficiency));
        }
示例#6
0
 public ActionResult Edit(LanguageProficiency languageproficiency)
 {
     if (ModelState.IsValid)
     {
         db.Entry(languageproficiency).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.LanguageId = new SelectList(db.Languages, "Id", "Name", languageproficiency.LanguageId);
     return(View(languageproficiency));
 }
示例#7
0
        //
        // GET: /LanguageProficiency/Edit/5

        public ActionResult Edit(int id = 0)
        {
            LanguageProficiency languageproficiency = db.LanguageProficiency.Find(id);

            if (languageproficiency == null)
            {
                return(HttpNotFound());
            }
            ViewBag.LanguageId = new SelectList(db.Languages, "Id", "Name", languageproficiency.LanguageId);
            return(View(languageproficiency));
        }
示例#8
0
        public LanguageProficiency GetModel()
        {
            LanguageProficiency b = new LanguageProficiency();

            b.Id          = this.Id;
            b.Code        = this.Code;
            b.Name        = this.Name;
            b.Description = this.Description;
            b.Active      = this.Active;

            return(b);
        }
示例#9
0
        public ActionResult Create(LanguageProficiency languageproficiency)
        {
            if (ModelState.IsValid)
            {
                db.LanguageProficiency.Add(languageproficiency);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.LanguageId = new SelectList(db.Languages, "Id", "Name", languageproficiency.LanguageId);
            return(View(languageproficiency));
        }