public IHttpActionResult Post(TMS_MachineBagDetachment mbd)
 {
     if (ModelState.IsValid)
     {
         int c = _bdBll.Insert(mbd);
         if (c == 1)
         {
             return(Json(new { Msg = "1" }));
         }
         return(Json(new { Msg = "0" }));
     }
     else
     {
         return(Json(new { Msg = "0" }));
     }
 }
        public IHttpActionResult UpdateBank(int id, TMS_MachineBagDetachment mdb)
        {
            if (!ModelState.IsValid)
            {
                //return BadRequest(ModelState);
                return(Json(new { Msg = "0" }));
            }

            if (id != mdb.Id)
            {
                //return BadRequest();
                return(Json(new { Msg = "0" }));
            }

            try
            {
                int s = _bdBll.Update(mdb);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!BankMappingExists(id))
                {
                    //return NotFound();
                    return(Json(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
 public int Update(TMS_MachineBagDetachment mbd)
 {
     return(_reposirory.Update(mbd));
 }
 public int Insert(TMS_MachineBagDetachment mbd)
 {
     return(_reposirory.Insert(mbd));
 }