コード例 #1
0
        public ActionResult Form(string id)
        {
            Pro_TemplateItem theData = null;

            if (id.Contains("cache_"))
            {
                string       str = id.Replace("cache_", "");
                Sto_Material mat = _sto_MaterialBusiness.GetEntity(str);
                theData = new Pro_TemplateItem()
                {
                    MatName = mat.MatName,
                    MatNo   = mat.MatNo,
                    UnitNo  = mat.UnitNo,
                    GuiGe   = mat.GuiGe,
                    Context = mat.Context
                };
            }
            else
            {
                theData = id.IsNullOrEmpty() ? new Pro_TemplateItem()
                {
                    Id = Guid.NewGuid().ToSequentialGuid()
                } : _pro_TemplateItemBusiness.GetEntity(id);
                if (theData == null)
                {
                    theData = new Pro_TemplateItem()
                    {
                        Id = Guid.NewGuid().ToSequentialGuid()
                    };
                }
            }
            return(View(theData));
        }
コード例 #2
0
        /// <summary>
        /// 用于查询物料缓存id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ActionResult Find(string id)
        {
            Sto_Material _o = new Sto_Material()
            {
                Id = id
            };

            return(View(_o));
        }
コード例 #3
0
        /// <summary>
        /// 保存
        /// </summary>
        /// <param name="theData">保存的数据</param>
        public ActionResult SaveData(Sto_Material theData)
        {
            if (theData.Id.IsNullOrEmpty())
            {
                theData.Id = Guid.NewGuid().ToSequentialGuid();

                _sto_MaterialBusiness.AddData(theData);
            }
            else
            {
                _sto_MaterialBusiness.UpdateData(theData);
            }

            return(Success());
        }
コード例 #4
0
        public ActionResult FindCacheItem(string id)
        {
            var theData = _systemCache.GetCache <Sto_Material>(id);

            if (theData == null)
            {
                theData = new Sto_Material();
            }
            else
            {
                //清除缓存
                _systemCache.RemoveCache(id);
            }

            return(Content(theData.ToJson()));
        }
コード例 #5
0
        public ActionResult QueryByMatNo(string matNo)
        {
            Sto_Material _m = _sto_MaterialBusiness.QueryMaterial(matNo);

            return(Content(_m.ToJson()));
        }