public ActionResult edit(BS_Positions position)
        {
            if (String.IsNullOrEmpty(position.PositionID))
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Missing info"
                }, JsonRequestBehavior.AllowGet));
            }

            var check = db.BS_Positions.Find(position.PositionID);

            if (check == null)
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Không tìm thấy thông tin"
                }, JsonRequestBehavior.AllowGet));
            }

            check.PositionName = position.PositionName;
            check.IsActive     = position.IsActive;


            db.Entry(check).State = System.Data.Entity.EntityState.Modified;
            db.SaveChanges();


            return(Json(new ResultInfo()
            {
                error = 0, msg = "", data = check
            }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult create(BS_Positions position)
        {
            if (String.IsNullOrEmpty(position.PositionID))
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Missing info"
                }, JsonRequestBehavior.AllowGet));
            }

            var check = db.BS_Positions.Find(position.PositionID);

            if (check != null)
            {
                return(Json(new ResultInfo()
                {
                    error = 1, msg = "Đã tồn tại"
                }, JsonRequestBehavior.AllowGet));
            }


            position.IsActive = true;
            db.BS_Positions.Add(position);

            db.SaveChanges();

            return(Json(new ResultInfo()
            {
                error = 0, msg = "", data = position
            }, JsonRequestBehavior.AllowGet));
        }