Esempio n. 1
0
        public async Task <JsonResult> GetbyID(int ID)
        {
            var isAccessAvaiable = IsAccessAvaiable();

            if (isAccessAvaiable.IsNull())
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.doesnothavepermission }, JsonRequestBehavior.AllowGet));
            }
            var result = await ProductCategoriesCaller.GetProductCategory("ProductCategories/GetByID/" + ID, isAccessAvaiable);

            if (result == null)
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.RecordNotFound }, JsonRequestBehavior.AllowGet));
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 2
0
        public async Task <JsonResult> Update(ProductCategories ngl)
        {
            var isAccessAvaiable = IsAccessAvaiable();

            if (isAccessAvaiable.IsNull())
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.doesnothavepermission }, JsonRequestBehavior.AllowGet));
            }
            var result = await ProductCategoriesCaller.PutProductCategory("ProductCategories/EditRecord", ngl, isAccessAvaiable);

            if (result)
            {
                return(Json(new { Return_Cd = true }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.InsertFail }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 3
0
        public async Task <JsonResult> Add(ProductCategories ngl)
        {
            var isAccessAvaiable = IsAccessAvaiable();

            if (isAccessAvaiable.IsNull())
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.doesnothavepermission }, JsonRequestBehavior.AllowGet));
            }
            //if (CheckKey(ngl.Name))
            //{
            //    return Json(new { Return_Cd = false, ErrorMess = MessageContant.DuplicateRecord }, JsonRequestBehavior.AllowGet);
            //}
            var result = await ProductCategoriesCaller.PostProductCategory("ProductCategories/AddNewRecord", ngl, isAccessAvaiable);

            if (result)
            {
                return(Json(new { Return_Cd = true }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { Return_Cd = false, ErrorMess = MessageContant.InsertFail }, JsonRequestBehavior.AllowGet));
            }
        }