public ActionResult AjaxMaintainQuery()
        {
            string productSysNoText = Request.Form["ProductSysNo[]"];

            if (!string.IsNullOrEmpty(productSysNoText))
            {
                int productSysNo = 0;
                int.TryParse(productSysNoText, out productSysNo);

                if (productSysNo > 0)
                {
                    int?currentSellerSysNo = null;

                    int currentSellerSysNoValue = UserAuthHelper.GetCurrentUser().SellerSysNo;
                    if (currentSellerSysNoValue > 0)
                    {
                        currentSellerSysNo = currentSellerSysNoValue;
                    }

                    var result = ProductAttachmentService.GetProductAttachmentList(productSysNo, currentSellerSysNo);

                    return(AjaxGridJson(result));
                }
            }

            return(Json(1));
        }
        public ActionResult AjaxSave()
        {
            ProductAttachmentStatus status = new ProductAttachmentStatus();

            string qtyText = Request.Form["Quantity"];
            int    qty     = 0;

            int.TryParse(qtyText, out qty);
            if (qty > 0)
            {
                ProductAttachmentInfo entity = new ProductAttachmentInfo();

                entity.AttachmentID = Request.Form["AttachmentID"];
                entity.ProductID    = Request.Form["ProductID"];
                entity.Quantity     = qty;
                entity.InUser       = UserAuthHelper.GetCurrentUser().UserID;
                entity.InUserName   = UserAuthHelper.GetCurrentUser().UserID;
                entity.InUserSysNo  = UserAuthHelper.GetCurrentUser().UserSysNo;


                status = ProductAttachmentService.CreateProductAttachment(entity);
            }

            return(Json(status));
        }
        public ActionResult AjaxRemove()
        {
            string sysNoText = Request.Form["ProductSysNo"];

            int productSysNo = 0;

            int.TryParse(sysNoText, out productSysNo);

            ProductAttachmentService.DeleteAttachmentByProductSysNo(productSysNo);

            return(Json(1));
        }
        public ActionResult Maintain()
        {
            string productSysNoText = Request["ProductSysNo"];

            if (!string.IsNullOrEmpty(productSysNoText))
            {
                int productSysNo = 0;
                int.TryParse(productSysNoText, out productSysNo);
                ProductAttachmentStatus status = ProductAttachmentService.CheckTheProductStatusForEdit(productSysNo);
                ViewBag.ProductSysNo = status.ProductSysNo;
                ViewBag.ProductID    = status.ProductID;
            }

            return(View());
        }
        public ActionResult AjaxRemoveAttachment()
        {
            string productSysNoText = Request.Form["ProductSysNo"];
            string sysNoText        = Request.Form["SysNo"];

            int productSysNo = 0;

            int.TryParse(productSysNoText, out productSysNo);

            int sysNo = 0;

            int.TryParse(sysNoText, out sysNo);

            if (productSysNo > 0 && sysNo > 0)
            {
                ProductAttachmentService.DeleteSingleAttachment(productSysNo, sysNo);
            }

            return(Json(1));
        }
        public ActionResult AjaxQuery()
        {
            ProductCategoryQueryFilter queryCriteria = BuildQueryFilterEntity <ProductCategoryQueryFilter>();

            queryCriteria.SortFields = "ProductSysNo";

            int?currentSellerSysNo      = null;
            int currentSellerSysNoValue = UserAuthHelper.GetCurrentUser().SellerSysNo;

            if (currentSellerSysNoValue > 0)
            {
                currentSellerSysNo = currentSellerSysNoValue;
            }

            queryCriteria.SellerSysNo = currentSellerSysNo;

            QueryResult <ProductCategoryQueryBasicInfo> result
                = ProductAttachmentService.QueryProductCategorys(queryCriteria);

            return(AjaxGridJson(result));
        }