public void SaveDrugGlassWare(string Id, DrugGlassWareEntity entity)
        {
            IRepository db = new RepositoryFactory().BaseRepository().BeginTrans();

            try
            {
                DrugGlassWareEntity drug = this.GetDrugGlassWareEntity(Id);
                if (drug == null)
                {
                    if (string.IsNullOrEmpty(entity.GlassWareId))
                    {
                        entity.GlassWareId = Guid.NewGuid().ToString();
                    }
                    entity.CreateDate = DateTime.Now;
                    db.Insert <DrugGlassWareEntity>(entity);
                    db.Commit();
                }
                else
                {
                    entity.Modify(Id);
                    //entity.Files = null;
                    db.Update <DrugGlassWareEntity>(entity);
                    db.Commit();
                }
            }
            catch (Exception)
            {
                db.Rollback();
                throw;
            }
        }
        public bool DeleteGlassWare(DrugGlassWareEntity entity)
        {
            IRepository db = new RepositoryFactory().BaseRepository();

            if (db.Delete(entity) > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #3
0
 public bool DeleteGlassWare(DrugGlassWareEntity entity)
 {
     return(dis.DeleteGlassWare(entity));
 }
Exemple #4
0
 public void SaveDrugGlassWare(string Id, DrugGlassWareEntity entity)
 {
     dis.SaveDrugGlassWare(Id, entity);
 }