public string QueryStock()
        {
            string json = string.Empty;
            BLL.gigade.Model.Vendor vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"];
            int writd_Id = Convert.ToInt32(vendorModel.vendor_id);

            ProductItemTemp query = new ProductItemTemp();
            if (!string.IsNullOrEmpty(Request.Params["product_id"]))
            {
                query.Product_Id = Request.Params["product_id"].ToString();
            }
            query.Writer_Id = writd_Id;

            //查找臨時表是否有記錄
            _productItemTempMgr = new ProductItemTempMgr(connectionString);
            json = _productItemTempMgr.QueryStockByVendor(query);

            return json;
        }
Exemplo n.º 2
0
        public string QueryStock()
        {

            BLL.gigade.Model.Vendor vendorModel = (BLL.gigade.Model.Vendor)Session["vendor"];
            string json = string.Empty;
            int writerID = (int)vendorModel.vendor_id;
            uint pid = 0;
            try
            {
                ProductItemTemp query = new ProductItemTemp();
                if (!string.IsNullOrEmpty(Request.Params["product_id"]))
                {
                    if (uint.TryParse(Request.Params["product_id"].ToString(), out pid))
                    {//查詢商品列表中正式表的詳細資料
                        _productItemMgr = new ProductItemMgr(connectionString);
                        ProductItem pItem = new ProductItem();
                        pItem.Product_Id = uint.Parse(Request.Params["product_id"]);
                        _productItemMgr.Query(pItem);
                        json = _productItemMgr.QueryStock(pItem);

                    }
                    else
                    {
                        query.Product_Id = Request.Params["product_id"].ToString();

                        query.Writer_Id = writerID;

                        //查找臨時表是否有記錄
                        _productItemTempMgr = new ProductItemTempMgr(connectionString);

                        json = _productItemTempMgr.QueryStockByVendor(query);
                    }

                }
                else
                {
                    json = "{success:false,msg:'" + Resources.VendorProduct.NOTFOUNTKEY + "'}";
                }
            }
            catch (Exception ex)
            {
                Log4NetCustom.LogMessage logMessage = new Log4NetCustom.LogMessage();
                logMessage.Content = string.Format("TargetSite:{0},Source:{1},Message:{2}", ex.TargetSite.Name, ex.Source, ex.Message);
                logMessage.MethodName = System.Reflection.MethodBase.GetCurrentMethod().Name;
                log.Error(logMessage);
                json = "{success:false,msg:'" + ex.Message + "'}";
            }
            return json;
        }
        public string QueryStock()
        {
            string json = string.Empty;
            ProductItemTemp query = new ProductItemTemp();
            if (!string.IsNullOrEmpty(Request.Params["product_id"]))
            {
                query.Product_Id = Request.Params["product_id"].ToString();
            }
            //if (!string.IsNullOrEmpty(Request.Params["OldProductId"]))
            //{
            //    query.Product_Id = Request.Params["OldProductId"].ToString();
            //}
            //query.Writer_Id = (Session["caller"] as Caller).user_id;

            //查找臨時表是否有記錄
            _productItemTempMgr = new ProductItemTempMgr(connectionString);
            json = _productItemTempMgr.QueryStockByVendor(query);

            return json;
        }