示例#1
0
        public void SaveData(ModelNotifiedForCustomerCustomerDemo modelNotifiedForCustomerCustomerDemo, out string error)
        {
            CustomerCustomerDemoBsn  bsn    = new CustomerCustomerDemoBsn(wpfConfig);
            CustomerCustomerDemoInfo dbItem = new CustomerCustomerDemoInfo();

            Cloner.CopyAllTo(typeof(ModelNotifiedForCustomerCustomerDemo), modelNotifiedForCustomerCustomerDemo, typeof(CustomerCustomerDemoInfo), dbItem);

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

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

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