Ejemplo n.º 1
0
        public void SaveData(ModelNotifiedForTag modelNotifiedForTag, out string error)
        {
            TagBsn  bsn    = new TagBsn(wpfConfig);
            TagInfo dbItem = new TagInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForTag), modelNotifiedForTag, typeof(TagInfo), dbItem);

            bsn.UpdateOne(dbItem, out error);
        }
Ejemplo n.º 2
0
        public void TryUpdate(UpdateTagView viewToUpdate, out RestExceptionError error)
        {
            error = null;
            TagInfo dbViewToInclude = new TagInfo();

            try
            {
                Cloner.CopyAllTo(typeof(UpdateTagView), viewToUpdate, typeof(TagInfo), dbViewToInclude);
            }
            catch (Exception ex)
            {
                error = new RestExceptionError();
                error.InternalMessage  = "Internal Error parsing data for (Tag.TryUpdate/Parsing)";
                error.ExceptionMessage = ex.Message;
                error.SourceError      = RestExceptionError._SourceError.ServerSide;
                error.StackTrace       = ex.StackTrace;
            }

            try
            {
                TagBsn bsn     = new TagBsn(restConfig);
                string dbError = null;
                bsn.UpdateOne(dbViewToInclude, out dbError);
                if (dbError != null)
                {
                    error = new RestExceptionError();
                    error.InternalMessage  = "Internal Error Save data for [Tag.TryUpdate]";
                    error.ExceptionMessage = dbError;
                    error.SourceError      = RestExceptionError._SourceError.ServerSide;
                    error.StackTrace       = "";
                }
            }
            catch (Exception ex)
            {
                error = new RestExceptionError();
                error.InternalMessage  = "Internal Error Update data for [Tag.TryUpdate]";
                error.ExceptionMessage = ex.Message;
                error.SourceError      = RestExceptionError._SourceError.ServerSide;
                error.StackTrace       = ex.StackTrace;
            }
        }