Esempio n. 1
0
 public IHttpActionResult Post(TMS_Deposit accountsDepositDetails)
 {
     if (ModelState.IsValid)
     {
         int c = _tmsDepositBll.Insert(accountsDepositDetails);
         if (c == 1)
         {
             return(Json(new { Msg = "1" }));
         }
         return(Json(new { Msg = "0" }));
     }
     else
     {
         return(Json(new { Msg = "0" }));
     }
 }
Esempio n. 2
0
        public IHttpActionResult UpdateDeposit(int id, TMS_Deposit accountsDepositDetails)
        {
            if (!ModelState.IsValid)
            {
                //return BadRequest(ModelState);
                return(Json(new { Msg = "0" }));
            }

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

            try
            {
                int s = _tmsDepositBll.Update(accountsDepositDetails);
                if (s == 1)
                {
                    return(Json(new { Msg = "1" }));
                }
                return(Json(new { Msg = "0" }));
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DepositMappingExists(id))
                {
                    //return NotFound();
                    return(Json(new { Msg = "0", Reason = "No row affected!" }));
                }
                else
                {
                    throw;
                }
            }
        }
Esempio n. 3
0
 public int Update(TMS_Deposit accountsDepositDetails)
 {
     return(_reposirory.Update(accountsDepositDetails));
 }
Esempio n. 4
0
 public int Insert(TMS_Deposit accountsDepositDetails)
 {
     return(_reposirory.Insert(accountsDepositDetails));
 }