示例#1
0
        public void SaveData(ModelNotifiedForShippers modelNotifiedForShippers, out string error)
        {
            ShippersBsn  bsn    = new ShippersBsn(wpfConfig);
            ShippersInfo dbItem = new ShippersInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForShippers), modelNotifiedForShippers, typeof(ShippersInfo), dbItem);

            bsn.UpdateOne(dbItem, out error);
        }
示例#2
0
        public void TryUpdate(UpdateShippersView viewToUpdate, out RestExceptionError error)
        {
            error = null;
            ShippersInfo dbViewToInclude = new ShippersInfo();

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

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