Example #1
0
        public static Speak GetSpeak(IYZDbProvider provider, IDbConnection cn, int itemid)
        {
            Speak speak = null;

            try
            {
                using (YZReader reader = new YZReader(provider.GetNotesSpeak(cn, itemid)))
                {
                    if (reader.Read())
                    {
                        speak = new Speak(reader);
                    }
                }
            }
            catch (Exception e)
            {
                throw new BPMException(BPMExceptionType.DBLoadDataErr, "YZAppNotesSpeak", e.Message);
            }

            if (speak == null)
            {
                throw new BPMException(String.Format(Resources.YZStrings.Aspx_RecordNotExist, itemid));
            }

            return(speak);
        }
Example #2
0
 public static void Insert(IYZDbProvider provider, IDbConnection cn, Speak speak)
 {
     try
     {
         provider.Insert(cn, speak);
     }
     catch (Exception e)
     {
         throw new BPMException(BPMExceptionType.DBInsertDataErr, "YZAppNotesSpeak", e.Message);
     }
 }