Пример #1
0
        public int RFKT(AseldQuery ase, IinvdQuery ivd,int pnum)
        {
            string json = string.Empty;
            int result = 0;
            IialgQuery q = new IialgQuery();
            uint id = 0; DateTime dt = new DateTime(); int sun = 0;
            _proditemMgr = new ProductItemMgr(mySqlConnectionString);
            ProductItem Proitems = new ProductItem();

            try
            {
                {//商品id
                    q.item_id = ase.item_id;
                    Proitems.Item_Id = ase.item_id;
                }
                // (DateTime.TryParse(Request.Params["made_date"].ToString(), out dt))
                {//商品製造日期
                    //q.made_dt = ivd.made_date;
                    q.made_dt = new DateTime(3000,1,1);
                }
                //if (int.TryParse(Request.Params["prod_qty"].ToString(), out sun))
                {//商品原有數量
                    q.qty_o = ivd.prod_qty;
                }
                //if (int.TryParse(Request.Params["pnum"].ToString(), out sun))
                {//商品撿貨數量
                    q.pnum = pnum;
                }
                //if (!string.IsNullOrEmpty(Request.Params["loc_id"].ToString()))
                {//商品撿貨數量
                    q.loc_id = ase.sel_loc;
                }
                //if (!string.IsNullOrEmpty(Request.Params["order_id"]))
                {
                    q.order_id = ase.ord_id.ToString();
                }
                q.create_user = (System.Web.HttpContext.Current.Session["caller"] as Caller).user_id;
                //進行庫調
                _iagDao = new IialgDao(mySqlConnectionString);
                Caller call = new Caller();
                call = (System.Web.HttpContext.Current.Session["caller"] as Caller);
                string path = "/WareHouse/KutiaoAddorReduce";
                //if (q.loc_id == "YY999999") 無主料位時也進行庫調
                if (false)
                {
                    json = "{success:false}";
                }
                else
                {
                    Proitems.Item_Stock = q.pnum - q.qty_o;
                    result = _iagDao.addIialgIstock_AutoMarket(q);
                    if (result == 2)
                    {
                        json = "{success:true,msg:2}";
                    }
                    if (result == 100)
                    {
                        //_proditemMgr.UpdateItemStock(Proitems, path, call);
                        json = "{success:true,msg:100}";
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("MarketTallyMgr-->RFKT-->" + ex.Message, ex);
            }
            return result;
        }
Пример #2
0
  public IialgMgr(string connectionString)
 {
     _iagDao = new IialgDao(connectionString);
     _maguserDao = new ManageUserDao(connectionString);
 }