Esempio n. 1
0
        public ResultBM UpdateItemType(ItemTypeBM itemTypeBm)
        {
            try
            {
                ItemTypeDAL itemTypeDal = new ItemTypeDAL();
                ItemTypeDTO itemTypeDto = null;

                ResultBM validationResult = IsValid(itemTypeBm);
                if (!validationResult.IsValid())
                {
                    return(validationResult);
                }

                itemTypeDto = new ItemTypeDTO(itemTypeBm.id, itemTypeBm.Name, itemTypeBm.category, itemTypeBm.Comment, itemTypeBm.Perishable);
                itemTypeDal.UpdateItemType(itemTypeDto);

                return(new ResultBM(ResultBM.Type.OK, "Se ha creado el ítem " + itemTypeBm.Name + ".", itemTypeBm));
            }
            catch (Exception exception)
            {
                return(new ResultBM(ResultBM.Type.EXCEPTION, SessionHelper.GetTranslation("UPDATING_ERROR") + " " + exception.Message, exception));
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 修改试题类别
 /// </summary>
 /// <param name="itemType">试题类别</param>
 /// <returns>数据库受影响的行数</returns>
 public int UpdateItemType(ItemType itemType)
 {
     return(dal.UpdateItemType(itemType));
 }