Ejemplo n.º 1
0
        public IActionResult ChangeProductStatusByAdmin([FromBody] string[] strPIDS)
        {
            IARresponse = BadRequest();
            string strpids = null;

            if (strPIDS.Length > 0)
            {
                for (int iArrCount = 0; iArrCount < strPIDS.Length; iArrCount++)
                {
                    if (strpids != null)
                    {
                        strpids += ',' + strPIDS[iArrCount].ToString();
                    }
                    else
                    {
                        strpids += strPIDS[iArrCount].ToString();
                    }
                }
            }

            try
            {
                if (objadmindb.ChangeVenderStatusByAdmin(strpids) == "")
                {
                    IARresponse = Ok(new { res = "" });
                }
                else
                {
                    IARresponse = BadRequest(new { res = "Try Again later!.." + objadmindb.ChangeProductStatusByAdmin(strpids) });
                }
            }
            catch (Exception ex)
            {
                IARresponse = BadRequest(new { res = ex.Message });
            }
            return(IARresponse);
        }