示例#1
0
        public void Create(ESOP_Product ESOP_Product)
        {
            ESOP_Product.CreateDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ESOP_Product.CreateUser = tempUser.UserName;
            ESOP_Product.Validate();
            this.productRepository.Add(ESOP_Product);
            this.runtimeService.Commit();
        }
示例#2
0
        public void Update(ESOP_Product ESOP_Product)
        {
            ESOP_Product.ModifyDt = DateTime.Now;
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            ESOP_Product.ModifyUser = tempUser.UserName;
            ESOP_Product.Validate();
            var existstb_Sys_Menu = this.GetById(ESOP_Product.Id);

            this.productRepository.SetValues(ESOP_Product, existstb_Sys_Menu);
            this.runtimeService.Commit();
        }
示例#3
0
        public void Save(ESOP_Product product)
        {
            tb_Sys_User tempUser = appCacheService.GetItem("user") as tb_Sys_User;

            var existsdevice = this.GetById(product.Id);

            if (existsdevice == null)
            {
                product.CompCode   = tempUser.CompCode;
                product.CreateDt   = DateTime.Now;
                product.CreateUser = tempUser.UserName;
                product.Validate();
                this.productRepository.Add(product);
            }
            else
            {
                product.ModifyDt   = DateTime.Now;
                product.ModifyUser = tempUser.UserName;
                product.Validate();
                this.productRepository.SetValues(product, existsdevice);
            }

            this.runtimeService.Commit();
        }