public async Task <IActionResult> AddorEdit([Bind("PimCatTypeID,Name,Code,Description,CompanyID,CreatedOn,CreatedBy,ModifiedOn,ModifiedBy,Status,IP,VatStatus,VatType,PimCatID")] pimcategorytype pimcategorytype)
        {
            if (ModelState.IsValid)
            {
                if (pimcategorytype.PimCatTypeID == 0)
                {
                    pimcategorytype.Status     = AppConstant.Active;
                    pimcategorytype.CreatedOn  = System.DateTime.Now;
                    pimcategorytype.ModifiedOn = System.DateTime.Now;
                    pimcategorytype.IP         = GETIP.GetIp();
                    pimcategorytype.CompanyID  = AppConstant.CompanyID;
                    context.Add(pimcategorytype);
                }
                else
                {
                    pimcategorytype.Status     = AppConstant.Active;
                    pimcategorytype.ModifiedOn = System.DateTime.Now;
                    pimcategorytype.IP         = GETIP.GetIp();
                    pimcategorytype.CompanyID  = AppConstant.CompanyID;
                    context.Update(pimcategorytype);
                }
                await context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PimCatID"] = new SelectList(context.pimcategory, "PimCatID", "Name", pimcategorytype.pimcategory);
            return(View(pimcategorytype));
        }
        public JsonResult CheckCode(string Code)
        {
            pimcategorytype entities = new pimcategorytype();
            bool            isValid  = !entities.Code.Equals(Code, StringComparison.CurrentCultureIgnoreCase);

            return(Json(isValid));
        }